BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Author Topic: How to draw a colorful text with CMD_TEXT  (Read 9342 times)

Qrenz

  • Newbie
  • *
  • Posts: 15
    • View Profile
How to draw a colorful text with CMD_TEXT
« 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)
« Last Edit: June 10, 2020, 07:22:14 AM by Qrenz »
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 391
    • View Profile
Re: How to draw a colorful text with CMD_TEXT
« Reply #1 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.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 743
    • View Profile
Re: How to draw a colorful text with CMD_TEXT
« Reply #2 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
Logged

Qrenz

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: How to draw a colorful text with CMD_TEXT
« Reply #3 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.
Logged