-
Notifications
You must be signed in to change notification settings - Fork 3
/
api.lua
147 lines (112 loc) · 3.28 KB
/
api.lua
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
---设置终端游标位置
---@param column integer
---@param line integer
function SetConsoleCursorPosition(column, line) end
---立即从终端获取输入
---@return integer
---@diagnostic disable-next-line
function _getch() return 0 end
---源码目录
CMAKE_SOURCE_DIR = "${CMAKE_SOURCE_DIR}/"
CMAKE_CURRENT_SOURCE_DIR = "${CMAKE_CURRENT_SOURCE_DIR}/"
Framework = {}
---返回时间毫秒
---@return integer
function Framework:time() return 0 end
---休息多少毫秒
---@param ms integer
function Framework:sleep(ms) end
---是否按了某个键
---@param c integer
---@return boolean
function Framework:isKeyOn(c) return true end
function Framework:frameRate() return 0 end
function Framework:setFrameRate(fps) end
---是否按了某个键(一次)
---@param c integer
---@return boolean
function Framework:isKeyTriggered(c) return true end
---在窗口输出 debug 信息
---@param c integer
---@param r integer
---@param text string
---@param color integer|nil
function Framework:drawDebugString(c, r, text, color) end
function Framework:mouse() return {} end
---@deprecated
function Framework:setVideoMemory(x, y, c) return {} end
function Framework:width() return 0 end
function Framework:height() return 0 end
function Framework:drawTriangle2D(p1, p2, p3, t1, t2, t3, c1, c2, c3) end
---comment
---@param filename any
---@return userdata
function Framework:createTexture(filename)
return self:createTexture("")
end
---@param texture userdata
function Framework:setTexture(texture) end
function Framework:setBlendMode(mode) end
function Framework:drawTriangle3D(p1, p2, p3, t1, t2, t3, c1, c2, c3) end
function Framework:enableDepthTest(b) end
function Framework:enableDepthWrite(b) end
---comment
---@param char integer unicode
---@param width integer
---@param height integer
---@param color integer
---@param font string
function GetFontBmp(char, width, height, color, font)
end
StringRenderer = {}
---comment
---@param x integer|nil
---@param y integer|nil
---@param s string|nil
---@param c integer|nil
function StringRenderer:draw(x, y, s, c)
end
---C 方法
---@param path string
---@return Image
function Image(path)
---@class Image
local obj = {}
function obj:height() return 0 end
function obj:width() return 0 end
function obj:pixel(x, y) return 0 end
---@param dstX integer|nil
---@param dstY integer|nil
---@param srcX integer|nil
---@param srcY integer|nil
---@param width integer|nil
---@param height integer|nil
function obj:draw(dstX, dstY, srcX, srcY, width, height) end
return obj
end
---comment
---@param path string
---@return XML
function XML(path) return {} end
---@param path string|nil
---@return CSV
function CSV(path) return {} end
---@param path string|nil
---@return JSON
function JSON(path) return {} end
---@param x any
---@param y any
---@return Vector2
function Vector2(x, y) return {} end
---@param e00 any
---@param e01 any
---@param e10 any
---@param e11 any
---@return Matrix22
function Matrix22(e00, e01, e10, e11) return {} end
---@param e00 any
---@param e01 any
---@param e10 any
---@param e11 any
---@return Matrix23
function Matrix23(e00, e01, e10, e11) return {} end