Is it possible to have different UI's in one game?

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
harlequinngames
Newbie
Posts: 1
Joined: Sun Jun 26, 2022 11:51 am
Tumblr: https://www.tumblr.com/blog/awol
itch: https://harlequinnga
Contact:

Is it possible to have different UI's in one game?

#1 Post by harlequinngames »

Hello! I had an idea for a game where you hear 3 different stories and all of them have a completely different art style from the last, including the UI (or, bare minimum, textbox). I'm very inexperienced with coding, so I apologize if this is a stupid question. I haven't even begun the coding process, so I'm purely just asking if this is even possible with the Ren'Py engine.

What I mean by "different UI's" is that act I of the game could look like this:
act 1.png
While act 2 switches to something like this:
act 2.png
So, different texts and textboxes, menu that changes depending on which act you're in, etc. Is something like this possible? If so, how?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2401
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Is it possible to have different UI's in one game?

#2 Post by Ocelot »

Yes, you can use different style for textbox, menu screens and other UI elemants. You can do it in multiple wasy, and I cannot recommend one, because I do not know, how you will structure your game, and which approach will be best for you.
< < insert Rick Cook quote here > >

User avatar
m_from_space
Miko-Class Veteran
Posts: 974
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Is it possible to have different UI's in one game?

#3 Post by m_from_space »

Yes it is possible. The main thing you have to focus on building it is the "say screen", which you will find inside screens.rpy. This is the screen that determines how the dialogue is displayed to the user and the underlying art using styles and pictures and whatnot.

My suggestion then would be to make a variable that controls, how the say screen should present itself at the moment you display text. You can easily build logic inside the say screen depending on that variable then to alter the styles used for example. Or alter single elements of the say screen like a color of something.

Very basic example:

Code: Select all

default story_mode = "present"

screen say(who, what):
    if story_mode == "present":
        style_prefix "say_present"
    elif story_mode == "past":
        style_prefix "say_past"
    else:
        style_prefix "say_future"
    ...

style say_present_dialogue:
    font "fonts/present_font.ttf"
    
style say_past_dialogue:
    font "fonts/past_font.ttf"
...
You can find detailed information on general GUI customization here: https://www.renpy.org/doc/html/gui.html

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]