-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathcallback.lua
More file actions
54 lines (45 loc) · 1.11 KB
/
callback.lua
File metadata and controls
54 lines (45 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---@meta
---
---@class Callback
local callback = {}
---
--- Called every frame
---
---@param count integer Frame number
function callback.frame(count) end
---
--- Called on keyboard events
---
---@param keycode integer Key code
---@param state integer 0=release, 1=press, 2=repeat
function callback.key(keycode, state) end
---
--- Called on character input events
---
---@param char string UTF-8 character
function callback.char(char) end
---
--- Called on mouse button events
---
---@param button integer 0=left, 1=right, 2=middle
---@param state integer 0=release, 1=press
function callback.mouse_button(button, state) end
---
--- Called on mouse movement
---
---@param x integer Mouse X position
---@param y integer Mouse Y position
function callback.mouse_move(x, y) end
---
--- Called on mouse wheel scroll
---
---@param dx number Horizontal scroll delta
---@param dy number Vertical scroll delta
function callback.mouse_scroll(dx, dy) end
---
--- Called on window resize
---
---@param width integer New window width
---@param height integer New window height
function callback.window_resize(width, height) end
return callback