Callbacks

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
jayroll123
Newbie
Posts: 22
Joined: Tue Jul 02, 2013 9:32 pm
Contact:

Callbacks

#1 Post by jayroll123 » Sun Oct 06, 2013 7:05 am

Code: Select all

init -1 python:

    def clicks(event, **kwargs):
        if event == "show" or event == "begin":
            hide screen keyscreen
            #hideScreen
        if event == "slow_done" or event == "end":
            show screen keyscreen
            #showScreen


# Declare characters used by this game.
define e = Character('', color="#c8ffc8", what_slow_cps=20, what_slow_abortable=False, callback=clicks)

define m = Character('', color="#c8ffc8", what_slow_cps=20, what_slow_abortable=False, callback=clicks)


When I run this there's an error. invalid syntax: hide screen->keyscreen :cry:
Need help. .How can I call hide screen keyscreen inside init -1 python:? or is there another way to do that?
Thanks a lot . :D

User avatar
Ayutac
Regular
Posts: 150
Joined: Thu Oct 18, 2012 2:23 pm
Projects: Pokémon Dating Sim
Organization: A Breeze Of Science
Deviantart: Ubro
Location: Mayence, Germany
Contact:

Re: Callbacks

#2 Post by Ayutac » Sun Oct 06, 2013 7:11 am

you're in python, so I guess the correct code lines would be

Code: Select all

renpy.hide_screen('keyscreen')
and

Code: Select all

renpy.show_screen('keyscreen')[/quote]
Up next: An original, open source, text-based Dating Sim. Stay tuned ;)

Post Reply

Who is online

Users browsing this forum: Google [Bot], _ticlock_