agmcleod Posted March 7, 2014 Share Posted March 7, 2014 Hello. I'm looking at using a bitmaptext object for dialogue, and I'm wondering if there's a way to achieve automatic word wrapping. Since the wordWrap style options won't work on the bitmaptext, is there a way i can pass a string and calculate its width? It doesn't make sense to create individual bitmaptext objects for each word and check their width, as that sounds rather expensive. Any suggestions on how to achieve this? Link to comment Share on other sites More sharing options...
plicatibu Posted March 8, 2014 Share Posted March 8, 2014 Hi. If you do something like the following, doesn't it work?this.text.wordWrap = true;this.text.wordWrapWidth = (0.95 * this.game.world.width);Regards. Link to comment Share on other sites More sharing options...
agmcleod Posted March 10, 2014 Author Share Posted March 10, 2014 Nope, that only applies to Phaser.Text not the Phaser.BitmapText. I ended up just putting in \n characters into the strings as a work around, but having it work more automagically with code would be nice . Link to comment Share on other sites More sharing options...
Recommended Posts