Lingo Dictionary > L-N > moveableSprite

 

moveableSprite

Syntax

sprite(whichSprite).moveableSprite
the moveableSprite of sprite whichSprite

Description

Sprite property; indicates whether a sprite can be moved by the user (TRUE) or not (FALSE).

You can make a sprite moveable by using the Moveable option in the Score. However, to control whether a sprite is moveable and to turn this condition on and off as needed, use Lingo. For example, to let users drag sprites one at a time and then make the sprites unmoveable after they are positioned, turn the moveableSprite sprite property on and off at the appropriate times.

Note: For more customized control such as snapping back to the origin or animating while dragging, create a behavior to manage the additional functionality.

This property can be tested and set.

Example

This handler makes sprites in channel 5 moveable:

on spriteMove
	 sprite(5).moveableSprite = TRUE
end

Example

This statement checks whether a sprite is moveable and if it isn't, displays a message:

if sprite(13).moveableSprite = FALSE then 	member("Notice").text = "You can't drag this item by using the mouse."

See also

mouseLoc