-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditor.d.luau
44 lines (37 loc) · 981 Bytes
/
editor.d.luau
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
type Color = {
red: number,
green: number,
blue: number,
alpha: number?
};
type FontId = number;
declare Renderer: {
Font: {
load: (filepath: string) -> FontId
},
endRedraw: () -> (),
drawRect: (x: number, y: number, width: number, height: number, color: Color) -> (),
drawText: (font: FontId, text: string, x: number, y: number, font_size: number, color: Color) -> (),
}
declare Input: {
Keyboard: {
pollKey: () -> number,
pollChar: () -> number
},
Mouse: {
getPosition: () -> (number, number),
getWheelMove: () -> (number, number)
}
}
declare App: {
--- returns true if redraw
setMainLoop: (func: () -> boolean) -> (),
getFPS: () -> number,
setFPS: (fps: number) -> (),
getWindowSize: () -> (number, number),
}
declare File: {
read: (path: string) -> string,
write: (path: string, contents: string) -> ()
}
declare function require(target: string): any