opendevcode Posted February 25, 2014 Share Posted February 25, 2014 Hello, I have tried Phaser for a couple of weeks and I am trying to create something like a zoom in zoom out functionality on a 2D platformer. I am having trouble with setting the view of the game. I am using Phaser 1.1.3 First Approach:this.camera.screenView.width *= 5;I tried giving a different value for the camera's screenview. Screenview values changed but there are no changes with the camera's view. Second Approach:this.game.world.scale.x = 10I tried giving a different value for the world's scale, but the result is the same with the first approach. Nothing happend Third Approach:gameGroup.setAll('scale.x', 5);platforms.setAll('scale.x', 5);gameGroup.add(platforms);I tried creating a nested group but I was receiving an undefined errors. TypeError: e is undefined @ filephaser.min.js:2 Any ideas, suggestions or samples on how I should do this are welcomed. Thank you Link to comment Share on other sites More sharing options...
rich Posted February 25, 2014 Share Posted February 25, 2014 Scale the world container. In 1.1.3 it's a bit hidden, so it'd be like game.world._container.scale.set(x,y) (although I probably wouldn't recommend it for 1.1.3 tbh) In 2.0 it's just game.world.scale, and works fine Link to comment Share on other sites More sharing options...
opendevcode Posted February 26, 2014 Author Share Posted February 26, 2014 Thank you Rich Link to comment Share on other sites More sharing options...
DaveSomething Posted December 25, 2015 Share Posted December 25, 2015 game.world.scale works like a charm -- but is there any way to use it for zoom, without effecting certain graphics? For example, I have a couple of Buttons that I would like to stay at constant size, no matter how much I zoom in or out. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts