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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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