fitness23 Posted June 14, 2017 Share Posted June 14, 2017 I've been looking everywhere but is there a way to tween animate world bounds? IE tween the width: From: this.game.world.setBounds(0, 0, 1400, 500); To: this.game.world.setBounds(0, 0, 2000, 500); Link to comment Share on other sites More sharing options...
samme Posted June 14, 2017 Share Posted June 14, 2017 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 More sharing options...
fitness23 Posted June 15, 2017 Author Share Posted June 15, 2017 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 More sharing options...
Recommended Posts