-
Notifications
You must be signed in to change notification settings - Fork 1
/
ActorMultiVertex.lua
278 lines (234 loc) · 10.1 KB
/
ActorMultiVertex.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
---@meta
---@class AMVDrawState
---@field Mode? DrawMode
---@field First? integer
---@field Num? integer
---@class ActorMultiVertex : Actor
---@field [string] fun(self: ActorMultiVertex)
---@overload fun(self: ActorMultiVertex) : ActorMultiVertex
--- Initial command. Call as soon as the screen begins construction.
---@field InitCommand? fun(self: ActorMultiVertex)
--- On command. Called after screen construction is done.
---@field OnCommand? fun(self: ActorMultiVertex)
---@field BeginCommand? fun(self: ActorMultiVertex)
---@operator call:ActorMultiVertex
---@diagnostic disable: redundant-parameter
ActorMultiVertex = {}
--- The list of quad states is used to determine which animation state is used for each quad. The offset is added to the AMV's current state, and the resulting state is used.
---@param offset integer
---@return self
function ActorMultiVertex:AddQuadState(offset) end
--- Adds an animation state to the ActorMultiVertex. The state_data table must be like this:
--- ```lua
--- {{left, top, right, bottom}, delay}
--- ```
--- left, top, right, and bottom are pixel coordinates, starting at 0. If delay is 0 or negative, the state will last forever.
---@param state_data table
---@return self
function ActorMultiVertex:AddState(state_data) end
--- Forces the AMV to update the texture coordinates on all its quads, even if the current state has not changed.
---@return self
function ActorMultiVertex:ForceStateUpdate() end
--- Returns whether the AMV uses the animation state.
---@return boolean
function ActorMultiVertex:GetUseAnimationState() end
--- Sets whether the AMV uses the animation state.
---
--- This works best when using DrawMode_Quads.
---
--- AMV's can have animated textures like sprites. Each state tells the AMV what part of the texture to use, and how long the state lasts.
--- Use AddState to add a state onto the end, or SetStateProperties to set all the states at once, or SetState to set a single state.
---
--- Each quad has its own offset that is added to the current state.
---
--- Use AddQuadState to add to the list of quad states, or SetQuadState to set an existing quad state.
---@param use boolean
---@return self
function ActorMultiVertex:SetUseAnimationState(use) end
--- Returns the number of states the AMV has.
---@return integer
function ActorMultiVertex:GetNumStates() end
--- Returns the number of quad states in the destination tween state for the AMV.
---@return integer
function ActorMultiVertex:GetNumQuadStates() end
--- Returns the id of the current state.
---@return integer
function ActorMultiVertex:GetState() end
--- Gets whether the AMV should call the decode function for its texture during updates.
---@return boolean
function ActorMultiVertex:GetDecodeMovie() end
--- Sets whether the AMV should call the decode function for its texture during updates.
---@param decode boolean
---@return self
function ActorMultiVertex:SetDecodeMovie(decode) end
--- Sets the current state.
---@param id integer
---@return self
function ActorMultiVertex:SetState(id) end
--- Returns the offset of the requested quad state.
---@param id integer
---@return integer
function ActorMultiVertex:GetQuadState(id) end
--- Sets the offset of the requested quad state.
---@param id integer
---@param offset integer
---@return self
function ActorMultiVertex:SetQuadState(id,offset) end
--- Returns a table containing the data for the requested state.
---@param id integer
---@return table
function ActorMultiVertex:GetStateData(id) end
--- Sets the requested state to the data in state_data. Similar to AddState, but SetStateData only works on states that have already been added.
---@param id integer
---@param state_data table
function ActorMultiVertex:SetStateData(id,state_data) end
--- Each element of the table must be a state_data table, and is used to construct one state. The table as a whole is the entire list of all states for the AMV.
---@param state_data_table table[]
function ActorMultiVertex:SetStateProperties(state_data_table) end
--- Removes the requested state from the state list.
---@param id integer
---@return self
function ActorMultiVertex:RemoveState(id) end
--- Removes the requested quad state from the quad state list.
---@param id integer
---@return self
function ActorMultiVertex:RemoveQuadState(id) end
--- Sets the delay for every state to delay.
---@param delay number
---@return self
function ActorMultiVertex:SetAllStateDelays(delay) end
--- Sets how far into its animation the AMV is.
---@param seconds number
---@return self
function ActorMultiVertex:SetSecondsIntoAnimation(seconds) end
--- Sets vertex number `index` with the properties provided. The tables of properties are each optional and can be provided in any order.
---@param index integer
---@param vertexData table
function ActorMultiVertex:SetVertex(index, vertexData) end
--- Sets multiple vertices at once. The elements of `vertices` should themselves be tables, of the form provided to <Link class='ActorMultiVertex' function='SetVertex'>SetVertex</Link>.
--- If `vertices` is the first argument it will start from vertex 1. If an integer is provided before `vertices` it will start from that vertex. It will add vertices as necessary.
---
--- ## Example
--- ```lua
--- self:SetVertices( {
--- { { x1, y1, z1 } , { r1,g1,b1,a1 } , { tcx1,tcy1 } },
--- { { x2, y2, z2 } , { r2,g2,b2,a2 } , { tcx2,tcy2 } }
--- } )
--- ```
---@param first integer
---@param vertices table
---@return self
function ActorMultiVertex:SetVertices(first, vertices) end
--- Sets all the drawn verts of the ActorMultiVertex by evaluating the splines.
---
--- ("all the drawn verts" means all the verts between FirstToDraw and NumToDraw, the verts that are set to draw in the current tween state.)
---
--- The parts of the ActorMultiVertex are evenly spaced along the spline in terms of t value.
---
--- The exact behavior depends on the draw mode.
--- - `DrawMode_Quads` uses all 4 splines, one for each corner.
--- - `DrawMode_QuadStrip` and DrawMode_Strip use 2 splines, one for each edge of the strip.
--- - `DrawMode_Fan` uses one spline, for the edge verts of the fan. The first vert is not touched because it is the center.
--- - `DrawMode_Triangles` uses 3 splines, one for each corner.
--- - `DrawMode_SymmetricQuadStrip` uses 3 splines, one on each edge and one in the center.
--- - `DrawMode_LineStrip` uses 1 spline.
---@return self
function ActorMultiVertex:SetVertsFromSplines() end
--- Returns the requested spline. Spline indices range from 1 to 4.
---
--- ActorMultiVertex splines are not inside the tween state,
--- and will not change the verts until you call SetVertsFromSplines.
---@param i integer
---@return CubicSplineN
function ActorMultiVertex:GetSpline(i) end
--- Sets the number of vertices.
---@param num integer
---@return self
function ActorMultiVertex:SetNumVertices(num) end
--- Returns the number of vertices.
---@return integer
function ActorMultiVertex:GetNumVertices() end
--- Sets the draw state variables to the values in the table.
---
--- Mode must be a `DrawMode`.
---
--- First is the index of the first vertex to draw.
---
--- Num is the number of vertices to draw. -1 for Num means draw all verts after First.
---
--- Any value not in the table defaults to the already set value.
---
--- ## Examples
--- ```lua
--- -- Sets all three parts of the draw state.
--- self:SetDrawState{Mode="DrawMode_Quads", First= 1, Num= -1}
--- -- Set only the draw mode. First and Num remain unchanged from previous.
--- self:SetDrawState{Mode="DrawMode_Quads"}
--- -- Set the first and number to draw. Draw mode remains unchanged.
--- self:SetDrawState{First= 3, Num= 4}
--- ```
---@param state AMVDrawState
---@return self
function ActorMultiVertex:SetDrawState(state) end
--- Get the `DrawMode` of the destination tween state.
---@return DrawMode
function ActorMultiVertex:GetDestDrawMode() end
--- Get the FirstToDraw of the destination tween state.
---@return integer
function ActorMultiVertex:GetDestFirstToDraw() end
--- Get the NumToDraw of the destination tween state.
---@return integer
function ActorMultiVertex:GetDestNumToDraw() end
--- Get the `DrawMode` of the current tween state.
---@return DrawMode
function ActorMultiVertex:GetCurrDrawMode() end
--- Get the FirstToDraw of the current tween state.
---@return integer
function ActorMultiVertex:GetCurrFirstToDraw() end
--- Get the NumToDraw of the current tween state.
---@return integer
function ActorMultiVertex:GetCurrNumToDraw() end
--- Returns the ActorMultiVertex's texture.
---@return RageTexture
function ActorMultiVertex:GetTexture() end
--- Sets the `EffectMode` of the ActorMultiVertex.
---@param em EffectMode
---@return self
function ActorMultiVertex:SetEffectMode(em) end
--- Sets the `TextureMode` of the ActorMultiVertex.
---@param tm TextureMode
---@return self
function ActorMultiVertex:SetTextureMode(tm) end
--- Sets the width of the line for `DrawMode_LineStrip`.
---
--- Note: This function is GPU dependant, so the width of the line can vary between 4 to 12px.
---@param width number
---@return self
function ActorMultiVertex:SetLineWidth(width) end
--- Size in PIXELS of the point to draw. This will often round to a whole number on older systems,
--- but most cards will use subpixel sampling to keep these as designed. For better performance, use a whole number, so 6.0.
---
--- Note: This function is GPU dependant, so the size of the point can vary between 12 to 512px.
---
--- **Only used in `DrawMode_Points`.**
---@param width number
---@return self
function ActorMultiVertex:SetPointSize(width) end
--- Alias the Points to be a circle (true) or square (false).
--- if the size is too big, or it is not supported on the GPU's driver, it will be drawn as a square.
---
--- **Only used in `DrawMode_Points`.**
---@param state boolean
function ActorMultiVertex:SetPointState(state) end
--- Sets the `DrawMode` to be used by the ActorMultiVertex that uses `DrawMode_LineStrip`.
---@param mode DrawMode
---@return self
function ActorMultiVertex:SetDrawMode(mode) end
--- Sets the texture to `texture`.
---@param texture RageTexture
---@return self
function ActorMultiVertex:SetTexture(texture) end
--- Sets the texture at from the file path `path`.
---@param path string
---@return self
function ActorMultiVertex:LoadTexture(path) end