[Solved] Remove old dragged when new dragged is placed into the same droppable
Posted: Wed Aug 11, 2021 10:03 am
Hello, I want to know how would I go about making it so that when a new drag is placed into an already occupied drop it would displace the old drag outside of the drop.
I'm using a slightly modified code of the one found here https://www.renpy.org/doc/html/drag_drop.html
Here is the code:
I'm using a slightly modified code of the one found here https://www.renpy.org/doc/html/drag_drop.html
Here is the code:
Code: Select all
init python:
def detective_dragged(drags, drop):
if not drop:
return
store.detective = drags[0].drag_name
store.city = drop.drag_name
return
screen send_detective_screen:
# A map as background.
add "europe.jpg"
# A drag group ensures that the detectives and the cities can be
# dragged to each other.
draggroup:
# Our detectives.
drag:
drag_name "Ivy"
child "ivy.png"
droppable False
dragged detective_dragged
xpos 100 ypos 100
drag:
drag_name "Zack"
child "zack.png"
droppable False
dragged detective_dragged
xpos 150 ypos 100
# The cities they can go to.
drag:
drag_name "London"
child "london.png"
draggable False
xpos 450 ypos 140
key "b" action Return()
label send_detective:
"We need to investigate! Who should we send, and where should they go?"
call screen send_detective_screen
"Okay, we'll send [detective] to [city]."