Page 1 of 1

changing button colours.

Posted: Tue Nov 20, 2007 21:57
by Evak
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.

Posted: Wed Nov 21, 2007 08:22
by scriptkid
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 :)

Posted: Mon Nov 26, 2007 22:28
by Evak
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.

Posted: Fri Nov 30, 2007 06:08
by Evak
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.