Neoforce ControlsNeoforce ControlsDiscussionsDiscussionsSkinningSkinningChange fontChange font
Previous Previous
 
Next Next
New Post
 3/2/2010 10:20 AM
 


How can I change the font used in all the controls?
I have seen this line
labelFont = manager.Skin.Fonts["Default"].Resource;
If I have a skin with the font "somefont". Can I do mycontrolfont = manager.Skin.Fonts["somefont"].Resource; and the font changes?
New Post
 3/2/2010 11:10 AM
 
 Modified By Ryann  on 3/2/2010 12:11:24 PM
If you want to change font for all controls at once, it is best to alter the skin and recompile. Changing font for certain control is done this way:

Label.Skin.Layers["Control"].Text.Font.Resource = Manager.Skin.Fonts["myfont"].Resource;

for all labels:

Manager.Skins.Controls["Label"].Layers["Control"].Text.Font.Resource = Manager.Skin.Fonts["myfont"].Resource;


Tom Shane
New Post
 3/3/2010 8:15 AM
 
Thank you by the quick answer Tom.
Previous Previous
 
Next Next
Neoforce ControlsNeoforce ControlsDiscussionsDiscussionsSkinningSkinningChange fontChange font