alex_h Posted August 14, 2014 Share Posted August 14, 2014 P2.js operates with an upwards pointing y axis, whereas PIXI has its y axis the other way up. In the p2 examples the PIXI js one works around this by simply nesting everything in a DisplayObjectContainer and inverting its y scale property. I am curious to know whether this is the approach that Phaser takes too? I spent some time rummaging around in the Phaser source code but was not able to find the relevant portion. If anybody knows what Phaser does under the hood to address the conflicting y axis issue I'd be very interested to know. Link to comment Share on other sites More sharing options...
rich Posted August 14, 2014 Share Posted August 14, 2014 See Phaser.Physics.P2.InversePointProxy Link to comment Share on other sites More sharing options...
alex_h Posted August 14, 2014 Author Share Posted August 14, 2014 Oh cool thanks - how did I miss that?! Interesting to see that you are inverting the x axis too - perhaps that's what is missing from my own experiment! I've been trying out something similar in a non-Phaser environment to invert the y values on drawing the bodies but as soon as I start applying any rotation forces things started going a bit inside out and upside down. Glad to hear that the negative y scale shortcut is not being considered an approved solution [EDIT] yep, adding inversion to the x axis as well fixed the problems I was getting - thanks again Rich [/EDIT] Link to comment Share on other sites More sharing options...
Recommended Posts