ryryguy
10-25-2007, 04:18 AM
(This question is a little hard to explain, bear with me...)
Another question about the text element in a component. This time, the label of a LabelButton component.
So, when you set an image to be used as a skin style (like "upSkin") on a Button, the skin will be scaled to match the size of the Button. For example, say the skin image, as a symbol in the library, has a size of 50x50. If you use it as a skin on a 100x100 button, it gets blown up to 100x100.
You can embed a piece of text in that skin, and it too will scale to fit the Button component size.
On the other hand, if you use the built-in "label" property of a LabelButton, the text created by it does not scale to the component. If you set the textFormat to 11 point text, the 11 point text is what you'll see, no matter what size Button you put it on - 50x50, 200x200, whatever.
This actually makes some sense - you're specifying a specific font size, so why should it scale? But what I want is to achieve the effect you get by embedding text in the skin, so the text scales with the skin, but I also want dynamic control over the text, like you get with the label property. How can this be achieved?
That's basically the question... but I'll give more details about why I want this effect. My artist is using the same general shape of button, with the same font and other text properties, for a variety of different button instances. He has been making these as a single symbol per button with the text embedded in the button, and I'm using them as skins. For example, we have "OKButton_upSkin", "CancelButton_upSkin", "SaveButton_upSkin", etc, in a shared library.
This works great for reusing those buttons in different dialogs, where one might have a 100x20 "OK" button and another an 80x15 "OK" button. Everything scales fine from that single symbol.
However, we are starting to add other states to the buttons. So now we are faced with the prospect of "OKButton_overSkin", "CancelButton_overSkin", etc. As the number of buttons and styles increases it seems like it will quickly get out of hand.
So, I'd like to be able to make a single "GenericButton_upSkin", "GenericButton_overSkin", etc. and just set "OK", "Cancel" on some dynamic text in the button, without losing the nice scalability provided by the skins with the baked-in text. Any solution or different approach would be greatly appreciated!
Another question about the text element in a component. This time, the label of a LabelButton component.
So, when you set an image to be used as a skin style (like "upSkin") on a Button, the skin will be scaled to match the size of the Button. For example, say the skin image, as a symbol in the library, has a size of 50x50. If you use it as a skin on a 100x100 button, it gets blown up to 100x100.
You can embed a piece of text in that skin, and it too will scale to fit the Button component size.
On the other hand, if you use the built-in "label" property of a LabelButton, the text created by it does not scale to the component. If you set the textFormat to 11 point text, the 11 point text is what you'll see, no matter what size Button you put it on - 50x50, 200x200, whatever.
This actually makes some sense - you're specifying a specific font size, so why should it scale? But what I want is to achieve the effect you get by embedding text in the skin, so the text scales with the skin, but I also want dynamic control over the text, like you get with the label property. How can this be achieved?
That's basically the question... but I'll give more details about why I want this effect. My artist is using the same general shape of button, with the same font and other text properties, for a variety of different button instances. He has been making these as a single symbol per button with the text embedded in the button, and I'm using them as skins. For example, we have "OKButton_upSkin", "CancelButton_upSkin", "SaveButton_upSkin", etc, in a shared library.
This works great for reusing those buttons in different dialogs, where one might have a 100x20 "OK" button and another an 80x15 "OK" button. Everything scales fine from that single symbol.
However, we are starting to add other states to the buttons. So now we are faced with the prospect of "OKButton_overSkin", "CancelButton_overSkin", etc. As the number of buttons and styles increases it seems like it will quickly get out of hand.
So, I'd like to be able to make a single "GenericButton_upSkin", "GenericButton_overSkin", etc. and just set "OK", "Cancel" on some dynamic text in the button, without losing the nice scalability provided by the skins with the baked-in text. Any solution or different approach would be greatly appreciated!