natiny.input.get_mouse_button_down
natiny.input.get_mouse_button_down(button) -> boolean
Returns true if the specified mouse button is currently held down.
Parameters
| Name | Type | Description |
|---|---|---|
button |
number |
Mouse button - a natiny.input.MOUSE_BUTTON_* constant, e.g. natiny.input.MOUSE_BUTTON_LEFT |
Returns
| Type | Description |
|---|---|
boolean |
true if the button is held, false otherwise |
Example
if natiny.input.get_mouse_button_down(natiny.input.MOUSE_BUTTON_LEFT) then
drag()
end
Notes
- Returns
trueevery frame as long as the button is held. - Use
mouse_button_pressedto detect the moment the button is first pressed.