Starcluster Posted February 3, 2016 Share Posted February 3, 2016 Is it possible to make the world size smaller than the screen size? When i set the x and y coordinate of the world bounds to 100,100 (game.world.setBounds(100, 100, ...)), the collision still happens at 0,0. The change of the width and height seems to work. Link to comment Share on other sites More sharing options...
veggis Posted February 3, 2016 Share Posted February 3, 2016 If you want the canvas to rescale to screensize you can use game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; in your preload. Link to comment Share on other sites More sharing options...
Starcluster Posted February 3, 2016 Author Share Posted February 3, 2016 I use Phaser.ScaleManager.SHOW_ALL. But i think your solution has nothing to do with my problem. Link to comment Share on other sites More sharing options...
veggis Posted February 3, 2016 Share Posted February 3, 2016 @Starcluster You want to set worldbounds to be equals or smaller than the screensize? You can use viewport to get it; http://phaser.io/examples/v2/display/viewport. Link to comment Share on other sites More sharing options...
Starcluster Posted February 4, 2016 Author Share Posted February 4, 2016 I want the world bounds to be smaller than the screensize. I'm making a breakout clone. The ball should collide the world at y=100, not at y=0. I've set the world bounds with game.world.setBounds(10, 100, ...). But there is no effect. The same with the x value. Only the change of the width and height parameter works. It's no problem, to handle the collision by myself, but it would be nice to handle it with phaser instead. Link to comment Share on other sites More sharing options...
Starcluster Posted February 4, 2016 Author Share Posted February 4, 2016 OK, the x and y coordinate seems to be the center of the world, not the top-left border. I think i have to handle the top-left collision by myself. Link to comment Share on other sites More sharing options...
Recommended Posts