Constant User Interface?
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.
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.
Constant User Interface?
Hi,
Is it possible to have displayable user-interface on all screens without a whole bunch of if/elif within each screen?
Like, is there a way to call the single section of code for the user-interface from something like a label?
Just trying to make the code look clean without huge lines of code for all 30+ screen sections.
Thanks.
Is it possible to have displayable user-interface on all screens without a whole bunch of if/elif within each screen?
Like, is there a way to call the single section of code for the user-interface from something like a label?
Just trying to make the code look clean without huge lines of code for all 30+ screen sections.
Thanks.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Constant User Interface?
I have no idea what you are asking. Do you have a visual representation of what you mean?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Re: Constant User Interface?
I don't right now. Basically a group of pictures that show up on screens that are mainly used for information.
Example:
Say I have 7 different pictures that show what day of the week it is. In game, it's currently Monday so I have a variable that knows it's monday. I need that specific picture displayed on my screens.
I would like to NOT have the code that checks the variable and displays the picture on every single screen section, but rather have a specific section within the code with that data and the screen runs that code by simply calling it. Hope that makes more sense.
Essentially making the variable and trigger in every single screen but essentially in one spot, and when the player enters a screen, it calls that code to run and work.
- wyverngem
- Miko-Class Veteran
- Posts: 615
- Joined: Mon Oct 03, 2011 7:27 pm
- Completed: Simple as Snow, Lady Luck's Due,
- Projects: Aether Skies, Of the Waterfall
- Tumblr: casting-dreams
- itch: castingdreams
- Location: USA
- Contact:
Re: Constant User Interface?
So you want to show an image based on a variable? Something like this for a calander?
This uses the %s as a placeholder for the value of month and day. You would then have an image of the two in your images folder that represent each month and day. So if it's February 1 than your images would be month2.png for February and day1 for the 1st.
Code: Select all
default month = 1
default day = 1
screen overlay:
frame:
hbox:
add "month%s.png"%(month)
add "day%s.png"%(day)
Re: Constant User Interface?
That looks like what I'm exactly looking for! Thank you very much. I'll try this out now and reply whether I got it working or not. Thank you
Re: Constant User Interface?
Update: It works! I just had to alter it a little bit. Essentially wanted the time data to be shown on an interactive screen so a simple ...
add "day%s.png"%(day)
is all I need rather than the screen/frame/hbox stuff.
Again, thank you much. Being so new to renpy, I'm happy to get this working so well.
add "day%s.png"%(day)
is all I need rather than the screen/frame/hbox stuff.
Again, thank you much. Being so new to renpy, I'm happy to get this working so well.
- wyverngem
- Miko-Class Veteran
- Posts: 615
- Joined: Mon Oct 03, 2011 7:27 pm
- Completed: Simple as Snow, Lady Luck's Due,
- Projects: Aether Skies, Of the Waterfall
- Tumblr: casting-dreams
- itch: castingdreams
- Location: USA
- Contact:
Re: Constant User Interface?
No problem with %s you can use more then one by seperating them with a comma. They can even be used for the folder name where the image is found. So essentially this
Example eileen1.png
It's look for the folder "eileen" and the image 1.png
Code: Select all
add "%s%s.png"%(character, photo)
Code: Select all
add "images/%s/%s.png"%(character, photo)
Who is online
Users browsing this forum: Majestic-12 [Bot], piinkpuddiin, Semrush [Bot], snotwurm