I’m using the Text object to display rich text but sometimes it looks like my text is being wrapped even though there is plenty of space left on the line. It looks like if I had written a "\n " at the end of my text string, creating a new empty line.
This happens only when wordWrap is set to true (and I do need word wrapping), and then only when the text width is at a certain, but seemingly random, value. My workaround for a while has been to detect unnecessary wrapping and in those cases add an extra whitespace to the end of my string. However, only one space character doesn’t always work and I now need a more proper fix.
For reference, this is how I create my Text object:
textLabel = new Text(text, 10, 0, { font:"FontOne", size:fontsize, align:"center", wordWrap:false, resizable:false, width:width - 20, height:height, color:fontColorN, alpha:alpha } );
textLabel.setStyle("fff", { color:0xffffff } );
textLabel.richText = textLabel.text;
textLabel.y = (height - textLabel.textHeight)/2; //Vertical center alignment
Any ideas?