Mouse Module (last update 10/05/01)
Description:
The module adds mouse support to your game/animation. This includes reading the position and state of the mouse, and triggering mouse actions on sprite and layer objects.
To use:
The code can be linked in to your script by adding this line to the <HEAD> section of your document:
<script language="Javascript" src="gamelib_mouse.js"></script>
You then instantiate the mouse by adding the following to your script:
myMouse=Ms_initmouse();
List of methods for mouse module
List of properties for mouse module
mousedown
onstate
over
x
xoff
y
yoff
z
Descriptions of methods
Descriptions of properties
Property | Data Type | Read/Write | Description |
---|---|---|---|
x | Numeric | R | The x position of mouse _RELATIVE_ to Sp_xoffset (see sprite docs about this global variable) |
y | Numeric | R | The y position of mouse _RELATIVE_ to Sp_yoffset (see sprite docs about this global variable) |
mousedown | Boolean | R | Used to determine whether the mouse button is pressed down |
over | Object | R | If not NULL, then this is the sprite or layer the mouse pointer is over. Sprites and layers actually have their own mouse event triggers, see the sprite docs or layer docs for details |
xoff | Numeric | R | The position of the mouse in the x axis relative to sprite/layer it's over |
yoff | Numeric | R | The position of the mouse in the y axis relative to sprite/layer it's over |
z | Numeric | R | The z index of the sprite/layer the mouse is over. Used internally |
onstate | Boolean | R | Used internally |