I everyone. I’m trying a drag and drop system with two images: one is the objet to drag and the other the area to drop it.
I want that when cursor hover the image object changes to another image(like a warning of "ey, this is the object to interact!!"), and when it's dragging too. Also, when I'm dragging the object to the drop area the image of area changes too, like a warning of "ey, this is where to put it!!"
Is it posible?
I've read the Drag and Drop Documentation and I think this is the key of what I want:
"A Drag has one child. The child's state reflects the status of the drag and drop operation:
selected_hover - when it is being dragged.
selected_idle - when it can be dropped on.
hover - when the draggable will be dragged when the mouse is clicked.
idle - otherwise."
but I don't know how it's working the child state.
This is my code on screens.rpy (using the code with modifications of the documentation). It's 100% operative but doesn't have the hover
Code: Select all
init python:
def myobject_drag(drags, drop):
if not drop:
return
store.myobject = drags[0].drag_name
store.myarea = drop.drag_name
return True
screen send_object_to_area:
modal True
draggroup:
drag:
drag_name "myobject"
child "myobject_idle.png"
droppable False
dragged myobject_drag
xpos 288 ypos 593
drag:
drag_name "myarea"
child "myarea_idle.png"
draggable False
xpos 1318 ypos 79
Code: Select all
child "myobject_%s.png"
Code: Select all
child selected_idle "myobject_idle.png" selected_hover "myobject_hover.png"
If anyone can help me, I'll be eternally grateful. I have searched the forums and have not finded a similar answer so that is why I ask here.
Thank you! And I'm sorry if I don't make myself clear.