Discuss Scratch

Scratching_Epicness
Scratcher
34 posts

A block to toggle dragging sprites

I think a block that could toggle the dragging of sprites in a project would be useful.
It would allow people to drag sprites in the game screen and turn the dragging off.
xlk
Scratcher
100+ posts

A block to toggle dragging sprites

when this sprite clicked
set [x diference] to ((x position)-(mouse x))
set [y diference] to ((y position)-(mouse y))
repeat until <not<mouse down?>>

go to x: ((mouse x) + (x diference)) y: ((mouse y) + (y diference))
end


Just add an “ if dragable = 1”, and set it to 1 to make it dragable, and to 0 to disable dragging

Last edited by xlk (April 27, 2014 11:11:24)

Sonickyle
Scratcher
1000+ posts

A block to toggle dragging sprites

I support, even though there's the workaround. We have the
set rotation style [ v]
block, why not this one?
Braeden5454
Scratcher
500+ posts

A block to toggle dragging sprites

Just click the little i next to the sprite in the sprite box, then check can drag in player.
Scratching_Epicness
Scratcher
34 posts

A block to toggle dragging sprites

Braeden5454 wrote:

Just click the little i next to the sprite in the sprite box, then check can drag in player.
I know that, but what I want is to be able to toggle that setting in the game screen

Oh, and xlk I know there are scripts that can do it, but I want a block that can toggle dragging

Last edited by Scratching_Epicness (April 28, 2014 08:46:03)

drmcw
Scratcher
1000+ posts

A block to toggle dragging sprites

No support as I think they should remove the “can drag sprite in player” option as it can cause flash to crash in certain instances that have been reported before. Coding for drag and drop is preferable.
tylerformayor
Scratcher
1 post

A block to toggle dragging sprites

I need to know how to drag a sprite for my game but I cannot find out how! HELP ME PLEASE!!!!!!!!!!!
Scratching_Epicness
Scratcher
34 posts

A block to toggle dragging sprites

Click the I on the selected sprite then make sure enable dragging player is ticked
mathman314
Scratcher
100+ posts

A block to toggle dragging sprites

xlk wrote:

Just add an “ if dragable = 1”, and set it to 1 to make it dragable, and to 0 to disable dragging
That's actually a good idea. If you put the dragging on the sprite on…
if <<[dragging] = [0]> and <mouse down?>> then

set [current Y v] to (y position)
set [current X v] to (x position)
repeat until <not <mouse down?>>

go to x: (current X) y: (current Y)
end
end
There might be a simpler way, but that's how I'd do it.

Last edited by mathman314 (May 25, 2014 13:16:41)

mathman314
Scratcher
100+ posts

A block to toggle dragging sprites

Scratching_Epicness wrote:

Oh, and xlk I know there are scripts that can do it, but I want a block that can toggle dragging
You should just stick with the script. I don't think the Scratch Team ever has and ever will make something that can very simply replace a script. They're trying to encourage programming, not replace it with fancy settings.
mathman314
Scratcher
100+ posts

A block to toggle dragging sprites

tylerformayor wrote:

I need to know how to drag a sprite for my game but I cannot find out how! HELP ME PLEASE!!!!!!!!!!!
When you click on a sprite in the sprite list, you will see a blue square around it. If you click the i in the top left corner of the square, a menu pops up to that allows you to drag the sprite without going into editor.
mathman314
Scratcher
100+ posts

A block to toggle dragging sprites

drmcw wrote:

No support as I think they should remove the “can drag sprite in player” option as it can cause flash to crash in certain instances that have been reported before. Coding for drag and drop is preferable.
That's a great point! Like I said two boxes up from this comment, the Scratch Team is trying to encourage programming, not replace it with fancy settings.
wendelin25
New Scratcher
3 posts

A block to toggle dragging sprites

mathman314 wrote:

xlk wrote:

Just add an “ if dragable = 1”, and set it to 1 to make it dragable, and to 0 to disable dragging
That's actually a good idea. If you put the dragging on the sprite on…
if <<[dragging] = [0]> and <mouse down?>> then

set [current Y v] to (y position)
set [current X v] to (x position)
repeat until <not <mouse down?>>

go to x: (current X) y: (current Y)
end
end
There might be a simpler way, but that's how I'd do it.


Hello,
I am new in this forum and new by scratch.
I don't understand the meaning of “if dragging = 0”. Wher does “dragging” come from? Is it a variable?

I have a sprite, which should have to be moveable one time and not to be moveable in another time of the game.
I want to use your script, but i dont understand it (see above).
Thank you for an answer.

Last edited by wendelin25 (Nov. 9, 2015 19:10:34)

Scratcher1002
Scratcher
1000+ posts

A block to toggle dragging sprites

wendelin25 wrote:

mathman314 wrote:

xlk wrote:

Just add an “ if dragable = 1”, and set it to 1 to make it dragable, and to 0 to disable dragging
That's actually a good idea. If you put the dragging on the sprite on…
if <<(dragging) = [0]> and <mouse down?>> then

set [current Y v] to (y position)
set [current X v] to (x position)
repeat until <not <mouse down?>>

go to x: (current X) y: (current Y)
end
end
There might be a simpler way, but that's how I'd do it.


Hello,
I am new in this forum and new by scratch.
I don't understand the meaning of “if dragging = 0”. Wher does “dragging” come from? Is it a variable?

I have a sprite, which should have to be moveable one time and not to be moveable in another time of the game.
I want to use your script, but i dont understand it (see above).
Thank you for an answer.
Yes, dragging is in fact a variable.
DaSpudLord
Scratcher
1000+ posts

A block to toggle dragging sprites

Scratcher1002 wrote:

wendelin25 wrote:

mathman314 wrote:

xlk wrote:

Just add an “ if dragable = 1”, and set it to 1 to make it dragable, and to 0 to disable dragging
That's actually a good idea. If you put the dragging on the sprite on…
if <<(dragging) = [0]> and <mouse down?>> then

set [current Y v] to (y position)
set [current X v] to (x position)
repeat until <not <mouse down?>>

go to x: (current X) y: (current Y)
end
end
There might be a simpler way, but that's how I'd do it.


Hello,
I am new in this forum and new by scratch.
I don't understand the meaning of “if dragging = 0”. Wher does “dragging” come from? Is it a variable?

I have a sprite, which should have to be moveable one time and not to be moveable in another time of the game.
I want to use your script, but i dont understand it (see above).
Thank you for an answer.
Yes, dragging is in fact a variable.
^^
The creator just didn't code their scratchblocks properly.

Anyway, no support as per the workaround.
wendelin25
New Scratcher
3 posts

A block to toggle dragging sprites

Thank you for your answers!

I combined the script from xlk (#2) with the dragging variable an the “if dragging = 0 and mouseDown?” and it works.
DrTrayBlox1234
Scratcher
2 posts

A block to toggle dragging sprites

no!
alexphan
Scratcher
1000+ posts

A block to toggle dragging sprites

DrTrayBlox1234 wrote:

no!
Please don't necropost (posting on old topics). Check the date of the last post before posting. Thanks!
AmpElectrecuted
Scratcher
1000+ posts

A block to toggle dragging sprites

This is now implemented:
set drag mode [draggable v]
This topic will be closed.

SiraDiamond wrote:

Minecraft dirt block
Please don't necropost.
Yes, it usually doesn't apply to the suggestions forum, but the post is off-topic and the suggestion is implemented.

Last edited by AmpElectrecuted (Feb. 13, 2025 09:29:22)

Powered by DjangoBB