Hi. I am trying to get a rectangle to surround my SimpleText by making the rectangles height and width the same as the text height and width. It does a pretty good job if the first letter is "W" or a similar wide letter, but if the first letter is "h" or "I" etc., the border of the rectangle has a gap between the left edge of the text and the side of the rectangle. This is very pronounced when thte font gets bigger. I am guessing each character takes up a the same area of space which is why there is a gap between the edge of the letter and the rectangle. Is there a way to find exactly where the left edge of the text is? Have a look at the attachement to see what I am on about.
A method of UITextField , getCharBoundaries(index:int) will help you to get surrounding rectangle.
Further you can play with the rectangle!
The problem with that is that I am using SimpleText not a UITextField.
I can't just play with the rectangle because the user can change the text and the rectangle has to be flush with the edge of whatever the leftmost character is.