ZoomBox Posted August 26, 2014 Share Posted August 26, 2014 Hello ! When I change my bitmapText.text property the textWidth is not the good one.Actually I create all my bitmapTexts with an empty string and then I set the texts and then the positions. If I want to center my text, I can't because the textWidth is not correct at all (should be 300 and is around 30). Thank you in advance. Link to comment Share on other sites More sharing options...
lewster32 Posted August 26, 2014 Share Posted August 26, 2014 Do bitmapText.updateText() and it will calculate the correct textWidth there and then. This calculation is usually deferred until the next update, but if you need to change and then center the text, then this is the way to do it. bitmapText.text = "Some text.";bitmapText.updateText();console.log(bitmapText.textWidth); // will now be correct Link to comment Share on other sites More sharing options...
ZoomBox Posted August 26, 2014 Author Share Posted August 26, 2014 I was assuming it was somethink like this.Thank you for your answer. Link to comment Share on other sites More sharing options...
Recommended Posts