changing button colours.

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

User avatar
Evak
Not too shy to talk
Not too shy to talk
Posts: 32
Joined: Mon Apr 17, 2006 05:29
Contact:

changing button colours.

Postby Evak » Tue Nov 20, 2007 21:57

Hi were trying to make a color picker for our scene editor, and idealy would like to have a button who's colour can be changed by sliders.

Image


We have tried:

setProperty("FrameColours", "tl:FFFF0000 tr:FFFF0000 bl:FFFF0000 br:FFFF0000");

Only static images, static text and a few other things have them. Is there a way to do something similar with buttons?

The idea being that we click on a current coloured button and the color frame pops up, we pick a color with the slider and see the color update in one of the rectangular widgets. When you click the set color button, the original button on the UI changes color and the colour dialogue/frame closes.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Wed Nov 21, 2007 08:22

Hello,

have a look at these two pages:
http://www.cegui.org.uk/wiki/index.php/ ... PushButton
http://www.cegui.org.uk/wiki/index.php/ ... %29#Button

If your skin is based on a default one, then these properties should be available to your buttons as well. If not, look at the .looknfeel definition of your buttons to see which properties you have defined.

Good luck :)
Check out my released snake game using Cegui!

User avatar
Evak
Not too shy to talk
Not too shy to talk
Posts: 32
Joined: Mon Apr 17, 2006 05:29
Contact:

Postby Evak » Mon Nov 26, 2007 22:28

Hmm, I looked at this, being an artist makes any coding tricky. Most of the widgets don't seem to allow you to change the global color values. Maybe iconbutton #IconColours will let me use the set property to change the button color

Maybe I can get one of our coders to look through it and cook something up for me.

User avatar
Evak
Not too shy to talk
Not too shy to talk
Posts: 32
Joined: Mon Apr 17, 2006 05:29
Contact:

Postby Evak » Fri Nov 30, 2007 06:08

Easiest way turned out to be setting the BG color of a static widget, and making an on pressed load color dialogue function :). Worked a treat.


Return to “Help”

Who is online

Users browsing this forum: Bing [Bot] and 9 guests