Jump to content

Exclude graphics from Camera Shake


wantafanta
 Share

Recommended Posts

I am using the "camera.main.shake()" function

How to do make sure that certain graphics like the UI ignore the shake?

For example if had this box

var newGraphic = this.add.graphics({ lineStyle: { width: 2, color: 0x555555 }, fillStyle: { color: 0xeeeeee } });
var rect = new Phaser.Geom.Rectangle();

rect.width = 500;
rect.height =500;
rect.x = 0;
rect.y = 0;

newGraphic.strokeRectShape(rect);

Thanks

Link to comment
Share on other sites

Personally, I found that using multiple scenes is a lot more comfortable for many things, like UI elements etc. because it can get messy if your game gets bigger. It kind of sorts it. And also is not affected by the camera of the other screen - as Rich already pointed out.

The only thing is, that you have to get sure the new scene (if your game is bigger than the view) is aligned with the underlying scene.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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