Mouse Button Down

From Game Editor

Jump to: navigation, search

Assigns an actor an event whenever the actor is clicked on.

Notes:

  • A filled region can recieve mouse events.
  • A canvas must have a color present to recieve an event; to achieve this, use the function erase(255, 255, 255, .99); This will fill the canvas with an invisible color but will be able to catch clicks.
  • When using this with FollowMouse, sometimes your clicks won't be recieved. This happens because it's listening for the mouseclick before the actor has moved for this frame, and so your mouse is one step ahead of the actor. To fix this, use a larger sprite to click on, or assign the click to a filled region covering the whole screen instead.
  • The ZDepth of an actor will determine it's mouseclick priority. If you need to click on another actor that is below the top actor, you must disable the mousebuttondown event for the actor on top.