Discuss Scratch

657483
New to Scratch
7 posts

dragging

how doo yoo dragg????
gigapouch
Scratcher
1000+ posts

dragging

Drag in the player? Just go into the editor, click on the sprite you want to be able to be dragged, click on the i on the top left of it, and check “can drag in player”.

Using scripts? Use this script:

forever
if <mouse down?> then
if <touching [mouse pointer v]?> then
repeat until <not <<touching [mouse pointer v]?> or <mouse down?>>>

go to [mouse-pointer v]
end
end
end
end

Last edited by gigapouch (June 8, 2014 23:02:26)


I have a Steam account. If you have one too, feel free to add me to your friends list.
Also check out my YouTube channel if you like the outdoors, Minecraft, cars, roller coasters, etc.
TheLogFather
Scratcher
1000+ posts

dragging

The “mouse down and touching pointer” combo, as suggested above, is the most common way to do it.
However, it does have some potential pitfalls, so I'd suggest doing it via “when this sprite clicked” instead.

See this demo project for a simple script you can use:


http://scratch.mit.edu/projects/21512101

Last edited by TheLogFather (June 9, 2014 12:38:03)


Siggy the Kumquat slayer:
Main account: DadOfMrLog –– Frameworks for basic pen-rendered 3D in scratch (see studio). Examples:

- - - - 3D Text - - - - - - Simple shapes - - - Controllable structures - - - On the ground - - - - - - In space - - - -

Powered by DjangoBB