How make button with different skin?
Moderators: CEGUI MVP, CEGUI Team
How make button with different skin?
I want to have two different kinds of buttons. For example, one use white color skin, the other use red color skin. I had two button skin in my tga file. But how can I assign the different skin to the buttons? Can I make it just by modifying the xml files, such as .looknfeel file?
-
- Not too shy to talk
- Posts: 23
- Joined: Thu Jun 22, 2006 13:32
- Location: Hungary, Debrecen
- Contact:
Re: How make button with different skin?
iversion wrote:I want to have two different kinds of buttons. For example, one use white color skin, the other use red color skin. I had two button skin in my tga file. But how can I assign the different skin to the buttons? Can I make it just by modifying the xml files, such as .looknfeel file?
Put it to a looknfeel like:
Code: Select all
<WidgetLook name="TaharezLook/ButtonWithWhiteSkin">
.
.
.
</WidgetLook>
<WidgetLook name="TaharezLook/ButtonWithRedSkin">
.
.
.
</WidgetLook>
Then in the shame file:
Code: Select all
<FalagardMapping WindowType="TaharezLook/ButtonWhite" TargetType="CEGUI/PushButton" Renderer="Falagard/Button" LookNFeel="TaharezLook/ButtonWithWhiteSkin" />
and
Code: Select all
<FalagardMapping WindowType="TaharezLook/ButtonRed" TargetType="CEGUI/PushButton" Renderer="Falagard/Button" LookNFeel="TaharezLook/ButtonWithRedSkin" />
You now have two button type:
Code: Select all
Button *redButton = WindowManager::getSingleton().createWindow("TaharezLook/ButtonRed", "redButton");
Button *whiteButton = WindowManager::getSingleton().createWindow("TaharezLook/ButtonWhite", "whiteButton");
I hope im right, and helps you.
Xir.
Who is online
Users browsing this forum: No registered users and 28 guests