Jump to content

Weird effect when moving the camera?[FIXED]


Igor Georgiev
 Share

Recommended Posts

So I've tried to move the camera outside the world vertically... :) 
I have created sprites outside the world set the bounds the following way:
 

startBonus: function()
    {
        autoBtnDesk.inputEnabled = false;
        this.bonusGame = new BonusGameView(this.game);
        this.bonusGame.createBonusLvl();
        this.game.camera.bounds = this.game.world.height * 2;
        TweenMax.to(this.game.camera, 4, {y:this.game.world.height});

    },

And I got the following side-effect after the camera moves to the content bellow the world:

Untitled.png

So does anyone know why this happens? Is it because I move the camera outside the bounding box?
I am afraid to set the world size in boot, cause a lot of stuff have coordinates according to the world.

Link to comment
Share on other sites

19 minutes ago, Igor Georgiev said:

So I've tried to move the camera outside the world vertically... :) 
I have created sprites outside the world set the bounds the following way:
 

startBonus: function()
    {
        autoBtnDesk.inputEnabled = false;
        this.bonusGame = new BonusGameView(this.game);
        this.bonusGame.createBonusLvl();
        this.game.camera.bounds = this.game.world.height * 2;
        TweenMax.to(this.game.camera, 4, {y:this.game.world.height});

    },

And I got the following side-effect after the camera moves to the content bellow the world:

Untitled.png

So does anyone know why this happens? Is it because I move the camera outside the bounding box?
I am afraid to set the world size in boot, cause a lot of stuff have coordinates according to the world.

Fixed it by adding a quad with fill for background.  I guess any other background would do the trick. Hope it helps for future readers.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...