Jump to content

Tween world bounds


fitness23
 Share

Recommended Posts

If you don't care about the camera or physics, you can just tween game.world.bounds {width, height}

But maybe physics is the most important part, so:

var world = this.world;
var bounds = world.bounds.clone();

this.add.tween(bounds)
  .to({
    width: 2000
  })
  .onUpdateCallback(function () {
    world.resize(bounds.width, bounds.height);
  })
  .start();

 

Link to comment
Share on other sites

13 hours ago, samme said:

If you don't care about the camera or physics, you can just tween game.world.bounds {width, height}

But maybe physics is the most important part, so:


var world = this.world;
var bounds = world.bounds.clone();

this.add.tween(bounds)
  .to({
    width: 2000
  })
  .onUpdateCallback(function () {
    world.resize(bounds.width, bounds.height);
  })
  .start();

 

This worked perfectly! Thanks so much I would never have got that.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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