The problem is this:
1) Show the drag screen.
2) Drag the picture to any coordinate and drop it, it will be restored (to coords) by the snap method.
3) Hide the drag screen.
4) Show the drag screen:
- The picture appears where it was previously dropped instead of it's last position where it was moved by the snap method (which is really annoying). I am fairly certain that I know how to beat this dropping the screen language (so I don't ask for a workaround, unless it's something obvious) but if this is a bug that can be fixed with the next release or a setting ignored, I would rather stick with the code in use now (combo of Python classes and Ren'Py Screen Language) because it's very readable and convenient.
Code: Select all
init python:
coords = (20, 20)
def dragged(drags, drop):
if not drop:
drags[0].snap(coords[0], coords[1], delay=0.2)
return
return True
screen buttons:
vbox:
align (0.5, 0.8)
textbutton "Show":
action Show("drag")
textbutton "Hide":
action Hide("drag")
screen drag:
drag:
drag_name "None"
child im.Scale("anyimage", 50, 50)
droppable False
dragged dragged
pos (coords[0], coords[1])