Transform drag when hovering over it

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
Hoomst
Newbie
Posts: 10
Joined: Wed Jun 08, 2022 9:46 am
Contact:

Transform drag when hovering over it

#1 Post by Hoomst » Tue Sep 06, 2022 9:02 am

I'd like to add a transform to drags when hovering with the coursor over them.
I get the error "Exception: Only drags can be added to a drag group."
How can I achieve that?
Eventually I also want a function to trigger when the drags are being hovered over but I haven't finished the code for that yet.

Code: Select all

screen assign_roster:
    vpgrid:
        cols 2
        xalign 0.5 yanchor 0 ypos 100
        spacing 50 ysize 1000
        draggroup:
            drag:
                draggable True
                droppable False
                drag_raise True
                drag_name "megan_drag"
                child "girls/megan/card_megan.png"
                hovered NullAction()
                at transform_hover
            drag:    
                draggable True
                droppable False
                drag_raise True
                drag_name "roxy_drag"
                child "girls/roxy/card_roxy.png"
                hovered NullAction()
                at transform_hover            
-----
init:
    transform transform_hover:
        on idle:
            matrixcolor BrightnessMatrix(0)
        on hover:
            matrixcolor BrightnessMatrix(0.25)                

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot]