R
R
Recardo_Recoly2017-02-13 15:01:40
C++ / C#
Recardo_Recoly, 2017-02-13 15:01:40

DirectX 9 | How to render text in different colors?

Here is the text rendering code:

D3DCOLOR fontColor = D3DCOLOR_ARGB(255, 255, 0, 0);

    RECT rct; //Font
    rct.left = 20;
    rct.right = 1680;
    rct.top = 20;
    rct.bottom = rct.top + 200;
    char text[255];
    sprintf(text, "Text:\n IsOpen: %i ||| Banned: %s", open, GetBan());
    m_font->DrawTextA(NULL, text, -1, &rct, 0, fontColor);

Example:
How to make the word "Text" the text was white (well, it's already white)
And the word IsOpen is green or something else?
Well, that is, you can render here in different colors?
help me please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tsarevfs, 2017-02-13
@Recardo_Recoly

Draw the first part, then the second with an offset.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question