Changing colour of specific words in a string

This forum is currently in read-only mode.
  • I was wondering can the text object change colours of particular line of text?

    This is what I mean.

    string is:

    "Enter" + NewLine + "Exit"

    Then it should be:

    <font color=blue>Enter

    Exit</font>

    If I were to use text object I could change the colour of all text to red. However, I do not know how to change the colour of 1 line or a section of the string to red (or any other colour)

    If I could change the colour of particular text it would look something like:

    <font color=red>Enter</font>

    <font color=green>Exit</font>

    Is there actually some kind of tags (like in html/css) that I could add into the string to modify the colours? Or is the text of the text object is just a long line of string?

  • It is one string, colored once.

    You could create several instances of a text object, one for every line of text and set the text and the color seperately. You could pick the right text line by using a pv set to the line number of that text line.

  • So in other words doing:

    <color=red>Enter</color>

    <color=green>Exit</color>

    will not work. I in fact have to create multiple text objects to create the effect that I want. Well this makes it a bit difficult.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Oh actually If there was an easy way to do it It would have helped me a lot on my project too. Beceause on my project I give player a text. Than I want player to write it fast. If he writes a letter wrong than change that letter's color to red if its true change color to green. It would be perfect.

  • So in other words doing:

    <color=red>Enter</color>

    <color=green>Exit</color>

    will not work. I in fact have to create multiple text objects to create the effect that I want. Well this makes it a bit difficult.

    There is an HTML object, if you feel like toying around with that.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)