mirror of
https://github.com/enduro2d/enduro2d.git
synced 2026-01-05 01:51:02 +07:00
core lua api is almost complete
This commit is contained in:
28
support/modules/mouse.md
Normal file
28
support/modules/mouse.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# MOUSE
|
||||
|
||||
## FUNCTIONS
|
||||
|
||||
- `is_button_pressed(button: string): boolean`
|
||||
- `is_button_just_pressed(button: string): boolean`
|
||||
- `is_button_just_released(button: string): boolean`
|
||||
|
||||
## PROPERTIES
|
||||
|
||||
- `cursor_pos: v2f` (read_only)
|
||||
- `scroll_delta: v2f` (read_only)
|
||||
- `is_any_button_pressed: boolean` (read_only)
|
||||
- `is_any_button_just_pressed: boolean` (read_only)
|
||||
- `is_any_button_just_released: boolean` (read_only)
|
||||
- `pressed_buttons: [string]` (read_only)
|
||||
- `just_pressed_buttons: [string]` (read_only)
|
||||
- `just_released_buttons: [string]` (read_only)
|
||||
|
||||
## EXAMPLE
|
||||
|
||||
```lua
|
||||
the_debug:trace("cursor position: " .. tostring(the_mouse.cursor_pos))
|
||||
|
||||
if the_mouse:is_button_just_pressed("left") then
|
||||
the_debug:trace("mouse button was pressed")
|
||||
end
|
||||
```
|
||||
Reference in New Issue
Block a user