mih
Member
|
How to make color picker, like the one in editors ?
Hi As in the title, I would like to make the color picker to popup when user click on the 'color rectangle'. I'm wondering how It was made in the tools provided with engine, any tips Grzegorz ?
|
|
06-14-2010 08:49 PM |
|
Esenthel
Administrator
|
RE: How to make color picker, like the one in editors ?
you can use ColorPicker class, it's available to use
|
|
06-14-2010 09:30 PM |
|
mih
Member
|
RE: How to make color picker, like the one in editors ?
Yes I know I think i didn't write it clearly xD I would like to make something like that:
user clicks on the rectangle filled with color, and then color picker window pops up, and after closing color picker, rectangle is filled with new color I was trying to make It with GuiImage control, but I don't know how to detect when user clicks on It
I was rather asking, about that filled rectangle What is the easiest way to achive somthing like that ?
(This post was last modified: 06-14-2010 10:40 PM by mih.)
|
|
06-14-2010 10:40 PM |
|
Esenthel
Administrator
|
RE: How to make color picker, like the one in editors ?
Code:
static void ColorDraw(GuiCustom &gc)
{
Property &prop=*(Property*)gc.user;
Rect rect=gc.rect+gc.gpc->offset;
if(prop._cp)rect.draw((*prop._cp)().v3);
rect.draw(Color(0,0,0,0x70),false);
}
static void ColorUpdate(GuiCustom &gc)
{
if(Gui.ms()==&gc && Ms.bp(0))
{
Property &prop=*(Property*)gc.user;
if(prop._cp)prop._cp->activate();
}
}
|
|
06-15-2010 10:32 AM |
|
mih
Member
|
RE: How to make color picker, like the one in editors ?
thanks, I'll try that
|
|
06-15-2010 11:09 AM |
|