[solved] is it possible to pass an action to 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
User avatar
Kia
Eileen-Class Veteran
Posts: 1039
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

[solved] is it possible to pass an action to a screen?

#1 Post by Kia »

I'm wondering if something this is possible:

Code: Select all

screen test:
    textbutton _("Return") action Show("test_1", 'Return()')

screen test_1(a):
    textbutton _("Return") action a
of course it can't be a string, I tested ^_^
Last edited by Kia on Wed Aug 15, 2018 1:59 pm, edited 1 time in total.

User avatar
MaydohMaydoh
Regular
Posts: 165
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: is it possible to pass an action to a screen?

#2 Post by MaydohMaydoh »

You seem to need to pass it with a keyword,

Code: Select all

screen test:
	textbutton _("Return") action Show('test_1', a=Return())
	
scren test_1(a):
	textbutton _("Return") action a

User avatar
Kia
Eileen-Class Veteran
Posts: 1039
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: is it possible to pass an action to a screen?

#3 Post by Kia »

I keep forgetting this every time, thank you ^_^

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]