开发者

as3: how to create a single line text of size close to a given height?

开发者 https://www.devze.com 2023-03-14 14:08 出处:网络
i am given a rectangle of some height and widt开发者_JAVA技巧h, i want to fill this rectangle with some dummy single line text. the height and width of text should be close to that of given rectangle.

i am given a rectangle of some height and widt开发者_JAVA技巧h, i want to fill this rectangle with some dummy single line text. the height and width of text should be close to that of given rectangle. basically, i want the text to full occupy a given rectangular area.

eg: if rectangle height and width is 100 and 300 respectively, then the single line text height and width should be close to 100 and 300 respectively,

could someone please share some ideas on how to accomplish this ?

thanks,


Here is a code example of changing the text format size until you reach the desired width and height.

http://icodesnip.com/snippet/actionscript-3/scale-text-to-fit-in-textfield-scale-textfield-to-fit-text

0

精彩评论

暂无评论...
验证码 换一张
取 消