[Solved] ATL inside Hide()

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
Potato0095
Regular
Posts: 84
Joined: Sun May 08, 2016 8:40 pm
Projects: LoveCraft
itch: potato95
Location: Brazil
Contact:

[Solved] ATL inside Hide()

#1 Post by Potato0095 »

I'm trying to do a phone animation, click on a imagebutton, show screen, click in another imagebutton, hide screen. The problem is: I can't find a way to use action Hide("phone") with ATL. Should I continue with this and try to do the animations, or should I simply re-do from scrath without using a screen?

Code: Select all

screen phone:
    tag menu
    modal True
    style_group "phone"
    image phone_wallpaper:
        anchor 0, 0 pos 950, 5
        at phone_in
    image "images/Phone/Phone.png":
        anchor 0, 0 pos 950, 5
        at phone_in
    imagebutton idle "images/Phone/Button_exit.png" action Hide("phone") pos 1000, 525 focus_mask True:
        at button_in
Last edited by Potato0095 on Mon Mar 02, 2020 8:48 am, edited 1 time in total.
"There are two types of lies: Lies that hurt, and lies that don't."

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: ATL inside Hide()

#2 Post by gas »

Try to use an "on hide" clause in the transform itself.
This is an example.

Code: Select all


transform notify_appear:
    on show:
        alpha 0
        linear .25 alpha 1.0
    on hide:
        linear .5 alpha 0.0
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

User avatar
Potato0095
Regular
Posts: 84
Joined: Sun May 08, 2016 8:40 pm
Projects: LoveCraft
itch: potato95
Location: Brazil
Contact:

Re: ATL inside Hide()

#3 Post by Potato0095 »

gas wrote: Sat Feb 29, 2020 5:53 pm Try to use an "on hide" clause in the transform itself.
This is an example.

Code: Select all

transform notify_appear:
    on show:
        alpha 0
        linear .25 alpha 1.0
    on hide:
        linear .5 alpha 0.0
Heh, it worked with a few adjustments. It simply hid the images at first, not the screen itself, which is what I need (I don't know if that's intentional from Ren'Py). Adding another action ( Return() ) to the image button fixed this other issue. Thanks for the help. :D

Code: Select all

screen phone:
    tag menu
    modal True
    style_group "phone"
    image phone_wallpaper:
        anchor 0, 0 pos 950, 5
        at phone_atl
    image "images/Phone/Phone.png":
        anchor 0, 0 pos 950, 5
        at phone_atl
    imagebutton idle "images/Phone/Button_exit.png" action[ Hide("phone"), Return() ] pos 1000, 525 focus_mask True:
        at button_atl
        
transform phone_atl:
    on show:
        xpos 1300
        linear .25 xpos 950
    on hide:
        xpos 950
        linear .25 xpos 1300
        
transform button_atl:
    on show:
        xpos 1350
        linear .25 xpos 1000
    on hide:
        xpos 1000
        linear .25 xpos 1350
"There are two types of lies: Lies that hurt, and lies that don't."

Post Reply

Who is online

Users browsing this forum: Google [Bot]