9.10 Mouse object

Description

You can get/set the position of the mouse cursor via the Mouse object. The cursor position is relative to the upper left corner of the game window. If the game is in window mode the coordinates will be transformed automatically.

List of methods/properties

NameTypeShort description
XPropertyThe current x coordinate of the mouse cursor
YPropertyThe current y coordinate of the mouse cursor

X

Description

This property represents the x coordinate of the mouse cursor and is relative to the upper left corner of the game window. If the game window is stretched then the x coordinate will be transformed automatically. The unit for this value is pixel.

Syntax

1
Mouse.X

Data type

Dword

Type

Property

Example

1
2
$
Mouse.X = 10
At the end the x coordinate of the mouse cursor whould be 10 pixel away from the left border of the game window.

Y

Description

This property represents the y coordinate of the mouse cursor and is relative to the upper left corner of the game window. If the game window is stretched then the y coordinate will be transformet automatically. The unit for this value is pixel.

Syntax

1
Mouse.Y

Data type

Dword

Type

Property

Example

1
2
$
v[1] = Mouse.Y
At the end v[1] whould be the current y coordinate relative to the upper border of the game window.