CREATE YOUR AI CUM SLUT ON CANDY.AI TRY FOR FREE
x

Ren'Py Question about the style in Re'npy

p13mp3234

New Member
May 15, 2024
2
0
Hi guys, im developing my own game, my question as you can see on the prefix, is about the "Style" in renpy, how can i use the style on the dialogue for one specifically person, for each dialogue of him??

Thx for the help <3
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,611
2,259
This is RenPy, so there's probably multiple ways to achieve things.

It's unclear to me exactly what part of the style you want to change.
But let's say you always want that character to speak in italics and using Red text.

By far the easiest way is to add these options to the definition.

define testchar = Character("Test Character", what_italic=True, what_color="#FF0000")

There are lots of other options open to you this way. Essentially prefixing things with what_, who_ or others, then using various properties to change things.


If you're changing something "odd" (I dunno... backgrounds - likely possible with Character() anyway), you could recode the screen say().

A bad example, but...

Python:
screen say(who, what):
    style_prefix "say"

    window:
        id "window"

        if who is not None:

            window:
                id "namebox"
                style "namebox"
                text who id "who"

        if who != "test2":  # where "test2" is the text name of the character, not its variable name.
            text what id "what"
        else:
            text what id "what" italic True color "#00FF00"

There might be more you could do with actual style changes, but honestly the Character() definition is almost certainly the right solution, and this is just me coming up with alternatives that would be a pain to implement...

Python:
        if who != "test2":
            text what id "what"
        else:
            text what id "what" style "altstyle"