Add a displayable to an existing screen
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.
-
- Newbie
- Posts: 7
- Joined: Thu Jun 18, 2020 8:15 pm
- Contact:
Add a displayable to an existing screen
I have a status bar screen at the top of my game. How do I add new interface elements (e.g. an imagebutton) to that screen during the game?
Re: Add a displayable to an existing screen
That denends of what you want to show.
The easiest (but maybe not the most efficient) way is to put all the elements in your screen and make some variables to operate what to show and what not.
But if you have a list of elements to show (like some player stats), you can show the content of this list, so it will change while you add or remove elements in this list.
The easiest (but maybe not the most efficient) way is to put all the elements in your screen and make some variables to operate what to show and what not.
But if you have a list of elements to show (like some player stats), you can show the content of this list, so it will change while you add or remove elements in this list.
-
- Newbie
- Posts: 7
- Joined: Thu Jun 18, 2020 8:15 pm
- Contact:
Re: Add a displayable to an existing screen
That sounds ok Alex, I can do that thank you.
Basically, the screen in question is at the top of my display and I want to add little 'tabs' to represent status ailments during play - these can subsequently be clicked on to interact with them.
It would be lovely if I could use regular Renpy commands to show these tabs with little transitions, animations etc. I suppose I could dynamically make each tab a little independent 'screen' of its own, showing a single imagebutton, or is that a crazy idea?
Basically, the screen in question is at the top of my display and I want to add little 'tabs' to represent status ailments during play - these can subsequently be clicked on to interact with them.
It would be lovely if I could use regular Renpy commands to show these tabs with little transitions, animations etc. I suppose I could dynamically make each tab a little independent 'screen' of its own, showing a single imagebutton, or is that a crazy idea?
Re: Add a displayable to an existing screen
You can make several screens (if all your elements have their own places on screen). Also check the 'showif' statement - https://www.renpy.org/doc/html/screens. ... -statementdrmindflip wrote: ↑Tue Jun 23, 2020 12:51 pm ... It would be lovely if I could use regular Renpy commands to show these tabs with little transitions, animations etc. I suppose I could dynamically make each tab a little independent 'screen' of its own, showing a single imagebutton, or is that a crazy idea?
-
- Newbie
- Posts: 7
- Joined: Thu Jun 18, 2020 8:15 pm
- Contact:
Re: Add a displayable to an existing screen
Thanks a lot for your help! I'm using showif to add an new icon to the display everytime a new 'visitor' is added to the game (it's, broadly-speaking, a hospitality game)
The above code adds a personalised icon for each visitor, and can be clicked on to remove the visitor. So far so good!
I have one more question that has been driving me crazy...how can I apply a transform to these imagebuttons when they are first generated only. I want to use easeintop, or equivalent, to have them slide down from the top of the screen. What's the best way to approach this?
Code: Select all
showif len(visitors)>0:
python:
for x in visitors:
renpy.ui.imagebutton("icon"+str(x), action=Function(visitors.remove, x))
I have one more question that has been driving me crazy...how can I apply a transform to these imagebuttons when they are first generated only. I want to use easeintop, or equivalent, to have them slide down from the top of the screen. What's the best way to approach this?
Re: Add a displayable to an existing screen
The example on the link has a transform, so try to make the same and play with 'on appear'/'on show' events.drmindflip wrote: ↑Thu Jun 25, 2020 5:19 pm ...I have one more question that has been driving me crazy...how can I apply a transform to these imagebuttons when they are first generated only. ...
Who is online
Users browsing this forum: Bing [Bot], Google [Bot]