Customising Main 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
User avatar
sagittaeri
Newbie
Posts: 6
Joined: Mon May 08, 2017 6:42 am
Completed: Miss Fisher and the Deathly Maze (Steam/Google Play/iOS), Choices That Matter (Google Play/iOS), Our Home. (itch.io)
Projects: Sherlock: The Game is On, Last Mile, Lighthouse
Organization: Tin Man Games
Github: sagittaeri
itch: sagittaeri
Location: Melbourne, Australia
Contact:

Customising Main Menu Screen Transitions

#1 Post by sagittaeri »

Hi, sorry if this has been asked before (I tried to look, I swear), but I've hit a roadblock in my Main Menu UI animation design in Ren'Py. Basically, I want to be able to customise not just the animations when a menu screen becomes visible, but I also want to customise the animations when the menu screen is dismissed (say when players go from "About" to "Preferences", I want to customise the way the "About" page is dismissed, down to each UI element).

From screens.py I've managed to customise the animations when a menu screen becomes visible, but as hard as I tried, I can't seem to figure out how to do the reverse.

I noticed that the transform code allows "on show" and "on hide" events, but neither are triggered by main menu transitions. Ideally I want to be able to control the show and hide animations of main menu screens from them.

Can anyone help or point me in the right direction? Thanks very much!

irredeemable
Regular
Posts: 78
Joined: Thu Feb 08, 2018 7:57 am
Contact:

Re: Customising Main Menu Screen Transitions

#2 Post by irredeemable »

Assuming you don't want to use simple transitions (which could be done with config variables): switching between various game menus doesn't hide the game menu, they're all transcluded onto the screen. Try setting a transform on the first frame in the game_menu screen. If you literally want to control what happens to each individual element for each section of the menu well, that would take a lot more doing.

User avatar
sagittaeri
Newbie
Posts: 6
Joined: Mon May 08, 2017 6:42 am
Completed: Miss Fisher and the Deathly Maze (Steam/Google Play/iOS), Choices That Matter (Google Play/iOS), Our Home. (itch.io)
Projects: Sherlock: The Game is On, Last Mile, Lighthouse
Organization: Tin Man Games
Github: sagittaeri
itch: sagittaeri
Location: Melbourne, Australia
Contact:

Re: Customising Main Menu Screen Transitions

#3 Post by sagittaeri »

Hmm, to confirm, say if I click on "About", and then later on on "Preferences", did you mean "About" is still there, except the z-order is now set before "Preferences", which makes it look like it's removed?

And yeah, I actually do want to animate each UI element as I switch between menu screens, which is why I'm hoping to make it work with "on hide" on the transform, but I suppose there's no way to call them from Ren'Py's built in menu transition systems. I'll actually need to manually keep track of all the elements that are currently shown on screen and hide those first, before calling "ShowMenu("*")".

Hmm... how do I keep track of UI elements I created (label, text, button, etc), or retrieve ones that are on a screen?

irredeemable
Regular
Posts: 78
Joined: Thu Feb 08, 2018 7:57 am
Contact:

Re: Customising Main Menu Screen Transitions

#4 Post by irredeemable »

No, I meant the game menu isn't hidden, and on hide (or show) isn't called for the sub screens(about, preferences, etc) either because they're being replaced by other screens with the same tag ("menu"). For those screens you could use on 'replace' and on 'replaced' instead of on 'show' and on 'hide'.

User avatar
sagittaeri
Newbie
Posts: 6
Joined: Mon May 08, 2017 6:42 am
Completed: Miss Fisher and the Deathly Maze (Steam/Google Play/iOS), Choices That Matter (Google Play/iOS), Our Home. (itch.io)
Projects: Sherlock: The Game is On, Last Mile, Lighthouse
Organization: Tin Man Games
Github: sagittaeri
itch: sagittaeri
Location: Melbourne, Australia
Contact:

Re: Customising Main Menu Screen Transitions

#5 Post by sagittaeri »

Thanks for the suggestion... alas I just tried "on replace" and "on replaced", neither seem to work. :(

I'm thinking it's because "ShowMenu()" doesn't actually call them and just replaces them. I'll need to manually hide the elements on those screen first before drawing the new one.

Any idea how to access currently drawn UI elements on tag menu (and run transforms on them)?

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]