Reputation: 1195
In my game numbers are game elements: they can be moved, touched, exploded and have their collision detected.
How can I turn text into sprites and/or physical bodies using Phaser.js?
Upvotes: 1
Views: 1176
Reputation: 3712
A workaround would be to draw text inside a Phaser.BitmapData
object and then make a sprite from it.
Haven't used it that way, though, and it doesn't seem to work with zeroed values (or I'm missing something).
Upvotes: 1
Reputation: 1018
you cant because sprite and text are different node however you can attach text to empty sprite and when you move sprite the text will move same as collision you will just need to do it manually
Upvotes: 1