MOUSE_X_POSITION()

MOUSE_X_POSITION(N)

RETURNS MOUSE X-POSITION ON THE SYSTEM OBJECT NUMBER N

  • Type: Function
  • Parameter: 1
  • Group: Mouse

ACTION

The function MOUSE_X_POSITION(N) returns the position of the mouse on the X-axis on the system object number N.

The position 0 is the position of upper left corner of The system object.

SYNTAX: Result=MOUSE_X_POSITION(N)

  • N = system object number (integer or real). Must be greater than or equal to 0 and less than or equal to the allowed maximum number of system objects.

USE

  • The function MOUSE_X_POSITION() is used to know the current position of mouse on a system object, in 2D and 3D games.

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the allowed maximum number of system objects.
  • If number N is less than 0.
  • If system object number N does not exist.
  • If the object number N is of type : MAIN_MENU, SUB_MENU, SOUND, OPEN_DIALOG, SAVE_DIALOG, DLIST, TIMER, MAIN_MENU_POP,
  • OPEN_DIALOG_PIC, SAVE_DIALOG_PIC, SERIAL.

EXAMPLE

picture 1

rem print current x-position of the mouse on picture1

rem put the mouse on picture1

print mouse_x_position(1)

SEE ALSO

MOUSE_Y_POSITION()

MOUSE_RIGHT_UP()

MOUSE_RIGHT_DOWN()

MOUSE_LEFT_UP()

MOUSE_LEFT_DOWN()

MOUSE_X_RIGHT_UP()

MOUSE_X_RIGHT_DOWN()

MOUSE_Y_RIGHT_UP()

MOUSE_Y_RIGHT_DOWN()

MOUSE_X_LEFT_UP()

MOUSE_X_LEFT_DOWN()

MOUSE_Y_LEFT_UP()

MOUSE_Y_LEFT_DOWN()