summaryrefslogtreecommitdiff
path: root/meta/3rd/Cocos4.0/cc.Director.lua
blob: bcbd89fbde7bfa4ff7a6b36848b9d02ea4ff1d78 (plain)
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308

---@class cc.Director 
local Director={ }
cc.Director=Director




---*  Pauses the running scene.<br>
---* The running scene will be _drawed_ but all scheduled timers will be paused.<br>
---* While paused, the draw rate will be 4 FPS to reduce CPU consumption.
---@return self
function Director:pause () end
---*  Sets the EventDispatcher associated with this director.<br>
---* since v3.0<br>
---* js NA
---@param dispatcher cc.EventDispatcher
---@return self
function Director:setEventDispatcher (dispatcher) end
---*  The size in pixels of the surface. It could be different than the screen size.<br>
---* High-res devices might have a higher surface size than the screen size.<br>
---* Only available when compiled using SDK >= 4.0.<br>
---* since v0.99.4
---@param scaleFactor float
---@return self
function Director:setContentScaleFactor (scaleFactor) end
---* 
---@return float
function Director:getDeltaTime () end
---* Gets content scale factor.<br>
---* see Director::setContentScaleFactor()
---@return float
function Director:getContentScaleFactor () end
---*  Returns the size of the OpenGL view in pixels. 
---@return size_table
function Director:getWinSizeInPixels () end
---* Returns safe area rectangle of the OpenGL view in points.
---@return rect_table
function Director:getSafeAreaRect () end
---*  Sets the OpenGL default values.<br>
---* It will enable alpha blending, disable depth test.<br>
---* js NA
---@return self
function Director:setGLDefaultValues () end
---*  Sets the ActionManager associated with this director.<br>
---* since v2.0
---@param actionManager cc.ActionManager
---@return self
function Director:setActionManager (actionManager) end
---* Pops out all scenes from the stack until the root scene in the queue.<br>
---* This scene will replace the running one.<br>
---* Internally it will call `popToSceneStackLevel(1)`.
---@return self
function Director:popToRootScene () end
---* Adds a matrix to the top of specified type of matrix stack.<br>
---* param type Matrix type.<br>
---* param mat The matrix that to be added.<br>
---* js NA
---@param type int
---@param mat mat4_table
---@return self
function Director:loadMatrix (type,mat) end
---*  This object will be visited after the main scene is visited.<br>
---* This object MUST implement the "visit" function.<br>
---* Useful to hook a notification object, like Notifications (http:github.com/manucorporat/CCNotifications)<br>
---* since v0.99.5
---@return cc.Node
function Director:getNotificationNode () end
---*  Returns the size of the OpenGL view in points. 
---@return size_table
function Director:getWinSize () end
---* 
---@return cc.TextureCache
function Director:getTextureCache () end
---*  Whether or not the replaced scene will receive the cleanup message.<br>
---* If the new scene is pushed, then the old scene won't receive the "cleanup" message.<br>
---* If the new scene replaces the old one, the it will receive the "cleanup" message.<br>
---* since v0.99.0
---@return boolean
function Director:isSendCleanupToScene () end
---*  Returns visible origin coordinate of the OpenGL view in points. 
---@return vec2_table
function Director:getVisibleOrigin () end
---@overload fun(float:float):self
---@overload fun():self
---@param dt float
---@return self
function Director:mainLoop (dt) end
---* Gets Frame Rate.<br>
---* js NA
---@return float
function Director:getFrameRate () end
---*  Get seconds per frame. 
---@return float
function Director:getSecondsPerFrame () end
---* Clear all types of matrix stack, and add identity matrix to these matrix stacks.<br>
---* js NA
---@return self
function Director:resetMatrixStack () end
---* Converts an OpenGL coordinate to a screen coordinate.<br>
---* Useful to convert node points to window points for calls such as glScissor.
---@param point vec2_table
---@return vec2_table
function Director:convertToUI (point) end
---* Clones a specified type matrix and put it to the top of specified type of matrix stack.<br>
---* js NA
---@param type int
---@return self
function Director:pushMatrix (type) end
---*  Sets the default values based on the Configuration info. 
---@return self
function Director:setDefaultValues () end
---* 
---@return boolean
function Director:init () end
---*  Sets the Scheduler associated with this director.<br>
---* since v2.0
---@param scheduler cc.Scheduler
---@return self
function Director:setScheduler (scheduler) end
---* Gets the top matrix of specified type of matrix stack.<br>
---* js NA
---@param type int
---@return mat4_table
function Director:getMatrix (type) end
---* returns whether or not the Director is in a valid state
---@return boolean
function Director:isValid () end
---*  The main loop is triggered again.<br>
---* Call this function only if [stopAnimation] was called earlier.<br>
---* warning Don't call this function to start the main loop. To run the main loop call runWithScene.
---@return self
function Director:startAnimation () end
---*  Returns the Renderer associated with this director.<br>
---* since v3.0
---@return cc.Renderer
function Director:getRenderer () end
---* Get the GLView.<br>
---* lua NA
---@return cc.GLView
function Director:getOpenGLView () end
---*  Gets current running Scene. Director can only run one Scene at a time. 
---@return cc.Scene
function Director:getRunningScene () end
---*  Sets the glViewport.
---@return self
function Director:setViewport () end
---*  Stops the animation. Nothing will be drawn. The main loop won't be triggered anymore.<br>
---* If you don't want to pause your animation call [pause] instead.
---@return self
function Director:stopAnimation () end
---*  Pops out all scenes from the stack until it reaches `level`.<br>
---* If level is 0, it will end the director.<br>
---* If level is 1, it will pop all scenes until it reaches to root scene.<br>
---* If level is <= than the current stack level, it won't do anything.
---@param level int
---@return self
function Director:popToSceneStackLevel (level) end
---*  Resumes the paused scene.<br>
---* The scheduled timers will be activated again.<br>
---* The "delta time" will be 0 (as if the game wasn't paused).
---@return self
function Director:resume () end
---*  Whether or not `_nextDeltaTimeZero` is set to 0. 
---@return boolean
function Director:isNextDeltaTimeZero () end
---*  Sets clear values for the color buffers,<br>
---* value range of each element is [0.0, 1.0].<br>
---* js NA
---@param clearColor color4f_table
---@return self
function Director:setClearColor (clearColor) end
---*  Ends the execution, releases the running scene.<br>
---* lua endToLua
---@return self
function Director:endToLua () end
---* Sets the GLView. <br>
---* lua NA
---@param openGLView cc.GLView
---@return self
function Director:setOpenGLView (openGLView) end
---* Converts a screen coordinate to an OpenGL coordinate.<br>
---* Useful to convert (multi) touch coordinates to the current layout (portrait or landscape).
---@param point vec2_table
---@return vec2_table
function Director:convertToGL (point) end
---*  Removes all cocos2d cached data.<br>
---* It will purge the TextureCache, SpriteFrameCache, LabelBMFont cache<br>
---* since v0.99.3
---@return self
function Director:purgeCachedData () end
---*  How many frames were called since the director started 
---@return unsigned_int
function Director:getTotalFrames () end
---* Enters the Director's main loop with the given Scene.<br>
---* Call it to run only your FIRST scene.<br>
---* Don't call it if there is already a running scene.<br>
---* It will call pushScene: and then it will call startAnimation<br>
---* js NA
---@param scene cc.Scene
---@return self
function Director:runWithScene (scene) end
---* Sets the notification node.<br>
---* see Director::getNotificationNode()
---@param node cc.Node
---@return self
function Director:setNotificationNode (node) end
---*  Draw the scene.<br>
---* This method is called every frame. Don't call it manually.
---@return self
function Director:drawScene () end
---* 
---@return self
function Director:restart () end
---* Pops out a scene from the stack.<br>
---* This scene will replace the running one.<br>
---* The running scene will be deleted. If there are no more scenes in the stack the execution is terminated.<br>
---* ONLY call it if there is a running scene.
---@return self
function Director:popScene () end
---*  Adds an identity matrix to the top of specified type of matrix stack.<br>
---* js NA
---@param type int
---@return self
function Director:loadIdentityMatrix (type) end
---*  Whether or not displaying the FPS on the bottom-left corner of the screen. 
---@return boolean
function Director:isDisplayStats () end
---*  Sets OpenGL projection. 
---@param projection int
---@return self
function Director:setProjection (projection) end
---*  Returns the Console associated with this director.<br>
---* since v3.0<br>
---* js NA
---@return cc.Console
function Director:getConsole () end
---* Multiplies a matrix to the top of specified type of matrix stack.<br>
---* param type Matrix type.<br>
---* param mat The matrix that to be multiplied.<br>
---* js NA
---@param type int
---@param mat mat4_table
---@return self
function Director:multiplyMatrix (type,mat) end
---* Gets the distance between camera and near clipping frame.<br>
---* It is correct for default camera that near clipping frame is same as the screen.
---@return float
function Director:getZEye () end
---* Sets the delta time between current frame and next frame is 0.<br>
---* This value will be used in Schedule, and will affect all functions that are using frame delta time, such as Actions.<br>
---* This value will take effect only one time.
---@param nextDeltaTimeZero boolean
---@return self
function Director:setNextDeltaTimeZero (nextDeltaTimeZero) end
---*  Pops the top matrix of the specified type of matrix stack.<br>
---* js NA
---@param type int
---@return self
function Director:popMatrix (type) end
---* Returns visible size of the OpenGL view in points.<br>
---* The value is equal to `Director::getWinSize()` if don't invoke `GLView::setDesignResolutionSize()`.
---@return size_table
function Director:getVisibleSize () end
---*  Gets the Scheduler associated with this director.<br>
---* since v2.0
---@return cc.Scheduler
function Director:getScheduler () end
---* Suspends the execution of the running scene, pushing it on the stack of suspended scenes.<br>
---* The new scene will be executed.<br>
---* Try to avoid big stacks of pushed scenes to reduce memory allocation. <br>
---* ONLY call it if there is a running scene.
---@param scene cc.Scene
---@return self
function Director:pushScene (scene) end
---*  Gets the FPS value. 
---@return float
function Director:getAnimationInterval () end
---*  Whether or not the Director is paused. 
---@return boolean
function Director:isPaused () end
---*  Display the FPS on the bottom-left corner of the screen. 
---@param displayStats boolean
---@return self
function Director:setDisplayStats (displayStats) end
---*  Gets the EventDispatcher associated with this director.<br>
---* since v3.0<br>
---* js NA
---@return cc.EventDispatcher
function Director:getEventDispatcher () end
---*  Replaces the running scene with a new one. The running scene is terminated.<br>
---* ONLY call it if there is a running scene.<br>
---* js NA
---@param scene cc.Scene
---@return self
function Director:replaceScene (scene) end
---*  Sets the FPS value. FPS = 1/interval. 
---@param interval float
---@return self
function Director:setAnimationInterval (interval) end
---*  Gets the ActionManager associated with this director.<br>
---* since v2.0
---@return cc.ActionManager
function Director:getActionManager () end
---* Returns a shared instance of the director. <br>
---* js _getInstance
---@return self
function Director:getInstance () end