BRT Community

General Category => Discussion - EVE => Topic started by: Qrenz on June 10, 2020, 07:18:29 AM

Title: How to draw a colorful text with CMD_TEXT
Post by: Qrenz on June 10, 2020, 07:18:29 AM
Hi, when I use CMD_TEXT it always give me black text.
How to be able to output text with different color using CMD_TEXT?

I tried BEGIN(BITMAPS) then COLOR_RGB, before I call CMD_TEXT, but it doesn't affect the resulting text, it still with black color.
(Btw, the CMD_TEXT that I called is using a custom font)
Title: Re: How to draw a colorful text with CMD_TEXT
Post by: Rudolph on June 10, 2020, 10:35:33 AM
Apart from that you do not need BEGIN(BITMAPS) for a CMD_TEXT, using COLOR_RGB before CMD_TEXT is exactly the way to do it.

And I just tried it, using BEGIN(BITMAPS) does not break it.

Code: [Select]
//EVE_cmd_dl(DL_BEGIN | EVE_BITMAPS);
EVE_cmd_dl(DL_COLOR_RGB | BLACK);
EVE_cmd_text(100,200,28,0,"Black");
EVE_cmd_dl(DL_COLOR_RGB | RED);
EVE_cmd_text(100,220,28,0,"Red");
EVE_cmd_dl(DL_COLOR_RGB | GREEN);
EVE_cmd_text(100,240,28,0,"Green");
//EVE_cmd_dl(DL_END);

With or without the BEGIN/END pair I get the same result, three lines of text in black, red and green.

Yes, this also works with custom UTF-8 fonts from FLASH, I just tried that as well.
Title: Re: How to draw a colorful text with CMD_TEXT
Post by: BRT Community on June 10, 2020, 11:11:40 AM
Hello Qrenz,

Rudolph is above is correct.
But if you are still having issues, please provide your the display list you are using.

Best Regards,
BRT Community
Title: Re: How to draw a colorful text with CMD_TEXT
Post by: Qrenz on June 11, 2020, 07:18:13 AM
Yes, it turn out to be small bug i missed in my program.
Now it work already, thank you.