Text with color

Apamaster

  • Posts: 78
How can you make a text some words have color.
I have tried detecting symbol and that the font is of another color but when finished writing the text in color it returns to the original font.
I have noticed that the text when it was due does not remain on the screen it can continue to be modified, is there any way that the text is frozen once it is written?

Luyren

  • *
  • Posts: 2291
The drawing blocks must constantly execute in order for the drawing to stay on screen. Changing the color of words involves changing to another font of the desired color. The simplest way is to use multiple drawing blocks to achieve that.
Posting of screenshot of your code might get you more suggestions on what to do.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

Apamaster

  • Posts: 78
The texts and variables are in Spanish, but the code is understood. It is a typed text as the text is presented on the screen, the code is directly above the actor's event. this is the original with no attempt to change color because no matter what you do it always returns to the main source all.

Apamaster

  • Posts: 78
the problem is that when it refreshes the image it erases all the previous thing and changes the font I don't know why it updates all the texts to the new color format.


Apamaster

  • Posts: 78

I think I can achieve a way to do it but it requires only one word to be colored per row since the problem is that it updates. Another possible solution is that each letter is an actor that appears in the painting but it would be more complex but it would give the same result and even with better effects.

Luyren

  • *
  • Posts: 2291
You can't change the font in the middle of a single draw block. As I said, you'll have to use multiple drawing blocks and multiple "set font" blocks to achieve that using drawing.

My cutscene resource pack achieves change of font mid text using images. You can check it out here if you are interested: https://luyren.itch.io/luyrens-cutscene-resource-pack
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

Apamaster

  • Posts: 78
Here I managed to make it print in three colors white red and green (create the font Sans Serif size 16 style Blod Smoothing yes and add a color) then set the fonts in the draw white red green or color of choice and press Z to advance On-screen typing, the behavior must be added to some actor created on-screen.
They can contribute by further improving the code to make it simpler, I still have a long way to go to print three lines of text.