From Test-Scratch-Wiki
![]() |
This article or section documents a feature not included in the current version of Scratch (3.0). It is only useful from a historical perspective. |
可拖動的Sprite功能是Scratch 2.0和Scratch 1.X中的工具,可以在播放項目時拖動Sprite。在Scratch 3.0中將其刪除,因為它支持SET DRAG模式()塊。 該選項在Scratch 3.0的早期模型中可見。
如何使用
默認情況下關閉該工具。 要將其打開,一個人在精靈窗格中抬起頭,單擊“ I”,然後單擊“ I”,然後單擊複選框,如左圖所示。
雖然很容易使用,但許多SCRATCH者希望它更可見。
解決方案
有時,有時必須有一個只能拖動或以特殊方式拖動的精靈。 腳本可用於製造精靈拖動,並且比可拖動的精靈功能更靈活。 一個可用於製作精靈拖動的腳本是:
when this sprite clicked repeat until <not <<mouse down?> and <touching [mouse-pointer v]?>> go to [mouse-pointer v]
但是,這將使光標正在將快照拖到中心。 為了相對於光標所在的位置拖動精靈,請使用此腳本:
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))
set拖動模式()在3.0中釋放,使使用單個塊設置拖動模式或在腳本中更改拖放模式成為可能。
示例use
該工具有很多用途,其中最受歡迎的是: