The black square with a question mark is the area I want to be able to put the square with a smiling lad on to. Afterwards, the "? is on ?!" turns into "person is on spot!", which I use to test the variables are working. In previous tests where there was no viewport, this works perfectly fine. however, with the draggable object inside the viewport, it cannot escape the frame it is inside. Here is the code inside the init python block:
Code: Select all
init python:
def unit_dragged(drags, drop):
if drop:
drags[0].snap(drop.x,drop.y)
store.person = drags[0].drag_name
store.spot = drop.drag_name
return
if not drop:
drags[0].snap( 5, 5)
return
Code: Select all
screen vcs:
tag menu
use evi_menu(_("VCS")):
hbox:
yalign 0.1
xalign 0.0
add "cam" # the background image of the woman.
frame:
area (0, 450, 700, 200)
viewport id "vp":
scrollbars "vertical"
mousewheel True
draggable True
side_yfill True
vbox:
draggroup:
drag:
drag_name "movable"
child "icon1_idle.png"
ypos 5
dragged unit_dragged
droppable False
xpos 5
vbar value YScrollValue("vp")
drag:
drag_name "postion"
child "whoisit.png"
draggable False
droppable True
yalign 0.27
xalign 0.28
frame:
xsize 200
ysize 650
yalign 0.27
xalign 0.99
xpadding 10
ypadding 10
text "[person] is on [spot]!"
Thank you for reading!! I have been utterly confused with this for a while.