[SOLVED] Not Understanding the Styles System

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Obscura
Eileen-Class Veteran
Posts: 1431
Joined: Fri Mar 09, 2012 6:58 pm
Projects: Coming Out On Top
Location: United States
Contact:

[SOLVED] Not Understanding the Styles System

#1 Post by Obscura »

I'm trying to learn the more current way styles are implemented in Renpy, and I'm not sure I understand. The documentation gives these examples:

Code: Select all

style my_text is text:
    size 40
    font "gentium.ttf"
    
style big_red:
    size 40
    
Why does the first have "is text" after it? Why doesn't the second?
How do you know when to add "is" followed by an object (in this case "text"), and how do you know which objects to put there?

The answer is likely obvious, but I'm struggling to glean it from the documentation. :|
Last edited by Obscura on Thu Feb 07, 2019 1:28 am, edited 1 time in total.
Coming Out On Top - An Adult Gay Dating Sim
website

philat
Eileen-Class Veteran
Posts: 1912
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Not Understanding the Styles System

#2 Post by philat »

The first example my_text inherits from the style text, and overrides only specific attributes (size/font). big_red inherits from default, that's all.

User avatar
Obscura
Eileen-Class Veteran
Posts: 1431
Joined: Fri Mar 09, 2012 6:58 pm
Projects: Coming Out On Top
Location: United States
Contact:

Re: Not Understanding the Styles System

#3 Post by Obscura »

Well, that explains it! Thanks so much for clearing up the confusion, philat!!!
Coming Out On Top - An Adult Gay Dating Sim
website

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot], Ocelot