BrewBot
Junior Member
busy
Posts: 21
|
Post by BrewBot on May 22, 2015 13:05:30 GMT -8
The cmd_button command makes it easy to draw a button on the screen with Text inside of it. The default button is blue.
I need the button to be green or red, how would I go about changing this?
Is there a file buried in the GD2 library (cmd_button function) that calls out a color somewhere I can modify?
thx Jason
|
|
|
Post by jamesbowman on May 22, 2015 14:35:32 GMT -8
From the GD2 book on p.111 are GD.cmd_bgcolor() and GD.cmd_fgcolor(). These two colors are used for the foreground and background of widgets. To make the button red, set the foreground color: GD.cmd_fgcolor(0x800000); // dark red GD.cmd_button(... The button's text label is drawn in whatever the current color is, so to draw a red button with a yellow text label: GD.cmd_fgcolor(0x800000); // dark red GD.ColorRGB(0xffff00); // bright yellow GD.cmd_button(...
|
|
BrewBot
Junior Member
busy
Posts: 21
|
Post by BrewBot on May 22, 2015 18:38:38 GMT -8
Thanks, exactly what I was looking for.
|
|