Rikifive
Member
Hello there,
Currently I'm trying to draw a text, where characters would be printed one by one and where some words would be drawn in a different color, to highlight them.
However, I'm not sure how to approach that. I tried to think of something, but that all quickly became confusing.
What exactly I'm trying to do
-----------------------------------------
Because I'm planning to release the game in multiple languages, I store all the text in external .txt files, so the strings are loaded from there.
Now basically what I'm trying to achieve is this:
I was thinking of a format like this perhaps?
- where { /c0 } would set the draw color to colour with ID 0 specified somewhere earlier; { /c4 } would be colour with ID4 - orange, for example.
Another thing worth keeping in mind is line breaking. Being able to specify text box dimensions when calling a script would be perfect, but manual line breaking with a similar tag would be okay.
How should I approach this?
Hmm... I'll try something with 'for' method and string scanning and see what can be done.
If you have ideas, I'd appreciate help; Thanks.
--------
EDIT READ BEFORE REPLYING TO AVOID WASTING YOUR TIME
Somebody pointed out, that something I had in mind is doable; so after getting few tips, I gave it a legit try and after some time I managed to achieve what I wanted.
At the moment it's pretty much basic (manual), but I'll improve (automate) it later.
INPUT
OUTPUT
Consider that as solved; thanks to ones, who gave tips. c:
Currently I'm trying to draw a text, where characters would be printed one by one and where some words would be drawn in a different color, to highlight them.
However, I'm not sure how to approach that. I tried to think of something, but that all quickly became confusing.
What exactly I'm trying to do
-----------------------------------------
Because I'm planning to release the game in multiple languages, I store all the text in external .txt files, so the strings are loaded from there.
Now basically what I'm trying to achieve is this:
I was thinking of a format like this perhaps?
Code:
text = "/c0Press /c4[Z] /c0key to jump."
Another thing worth keeping in mind is line breaking. Being able to specify text box dimensions when calling a script would be perfect, but manual line breaking with a similar tag would be okay.
How should I approach this?
Hmm... I'll try something with 'for' method and string scanning and see what can be done.
If you have ideas, I'd appreciate help; Thanks.
--------
EDIT READ BEFORE REPLYING TO AVOID WASTING YOUR TIME
Somebody pointed out, that something I had in mind is doable; so after getting few tips, I gave it a legit try and after some time I managed to achieve what I wanted.
At the moment it's pretty much basic (manual), but I'll improve (automate) it later.
INPUT
Code:
"That's a string with \C1RED\C0, \C2GREEN \C0and\B\C3BLUE \C0words."
Consider that as solved; thanks to ones, who gave tips. c:
Last edited: