In order to get the width of a text field you have created, you are supposed to use:
txt.getMeasuredWidth();
I was trying to add line breaks, EaselJS doesn't support html tags, so I used the \n line break, which works.
Problem? Now getting the measured width doesn't work (although height is fine). In fact, the more line breaks you add, the wider it thinks the text box is!
For myself, I am going to print out my longest line, and measure it's width, then replace it with the full text.
No comments:
Post a Comment
Please enter your message here...