• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Lesson 23. Keyboard Control > Using the Constraint of Sprite to Limit Movement

Using the Constraint of Sprite to Limit Movement

Next you need to update the movie script to use the new boundary that you just created. Lingo has a built-in command to do just that: the constraint of sprite. The syntax of this command is sprite(whichSprite).constraint or the constraint of sprite whichSprite.

This sprite property limits the position of the sprite specified by whichSprite by constraining it to the bounding rectangle of another sprite. The constrained sprite cannot be moved outside the bounding rectangle of the constraining sprite.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint