You can support the development on the Github Sponsors page.


Tech > IMPROVED MOUSE API


An attempt to improve the mouse API by adding some useful functionalities.
made by TylerDurden
uploaded by TylerDurden
added:
updated:
download cartridge
- CLICK TO PLAY -

7


Version 1.0

An attempt to improve the mouse API by adding some useful functionalities.

ALERT: You must call mouse() on top of your TIC function, so it can update the mouse coordinates and clicks.

Properties:
mouse.x -- mouse X coordinates
mouse.y -- mouse Y coordinates
mouse.scroll -- mouse Y scroll

Functions:
mouse() -- update mouse, still returns the values like in the original API

----------------------------
mouse.clicked(button) -- return true if the given mouse button started a click
mouse.pressed(button) -- return true if the given mouse button is being held down
mouse.released(button) -- return true if the given mouse button was released

Parameters:
mouse.LEFT, mouse.MIDDLE, mouse.RIGHT or 1, 2, 3 respectively
----------------------------
mouse.in_bound(x, y, width, height) -- is mouse currently inside this boundaries

mouse.toggle_lock() -- lock mouse, if it is already locked it will be unlocked

mouse.is_locked() -- return true if mouse is locked, otherwise it will return false
----------------------------


Post comment