jmp909 Posted October 29, 2015 Share Posted October 29, 2015 when I exit from full screen my player (with its own collision group) stops rebounding against the world edges i've tried various combinations of these with no luckthis.game.scale.stopFullScreen();this.game.world.setBounds(0,0,480,32*11*10) // or ...// this.layer1.resizeWorld()this.game.physics.p2.updateBoundsCollisionGroup();this.game.physics.p2.setBoundsToWorld(true, true, true, true,true)thanks for any advice was also mentioned here by somebody else http://www.html5gamedevs.com/topic/15385-issue-with-p2-stopfullscreen-collisionmask-world-bounds/ Link to comment Share on other sites More sharing options...
ekeimaja Posted October 29, 2015 Share Posted October 29, 2015 I think setBounds and setBoundsToWorld overrides each other. SetBounds are for defining bounds manually, and setBoundsToWorld looks bounds automatically from game dialog size. Fix me if I am wrong. Link to comment Share on other sites More sharing options...
jmp909 Posted October 29, 2015 Author Share Posted October 29, 2015 they don't work on their own though either Link to comment Share on other sites More sharing options...
ekeimaja Posted October 29, 2015 Share Posted October 29, 2015 Can you show your game when running, so we can understand the problem better? Link to comment Share on other sites More sharing options...
jmp909 Posted October 30, 2015 Author Share Posted October 30, 2015 I can't create a full screen jsfiddle or sandbox as they are not https however also note this is enough to break p2 bounds (ignoring full screen for now) this.game.world.resize(480,320) // breaks p2 bounds.. does not collide player with world bounds anymorethis.game.physics.p2.setBoundsToWorld(true, true, true, true, false) // does not fix it try this pleasehttp://phaser.io/sandbox/bSHTBFtx/play hit the 'R' key to resize the world.. i resize it to 800,600 for now which is the same size but the effect is the same. the hamster ship no longer collides with the world bounds Link to comment Share on other sites More sharing options...
ekeimaja Posted October 30, 2015 Share Posted October 30, 2015 I meant to take screenshot from your game. Link to comment Share on other sites More sharing options...
jmp909 Posted October 30, 2015 Author Share Posted October 30, 2015 screenshot.. the sandbox example above is more useful though Link to comment Share on other sites More sharing options...
jmp909 Posted October 30, 2015 Author Share Posted October 30, 2015 it appears all collision groups need to be recreated after resizing game world.. you can see here (instructions in code)http://phaser.io/sandbox/SXKpakhM/play Link to comment Share on other sites More sharing options...
Frank Posted January 8, 2016 Share Posted January 8, 2016 it appears all collision groups need to be recreated after resizing game world.. you can see here (instructions in code)http://phaser.io/sandbox/SXKpakhM/play That didn't work as simple for me with the fullscreen in chrome (didn't tested with others navigators) I solved it by adding a listener on webkitfullscreenchange and then reset collisions in it.It was kinda strange because resizing the game world and then reset collisions worked perfectly for me. By the way, thank you for this link, you saved my day ! Link to comment Share on other sites More sharing options...
Recommended Posts