EVE2 - Button Text color besides White

FTDI/Bridgetek EVE2 & EVE3 & EVE4 SPI TFT Series by Matrix Orbital

Moderator: Mods

Post Reply
jwizard93
LCD?
Posts: 2
Joined: Thu Sep 19, 2019 4:51 pm

EVE2 - Button Text color besides White

Post 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?

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 247
Joined: Thu Sep 24, 2015 9:38 am

Re: EVE2 - Button Text color besides White

Post 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
Daniel Divino
Technical Support
Matrix Orbital

jwizard93
LCD?
Posts: 2
Joined: Thu Sep 19, 2019 4:51 pm

Re: EVE2 - Button Text color besides White

Post 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!

Henry
OMNIPRESENT
OMNIPRESENT
Posts: 3002
Joined: Tue Aug 14, 2001 6:00 pm
Contact:

Re: EVE2 - Button Text color besides White

Post by Henry »

Can you tell us about your project more?
Henry J.
President
Matrix Orbital

Post Reply