![]() |
This article or section documents something not included in the current version of Scratch (3.0). It is only useful from a historical perspective. For information on the feature that replaced this one, see Set Drag Mode () (block). |
The draggable sprite feature was a tool in Scratch 2.0 and Scratch 1.x that allowed a sprite to be dragged while the project was being played. It was removed in Scratch 3.0 in favor of the set drag mode [draggable v]
block. The option was visible in early mock-ups of Scratch 3.0.[1]
Access
The tool is turned off by default. To turn it on, one looked in the sprite pane, clicked the "i" by a sprite, then clicked the checkbox, as shown at the left.
While it is easy to access, many Scratchers would like it to be more visible.[2]
Workaround
Sometimes, it was necessary to have a sprite that is only draggable sometimes or drags in a special way. Scripts can be used to make a sprite draggable and are much more flexible than the Draggable Sprite feature. One script that can be used to make a sprite draggable is this:
when this sprite clicked repeat until <not <<mouse down?> and <touching [mouse-pointer v]?>> go to [mouse-pointer v]
However, this will make the sprite the cursor is dragging snap to the center. In order to drag a sprite relative to where the cursor is, use this script:
when green flag clicked forever if <<touching [mouse-pointer v]?> and <mouse down?>> then set [offset x v] to ((x position)-(mouse x) set [offset y v] to ((y position)-(mouse y) repeat until <not <mouse down?>> go to x: ((mouse x)+(offset x)) y: ((mouse y)+(offset y))
The Set Drag Mode () released in 3.0 made it possible to set the drag mode using a single block or change the drag mode in a script.
Example Uses
The tool had many uses, the most popular of which were:
- Quicker project testing
- Reduced scripts (very useful in One Sprite One Script Projects)
- "Drag and drop" games
- Paint projects where a paintbrush, pen, or pencil was moved around
- Dress-up and makeup projects
- Customization projects, such as scene creators