How make button with different skin?

Help and discussion regarding skinning, themes, and other artistic content.

Moderators: CEGUI MVP, CEGUI Team

iversion
Just popping in
Just popping in
Posts: 18
Joined: Sat Jun 24, 2006 05:03

How make button with different skin?

Postby iversion » Thu Aug 17, 2006 02:38

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?

Xirnohn
Not too shy to talk
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?

Postby Xirnohn » Thu Aug 17, 2006 09:21

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.

iversion
Just popping in
Just popping in
Posts: 18
Joined: Sat Jun 24, 2006 05:03

Postby iversion » Thu Aug 17, 2006 13:17

It works! Thank you very much! :)


Return to “Skins and Themes”

Who is online

Users browsing this forum: No registered users and 28 guests