alexandernst Posted March 11, 2018 Share Posted March 11, 2018 Is there a way to create a text object with physics on it, the same way I'm able to create an image object, like this: Phaser.Physics.Arcade.Image.call(this, scene, 0, 0, "my_image"); If there isn't a direct way of creating such thing, what would be a good alternative of having a dynamically generated text that acts like a game object with physics? Link to comment Share on other sites More sharing options...
samme Posted March 11, 2018 Share Posted March 11, 2018 You can try this.physics.world.enable(text) or whatnot. Link to comment Share on other sites More sharing options...
alexandernst Posted March 11, 2018 Author Share Posted March 11, 2018 Okey, I got it working with `Phaser.GameObjects.Text` and `physics.world.enable` as you said. But now I have another problem. I'm trying to rotate the text and the physics body that is attached to it, but only the text itself is rotating. Demo: http://plnkr.co/edit/G7obzt6xtwKJtYcv5oay?p=preview Link to comment Share on other sites More sharing options...
alexandernst Posted March 11, 2018 Author Share Posted March 11, 2018 Answering to my own question: rotation physics bodies is not possible with arcade physics. For this to be possible I'd need to switch to matter.js physics. Link to comment Share on other sites More sharing options...
PixelPicoSean Posted March 12, 2018 Share Posted March 12, 2018 Arcade physics of Phaser 3 does support rotation of body (using SAT algorithm), but the debug graphics simply draws a rectangle which I think is not finished yet. Link to comment Share on other sites More sharing options...
PixelPicoSean Posted March 13, 2018 Share Posted March 13, 2018 Sorry I just read the source code of arcade physics, it does not use SAT for collision detection and does not support rotation either. Link to comment Share on other sites More sharing options...
rich Posted March 13, 2018 Share Posted March 13, 2018 Arcade Physics 2 uses SAT but isn't in v3 yet. We basically ran out of time but will revisit it one day! Link to comment Share on other sites More sharing options...
Recommended Posts