@defold-typescript/types 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,9 +26,9 @@ declare global {
26
26
  * color attachments, all buffers will be cleared with the same value.
27
27
  *
28
28
  * @param buffers - table with keys specifying which buffers to clear and values set to clear values. Available keys are:
29
- - `graphics.BUFFER_TYPE_COLOR0_BIT`
30
- - `graphics.BUFFER_TYPE_DEPTH_BIT`
31
- - `graphics.BUFFER_TYPE_STENCIL_BIT`
29
+ * - `graphics.BUFFER_TYPE_COLOR0_BIT`
30
+ * - `graphics.BUFFER_TYPE_DEPTH_BIT`
31
+ * - `graphics.BUFFER_TYPE_STENCIL_BIT`
32
32
  * @example
33
33
  * ```lua
34
34
  * Clear the color buffer and the depth buffer.
@@ -100,12 +100,12 @@ declare global {
100
100
  * Disables a render state.
101
101
  *
102
102
  * @param state - state to disable
103
- - `graphics.STATE_DEPTH_TEST`
104
- - `graphics.STATE_STENCIL_TEST`
105
- - `graphics.STATE_BLEND`
106
- - `graphics.STATE_ALPHA_TEST` ( not available on iOS and Android)
107
- - `graphics.STATE_CULL_FACE`
108
- - `graphics.STATE_POLYGON_OFFSET_FILL`
103
+ * - `graphics.STATE_DEPTH_TEST`
104
+ * - `graphics.STATE_STENCIL_TEST`
105
+ * - `graphics.STATE_BLEND`
106
+ * - `graphics.STATE_ALPHA_TEST` ( not available on iOS and Android)
107
+ * - `graphics.STATE_CULL_FACE`
108
+ * - `graphics.STATE_POLYGON_OFFSET_FILL`
109
109
  * @example
110
110
  * ```lua
111
111
  * Disable face culling when drawing the tile predicate:
@@ -142,8 +142,8 @@ declare global {
142
142
  * @param y - global work group size Y
143
143
  * @param z - global work group size Z
144
144
  * @param options - optional table with properties:
145
- `constants`
146
- constant_buffer optional constants to use while rendering
145
+ * `constants`
146
+ * constant_buffer optional constants to use while rendering
147
147
  * @example
148
148
  * ```lua
149
149
  * function init(self)
@@ -176,16 +176,16 @@ declare global {
176
176
  *
177
177
  * @param predicate - predicate to draw for
178
178
  * @param options - optional table with properties:
179
- `frustum`
180
- matrix4 A frustum matrix used to cull renderable items. (E.g. `local frustum = proj * view`). default=nil
181
- `frustum_planes`
182
- int Determines which sides of the frustum will be used. Default is render.FRUSTUM_PLANES_SIDES.
183
- - render.FRUSTUM_PLANES_SIDES : The left, right, top and bottom sides of the frustum.
184
- - render.FRUSTUM_PLANES_ALL : All 6 sides of the frustum.
185
- `constants`
186
- constant_buffer optional constants to use while rendering
187
- `sort_order`
188
- int How to sort draw order for world-ordered entries. Default uses the renderer's preferred world sorting (back-to-front).
179
+ * `frustum`
180
+ * matrix4 A frustum matrix used to cull renderable items. (E.g. `local frustum = proj * view`). default=nil
181
+ * `frustum_planes`
182
+ * int Determines which sides of the frustum will be used. Default is render.FRUSTUM_PLANES_SIDES.
183
+ * - render.FRUSTUM_PLANES_SIDES : The left, right, top and bottom sides of the frustum.
184
+ * - render.FRUSTUM_PLANES_ALL : All 6 sides of the frustum.
185
+ * `constants`
186
+ * constant_buffer optional constants to use while rendering
187
+ * `sort_order`
188
+ * int How to sort draw order for world-ordered entries. Default uses the renderer's preferred world sorting (back-to-front).
189
189
  * @example
190
190
  * ```lua
191
191
  * function init(self)
@@ -217,12 +217,12 @@ declare global {
217
217
  * Draws all 3d debug graphics such as lines drawn with "draw_line" messages and physics visualization.
218
218
  *
219
219
  * @param options - optional table with properties:
220
- `frustum`
221
- matrix4 A frustum matrix used to cull renderable items. (E.g. `local frustum = proj * view`). May be nil.
222
- `frustum_planes`
223
- int Determines which sides of the frustum will be used. Default is render.FRUSTUM_PLANES_SIDES.
224
- - render.FRUSTUM_PLANES_SIDES : The left, right, top and bottom sides of the frustum.
225
- - render.FRUSTUM_PLANES_ALL : All sides of the frustum.
220
+ * `frustum`
221
+ * matrix4 A frustum matrix used to cull renderable items. (E.g. `local frustum = proj * view`). May be nil.
222
+ * `frustum_planes`
223
+ * int Determines which sides of the frustum will be used. Default is render.FRUSTUM_PLANES_SIDES.
224
+ * - render.FRUSTUM_PLANES_SIDES : The left, right, top and bottom sides of the frustum.
225
+ * - render.FRUSTUM_PLANES_ALL : All sides of the frustum.
226
226
  * @example
227
227
  * ```lua
228
228
  * function update(self, dt)
@@ -252,12 +252,12 @@ declare global {
252
252
  * Enables a particular render state. The state will be enabled until disabled.
253
253
  *
254
254
  * @param state - state to enable
255
- - `graphics.STATE_DEPTH_TEST`
256
- - `graphics.STATE_STENCIL_TEST`
257
- - `graphics.STATE_BLEND`
258
- - `graphics.STATE_ALPHA_TEST` ( not available on iOS and Android)
259
- - `graphics.STATE_CULL_FACE`
260
- - `graphics.STATE_POLYGON_OFFSET_FILL`
255
+ * - `graphics.STATE_DEPTH_TEST`
256
+ * - `graphics.STATE_STENCIL_TEST`
257
+ * - `graphics.STATE_BLEND`
258
+ * - `graphics.STATE_ALPHA_TEST` ( not available on iOS and Android)
259
+ * - `graphics.STATE_CULL_FACE`
260
+ * - `graphics.STATE_POLYGON_OFFSET_FILL`
261
261
  * @example
262
262
  * ```lua
263
263
  * Enable stencil test when drawing the gui predicate, then disable it:
@@ -283,16 +283,16 @@ declare global {
283
283
  * @param binding - texture binding, either by texture unit, string or hash for the sampler name that the texture should be bound to
284
284
  * @param handle_or_name - render target or texture handle that should be bound, or a named resource in the "Render Resource" table in the currently assigned .render file
285
285
  * @param buffer_type - optional buffer type from which to enable the texture. Note that this argument only applies to render targets. Defaults to `graphics.BUFFER_TYPE_COLOR0_BIT`. These values are supported:
286
- - `graphics.BUFFER_TYPE_COLOR0_BIT`
287
- If The render target has been created as depth and/or stencil textures, these buffer types can be used:
288
- - `graphics.BUFFER_TYPE_DEPTH_BIT`
289
- - `graphics.BUFFER_TYPE_STENCIL_BIT`
290
- If the render target has been created with multiple color attachments, these buffer types can be used
291
- to enable those textures as well. Currently 4 color attachments are supported:
292
- - `graphics.BUFFER_TYPE_COLOR0_BIT`
293
- - `graphics.BUFFER_TYPE_COLOR1_BIT`
294
- - `graphics.BUFFER_TYPE_COLOR2_BIT`
295
- - `graphics.BUFFER_TYPE_COLOR3_BIT`
286
+ * - `graphics.BUFFER_TYPE_COLOR0_BIT`
287
+ * If The render target has been created as depth and/or stencil textures, these buffer types can be used:
288
+ * - `graphics.BUFFER_TYPE_DEPTH_BIT`
289
+ * - `graphics.BUFFER_TYPE_STENCIL_BIT`
290
+ * If the render target has been created with multiple color attachments, these buffer types can be used
291
+ * to enable those textures as well. Currently 4 color attachments are supported:
292
+ * - `graphics.BUFFER_TYPE_COLOR0_BIT`
293
+ * - `graphics.BUFFER_TYPE_COLOR1_BIT`
294
+ * - `graphics.BUFFER_TYPE_COLOR2_BIT`
295
+ * - `graphics.BUFFER_TYPE_COLOR3_BIT`
296
296
  * @example
297
297
  * ```lua
298
298
  * function update(self, dt)
@@ -350,9 +350,9 @@ declare global {
350
350
  *
351
351
  * @param render_target - render target from which to retrieve the buffer height
352
352
  * @param buffer_type - which type of buffer to retrieve the height from
353
- - `graphics.BUFFER_TYPE_COLOR0_BIT`
354
- - `graphics.BUFFER_TYPE_DEPTH_BIT`
355
- - `graphics.BUFFER_TYPE_STENCIL_BIT`
353
+ * - `graphics.BUFFER_TYPE_COLOR0_BIT`
354
+ * - `graphics.BUFFER_TYPE_DEPTH_BIT`
355
+ * - `graphics.BUFFER_TYPE_STENCIL_BIT`
356
356
  * @returns the height of the render target buffer texture
357
357
  * @example
358
358
  * ```lua
@@ -368,10 +368,10 @@ declare global {
368
368
  *
369
369
  * @param render_target - render target from which to retrieve the buffer width
370
370
  * @param buffer_type - which type of buffer to retrieve the width from
371
- - `graphics.BUFFER_TYPE_COLOR0_BIT`
372
- - `graphics.BUFFER_TYPE_COLOR[x]_BIT` (x: [0..3], if supported!)
373
- - `graphics.BUFFER_TYPE_DEPTH_BIT`
374
- - `graphics.BUFFER_TYPE_STENCIL_BIT`
371
+ * - `graphics.BUFFER_TYPE_COLOR0_BIT`
372
+ * - `graphics.BUFFER_TYPE_COLOR[x]_BIT` (x: [0..3], if supported!)
373
+ * - `graphics.BUFFER_TYPE_DEPTH_BIT`
374
+ * - `graphics.BUFFER_TYPE_STENCIL_BIT`
375
375
  * @returns the width of the render target buffer texture
376
376
  * @example
377
377
  * ```lua
@@ -631,8 +631,8 @@ declare global {
631
631
  *
632
632
  * @param camera - camera id to use, or nil to reset
633
633
  * @param options - optional table with properties:
634
- `use_frustum`
635
- boolean If true, the renderer will use the cameras view-projection matrix for frustum culling (default: false)
634
+ * `use_frustum`
635
+ * boolean If true, the renderer will use the cameras view-projection matrix for frustum culling (default: false)
636
636
  * @example
637
637
  * ```lua
638
638
  * Set the current camera to be used for rendering
@@ -688,9 +688,9 @@ declare global {
688
688
  * `face_type` is `graphics.FACE_TYPE_BACK`.
689
689
  *
690
690
  * @param face_type - face type
691
- - `graphics.FACE_TYPE_FRONT`
692
- - `graphics.FACE_TYPE_BACK`
693
- - `graphics.FACE_TYPE_FRONT_AND_BACK`
691
+ * - `graphics.FACE_TYPE_FRONT`
692
+ * - `graphics.FACE_TYPE_BACK`
693
+ * - `graphics.FACE_TYPE_FRONT_AND_BACK`
694
694
  * @example
695
695
  * ```lua
696
696
  * How to enable polygon culling and set front face culling:
@@ -744,11 +744,11 @@ declare global {
744
744
  * invalid but can be reloaded.
745
745
  *
746
746
  * @param callback - A callback that receives all render related events.
747
- Pass `nil` if want to remove listener.
748
- `self`
749
- object The render script
750
- `event_type`
751
- string Rendering event. Possible values: `render.CONTEXT_EVENT_CONTEXT_LOST`, `render.CONTEXT_EVENT_CONTEXT_RESTORED`
747
+ * Pass `nil` if want to remove listener.
748
+ * `self`
749
+ * object The render script
750
+ * `event_type`
751
+ * string Rendering event. Possible values: `render.CONTEXT_EVENT_CONTEXT_LOST`, `render.CONTEXT_EVENT_CONTEXT_RESTORED`
752
752
  * @example
753
753
  * ```lua
754
754
  * Set listener and handle render context events.
@@ -812,13 +812,13 @@ declare global {
812
812
  *
813
813
  * @param render_target - render target to set. render.RENDER_TARGET_DEFAULT to set the default render target
814
814
  * @param options - optional table with behaviour parameters
815
- `transient`
816
- table Transient frame buffer types are only valid while the render target is active, i.e becomes undefined when a new target is set by a subsequent call to set_render_target.
817
- Default is all non-transient. Be aware that some hardware uses a combined depth stencil buffer and when this is the case both are considered non-transient if exclusively selected!
818
- A buffer type defined that doesn't exist in the render target is silently ignored.
819
- - `graphics.BUFFER_TYPE_COLOR0_BIT`
820
- - `graphics.BUFFER_TYPE_DEPTH_BIT`
821
- - `graphics.BUFFER_TYPE_STENCIL_BIT`
815
+ * `transient`
816
+ * table Transient frame buffer types are only valid while the render target is active, i.e becomes undefined when a new target is set by a subsequent call to set_render_target.
817
+ * Default is all non-transient. Be aware that some hardware uses a combined depth stencil buffer and when this is the case both are considered non-transient if exclusively selected!
818
+ * A buffer type defined that doesn't exist in the render target is silently ignored.
819
+ * - `graphics.BUFFER_TYPE_COLOR0_BIT`
820
+ * - `graphics.BUFFER_TYPE_DEPTH_BIT`
821
+ * - `graphics.BUFFER_TYPE_STENCIL_BIT`
822
822
  * @example
823
823
  * ```lua
824
824
  * How to set a render target and draw to it and then switch back to the default render target