Ren'Py write the text always in italic

Macmilan

Newbie
Dec 30, 2018
18
9
Hello,
to spare me some time, I had the idea to define my character when she is thinking.

define mf = Character("Megan thinking", color="#c193c9")


So far no problem, but I would like the text to be always in italic. This is where I get stuck.

Can anyone help me?
 

Bev_

Member
Nov 17, 2018
477
775


Code:
define mf = Character("Megan thinking", color="#c193c9",  what_prefix="{i}")
 
  • Like
Reactions: mickydoo

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,256
To expand on this solution...
The most common use of what_prefix (and what_suffix) is when characters are thinking.

You create two Character()s for the same in-game character. One Character() is used for normal dialogue and one is used as that same character "thinking".

For example...

Python:
default mc_name = "Unnamed"

define mc = Character("[mc_name]", color="#c193c9")
define mc_t = Character("[mc_name]", color="#c193c9", what_prefix="{i}", what_suffix="{/i}")

define e = Character("Eileen")
define e_t = Character("Eileen", what_prefix="{i}", what_suffix="{/i}")

# ... etc.

Where you'd used e for Eileen's normal dialogue and e_t for her internal monologue.

Of course, I prefer to go further.
I like to not only use italics for thoughts... but also wrap the text in parenthesises. (I'm thinking) instead of I'm thinking. On my particularly adventurous days, I also like to show the text in a very pale gray rather than pure white.
I also like to like to show double quotes around normal dialogue.
Finally, I like to show text not attributable to a character (i.e. game narration) in a pale yellow color. You can do this by using the predefined character narrator.

You build all that in, things get slightly more complicated - but you only need to worry about the extra complications once (when you first create all the characters)... after that, it's all taken care of for you.
The big advantage (in my opinion) is that it gives much better feedback to the player about what they are reading - as each type of text is visually different from other text types.

Python:
default mc_name = "Unnamed"

define narrator = Character('', what_color='#FFFF66')

define mc = Character("[mc_name]", color="#c193c9", what_prefix='"', what_suffix='"')
define mc_t = Character("[mc_name]", color="#c193c9", what_prefix="{i}(", what_suffix="){/i}", what_color="#999999")

define e = Character("Eileen", what_prefix='"', what_suffix='"'))
define e_t = Character("Eileen", what_prefix="{i}(", what_suffix="){/i}", what_color="#999999")

# ... etc.