Opening a screen with a move transition [SOLVED]

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
kedta35
Regular
Posts: 45
Joined: Wed Aug 30, 2023 1:31 pm
Contact:

Opening a screen with a move transition [SOLVED]

#1 Post by kedta35 »

I've made screens to showcase character favors to one another but I can't figure out how to add a transition on them upon opening. I made buttons that are one the side of the screen and when you click them, they open up a screen that you can temporarily look at and then in that screen there is another button you can click to get back into the game. I want to make it so that upon opening and closing those screens, there are move transitions. This is my code for the side buttons and one of the screens that can be opened up:

Code: Select all

screen sidebuttons1(): 

    imagemap:

        idle "images/favorscreens/favorbuttons idle.png"
        hover "images/favorscreens/favorbuttons hover.png"
        hotspot (1827, 555, 121, 128) action [Hide(""), Show("charn_favor_screen")]
        hotspot (1828, 686, 116, 129) action [Hide(""), Show("chard_favor_screen")]
        
screen charn_favor_screen:
    add "images/favorscreens/charncharl" + str(charn_charl_favor) + ".png"
    modal True
    imagemap:
        idle "images/favorscreens/charncharl idle.png"
        hover "images/favorscreens/charncharl hover.png"
        hotspot (1727, 3, 201, 155) action [Hide("charn_favor_screen")] 
Any help is greatly appreciated.
Last edited by kedta35 on Wed Sep 13, 2023 8:07 am, edited 1 time in total.

User avatar
Alex
Lemma-Class Veteran
Posts: 3095
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Opening a screen with a move transition

#2 Post by Alex »

Try to apply transform to the screen content (like, to your imagemap inside a screen) or put all the content inside a container (fixed, frame, hbox, vbox, etc.) and apply transform to it - viewtopic.php?f=8&t=66826#p561551

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Opening a screen with a move transition

#3 Post by Imperf3kt »

Something like PushMove can be applied to the show / call / hide statements, or any other transition really.
https://www.renpy.org/doc/html/transiti ... l#PushMove

For example, as part of a button:
action Show("myScreen", PushMove(0.2, mode="pushleft"))
Will make the screen be shown with a 0.2 second transition sliding in from the right
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Google [Bot]