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

Lesson 30. Monitoring Director > Watching the Mouse Position

Watching the Mouse Position

If you create your movies using Lingo more than the score, you will have to pay particular attention to screen coordinates (horizontal and vertical X and Y positions). It is possible to position a sprite from Lingo, either by changing the coordinates of its rectangle using sprite (x).rect or by changing the screen location using the loc property, sprite (x).loc.

Although it is easy to visually position a sprite when working with sprites directly on the stage, in Lingo you must give actual coordinates. It helps, then, to have a way to find out what a particular coordinate is. Coordinates are also helpful for monitoring mouse-click regions (to know where the region is) and for performing calculations to ensure that a bitmap is located on the screen at a particular location relative to the mouse. For instance, the Plaid Man example in Lesson 9 used a behavior to make the man's eyes follow the mouse. Although you did not look at the behavior's script in that lesson, the script needed to determine the mouse position to do its job.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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