Using the image button action to call a screen

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
Nervis Wreck
Newbie
Posts: 4
Joined: Wed Jan 19, 2022 6:55 pm
Contact:

Using the image button action to call a screen

#1 Post by Nervis Wreck »

I have an imagebutton which when clicked I would like to have it call a screen. No I do not want to show the screen. I want to call it, just the same as I can do from a label

Code: Select all

call screen profile(character, "statistics")
Is there anyway to achieve this functionality?

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

Re: Using the image button action to call a screen

#2 Post by Ocelot »

You can use Function]/c] screen action with call_screen function. Just make sure that screen from which you are calling it is not called itself.
< < insert Rick Cook quote here > >

Nervis Wreck
Newbie
Posts: 4
Joined: Wed Jan 19, 2022 6:55 pm
Contact:

Re: Using the image button action to call a screen

#3 Post by Nervis Wreck »

Ocelot wrote: Thu Jan 20, 2022 3:05 am You can use Function]/c] screen action with call_screen function. Just make sure that screen from which you are calling it is not called itself.
Unfortunately the one thing I cannot do is the one thing that I wanted to do. The inability to recursively call the same screen over and over is actually quite limiting. I did find another solution as a work around, though it is far less elegant than what I originally intended. Regardless, thank you for the response.

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

Re: Using the image button action to call a screen

#4 Post by Ocelot »

Technocally because call screen is a misnomer. Correctly it should be called firce interaction with screen. Call screen is essentually sequence of show screen, renpy.interact() and hide screen.
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: No registered users