Working with text.

boynedmaster

Warper
Member
Joined
Nov 6, 2013
Messages
2
Reaction score
0
First Language
English
Primarily Uses
I'm programming something that changes the entire line of text's color if a certain symbol is the first character (of that line).

How do I detect when text is called?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Depends on what text you mean. Is it something displayed in the menu? The message boxes? Something else?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Window_Base already does something similar, when you're using \c[n] to change colours. But you can change it anywhere in a line, and change it back again anywhere in a line.


You could take a look at process_escape_character in Window_Base to see how it handles colour change and reset based on that.


Window_Base.process_character has logic that detects the start of a new line.


So you could maybe add something to the process_new_line method to turn on a 'new line' flag, then at the end of the process_character method, if the character is NOT a new line character, turn that flag back off again (and reset the text colour if necessary). And detecting your symbol as the first character would depend on how you're going to implement it. If it's just a regular character without the \, you could add something to process_normal_character to say if it's the special character and newline is on, don't print, but change the colour instead; if you're using the \, you'd add it to the process_escape_character method.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,083
Members
137,583
Latest member
write2dgray
Top