08.11.2012 Views

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

There are some additional functions related to keyboard interaction.<br />

keyboard_clear(key) Clears the state of the key. This means that it will no<br />

longer generate keyboard events until it starts repeating.<br />

io_clear() Clears all keyboard and mouse states.<br />

io_handle() Handle user io, updating keyboard and mouse status.<br />

keyboard_wait() Waits till the user presses a key on the keyboard.<br />

The mouse<br />

For mouse interaction, the following variables and functions exist:<br />

mouse_x* X-coordinate of the mouse in the room. Cannot be changed.<br />

mouse_y* Y-coordinate of the mouse in the room. Cannot be changed.<br />

mouse_button Currently pressed mouse button. As value use mb_none,<br />

mb_any, mb_left, mb_middle, or mb_right.<br />

mouse_lastbutton Last pressed mouse button.<br />

To check whether a particular mouse button is pressed you can use the following functions.<br />

This is in particular useful when multiple keys are pressed simultaneously.<br />

mouse_check_button(numb) Returns whether the mouse button is currently<br />

down (use as values mb_none, mb_left, mb_middle, or mb_right).<br />

mouse_check_button_pressed(numb) Returns whether the mouse button<br />

was pressed since the last step.<br />

mouse_check_button_released(numb) Returns whether the mouse button<br />

was released since the last step.<br />

There are some additional functions related to mouse interaction.<br />

mouse_clear(button) Clears the state of the mouse button. This means<br />

that it will no longer generate mouse events until the player releases it and<br />

presses it again.<br />

io_clear() Clears all keyboard and mouse states.<br />

io_handle() Handle user io, updating keyboard and mouse status.<br />

mouse_wait() Waits till the user presses a mouse button<br />

.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!