|
-
onRoll >> bubble info ...
Hi!
I've got a set of 15 cubes representing each one a different color.
Each cube is a button so, when i rollOn one of these, i want to show a bubble message (link with the mouse position) that tell the name of the color (it's only a background with a text beside).
But the problem is that i want the background adjust with the text.
EX. If the word is ORANGE, i want the background width set with that word so the background width will be different for ORANGE that BLUE.
if the field width containing the word ORANGE is 100px, the background will be 100px .... for the field with the word BLUE (width = 50px) the back will be 60px .... understand ????
How i can do that !!
Steve
-
You need to dynamically create a new textField, using createTextField(). I made an example ages ago ... you can pick it apart to see if it makes things any clearer.
----------
"Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT
-
Senior Member
The key property is Textfield.autosize.
When you dynamically create your text field, make sure this property is set to true.
this.createTextField(label, level, x position, y position, width, height);
this.label.autosize = true;
And once you set autosize to true, the width and height of the textfield are overwritten.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|