Returning from scratch menu screen transitions

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
Qu-ko
Regular
Posts: 54
Joined: Sun Jun 18, 2006 12:27 am
Location: Massachusetts, land of evil-ness
Contact:

Returning from scratch menu screen transitions

#1 Post by Qu-ko »

Maybe I'm just doing this wrong, or thinking of the wrong thing, but to sum it up simply, how would you get something like this:

Code: Select all

ui.textbutton(u"戻る", style="button_text", clicked=ui.jumps("_main_menu"))
to do a transition when jumping back to the main menu? I'm trying to code a scene select page from scratch, and as one can expect, it's not working the way I want it to. I have it started with what's in the attachment, and it probably looks horrid from an experienced coder's point of view, but... meh, as long as it works, I guess.

I just want the "Return" button to have a transition before moving back to the main menu. It can't possibly be this hard. >>
Attachments
scene.rpy
failcoding, yay
(904 Bytes) Downloaded 64 times
ヾ(゚Д゚)ノ うわあああぁぁぁぁぁぁぁ―――――――

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Returning from scratch menu screen transitions

#2 Post by PyTom »

One way is:

Code: Select all

init python:
     @renpy.curry
     def transjumps(label, transition):
         renpy.transition(transition)
         renpy.jump(label)

# ...

ui.textbutton(u"戻る", style="button_text", clicked=transjumps("_main_menu", dissolve))
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Karrion