Hi fellows, how are you? I’m dealing with this question in my head. I need 8 differents styles for labels. The difference between them is color and alignment. Instead of create 8 different custom styles in my custom skin, can I instantiate a style and change to the instance the color or alignment? I’ve tried this days ago but can’t get to work, I thought that a style can’t be instantiated and if I modify one attribute of the style it gets modified globally, I mean for all the objects which uses this style. Now, meaby I’m wrong, can u clarify if this can be done and how to achieve this behaviour? Thanks for your patience.
If I understand you correctly, what you’re probably looking for is something like this:
GUIStyle myCoolStyle = new GUIStyle( baseStyle );
GUIStyle myOtherStyle = new GUIStyle( baseStyle );
myCoolStyle.lineHeight = 20;
myOtherStyle.lineHeight = 15;
// etc
I hope this helps.
Well if works that way is very simple. Thank you!! I’ll try it!!