Page 1 of 1

EVE2 - Button Text color besides White

Posted: Thu Sep 19, 2019 4:57 pm
by jwizard93
Hi, I want my buttons to be white. I'm assuming that I could just use "/0" as the text and then draw some black text on top of them, but before I put forth that effort I wanted to ask:

Does anyone know if it is possible to change the text color of Buttons to black instead of the default white?

Re: EVE2 - Button Text color besides White

Posted: Fri Sep 20, 2019 3:23 pm
by Daniel Divino
Hi Jwizard,

You should be able to configure the color of your buttons using the CMD_FGCOLOR command. The color of your text can be set by using the COLOR_RGB display list/Co-processor command.

Here's an example using our EVE library:

Code: Select all

Send_CMD(CMD_DLSTART);
Send_CMD(CLEAR_COLOR_RGB(255,255,255));
Send_CMD(CLEAR(1,1,1));
Send_CMD(COLOR_RGB(0, 0, 0));// Change color of following text to black
Cmd_FGcolor(0xFFFFFF); / Change button face color to white
Send_CMD(TAG(1));// Tag the following button as a touch region with a return value of 1
Cmd_Button(100, 125, 120, 48, 28, 0, "Test");//Create a white button with black text
Send_CMD(DISPLAY());
Send_CMD(CMD_SWAP);  
UpdateFIFO();// Trigger the CoProcessor to start processing the FIFO
Give it a shot!

Cheers,
Daniel

Re: EVE2 - Button Text color besides White

Posted: Mon Sep 23, 2019 2:31 pm
by jwizard93
Thanks, Daniel.

This is exactly what I was missing!

I noticed that using font 22 produced bad results with this method, but font 23 looked good. I am assuming that this is due to properties of the fonts themselves. When 22 is white it looks like it has some black pixels to enhance definition, so turning it black creates some weird artifacts.

I have no need for further assistance, unless you have some insight about the color properties of fonts / know that I am wrong about font 22 and it should look fine.

Many thanks!

Re: EVE2 - Button Text color besides White

Posted: Tue Sep 24, 2019 12:28 am
by Henry
Can you tell us about your project more?