Drag & drop feature in builder

Hi - in builder you are limited to updating the position every frame and this leads to quite a clunky response - but give it a try and see what you think:

Set up a code component

#Begin experiment
dynPos = (0,0) # dynamic position variable

#Every Frame
while mouse.isPressedIn(polygon):
    dynPos = mouse.getPos()

Then you’d just set your image position to set every frame and have $dynPos as the value.

I think the optimal component order would be:
Code Component
Mouse
Image - that way there won’t be a frame delay between variable setting and response.

BW

Oli

1 Like