Transform Won't update until I move mouse.

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
gabowave
Newbie
Posts: 10
Joined: Sat Jul 08, 2023 4:15 pm
Contact:

Transform Won't update until I move mouse.

#1 Post by gabowave »

Hello All, I'm once again asking for help regarding something. I am having an issue regarding ATL and it not updating as I'm hoping for. Here is the code for reference.

Code: Select all

default phoneHover = False
default phoneClick = False

transform phoneIdle:
    linear 0.2 xpos 150 ypos 2510 rotate 15 zoom 1.0
    on idle:
        linear 0.05 ypos 2510
    on hover:
        linear 0.05 ypos 2410
transform phoneSelected:
    xpos 150
    ypos 2410
    linear 0.2 pos (1920, 1080) rotate 0 zoom 1.33333333

transform clockIdle:
    anchor (0.5, 0.0)
    linear 0.05 rotate 15 zoom 1.0 pos (255,1940) 
transform clockHover:
    linear 0.05 pos (260, 1840)
transform clockSelected:
    xpos 150
    ypos 2410
    linear 0.2 pos (1920, 340) rotate 0 zoom 1.33333333
    
style date:
    font "fonts/Qaz.ttf"
    size 24

style time:
    font "fonts/Qaz.ttf"
    size 120
    
screen phone():
    imagebutton:
        anchor (0.5, 0.5)
        idle "images/Screens/Phone/Phone_Frame.webp" action [ToggleVariable("phoneClick"), ToggleVariable("phoneSens"), ToggleVariable("phoneHover")]
        hovered ToggleVariable("phoneHover")
        unhovered ToggleVariable("phoneHover")
        if phoneClick == False:
            at phoneIdle
        else:
            at phoneSelected
        selected phoneClick
        sensitive phoneSensitive
        focus_mask True
    
    vbox:
        text "[Time.telltime]" style "time"
        if phoneClick == False and phoneHover == False:
            at clockIdle
        elif phoneHover == True and phoneClick == False:
            at clockHover
        else:
            at clockSelected
And here is an gif (hopefully it works)
Image

For some reason all of the other warpers work but the zoom and rotation don't work until I move my mouse. Hopefully someone can shed some light on this.

I imagine that the hovered and unhovered actions are responsible for this. But I'm not so certain.

If there's a better way of implementing this please do let me know, as I am trying to learn. Thank you for any help!

Post Reply

Who is online

Users browsing this forum: No registered users