@ts-defold/types 1.2.41 → 1.2.42
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.
- package/index.d.ts +509 -6
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// <reference types="lua-types/5.1" />
|
|
3
3
|
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
4
4
|
|
|
5
|
-
// DEFOLD. stable version 1.
|
|
5
|
+
// DEFOLD. stable version 1.8.0 (ef07c036b8f7d34f4b1d7fcc355ce46a92d2dcc8)
|
|
6
6
|
// =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
|
|
7
7
|
|
|
8
8
|
|
|
@@ -223,6 +223,338 @@ declare namespace socket {
|
|
|
223
223
|
// =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
|
|
224
224
|
|
|
225
225
|
|
|
226
|
+
declare namespace b2d {
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Get the Box2D body from a collision object
|
|
230
|
+
* @param url the url to the game object collision component
|
|
231
|
+
* @return body the body if successful. Otherwise `nil`.
|
|
232
|
+
*/
|
|
233
|
+
export function get_body(url: url): any
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Get the Box2D world from the current collection
|
|
237
|
+
* @return world the world if successful. Otherwise `nil`.
|
|
238
|
+
*/
|
|
239
|
+
export function get_world(): any
|
|
240
|
+
|
|
241
|
+
}
|
|
242
|
+
// =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
declare namespace b2d.body {
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Dynamic body
|
|
249
|
+
*/
|
|
250
|
+
export let B2_DYNAMIC_BODY: any
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Kinematic body
|
|
254
|
+
*/
|
|
255
|
+
export let B2_KINEMATIC_BODY: any
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Static (immovable) body
|
|
259
|
+
*/
|
|
260
|
+
export let B2_STATIC_BODY: any
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Apply an angular impulse.
|
|
264
|
+
* @param impulse impulse the angular impulse in units of kg*m*m/s
|
|
265
|
+
*/
|
|
266
|
+
export function apply_angular_impulse(impulse: number): void
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Apply a force at a world point. If the force is not
|
|
270
|
+
* applied at the center of mass, it will generate a torque and
|
|
271
|
+
* affect the angular velocity. This wakes up the body.
|
|
272
|
+
* @param force the world force vector, usually in Newtons (N).
|
|
273
|
+
* @param point the world position of the point of application.
|
|
274
|
+
*/
|
|
275
|
+
export function apply_force(force: vmath.vector3, point: vmath.vector3): void
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Apply a force to the center of mass. This wakes up the body.
|
|
279
|
+
* @param force the world force vector, usually in Newtons (N).
|
|
280
|
+
*/
|
|
281
|
+
export function apply_force_to_center(force: vmath.vector3): void
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Apply an impulse at a point. This immediately modifies the velocity.
|
|
285
|
+
* It also modifies the angular velocity if the point of application
|
|
286
|
+
* is not at the center of mass. This wakes up the body.
|
|
287
|
+
* @param impulse the world impulse vector, usually in N-seconds or kg-m/s.
|
|
288
|
+
* @param point the world position of the point of application.
|
|
289
|
+
*/
|
|
290
|
+
export function apply_linear_impulse(impulse: vmath.vector3, point: vmath.vector3): void
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Apply a torque. This affects the angular velocity
|
|
294
|
+
* without affecting the linear velocity of the center of mass.
|
|
295
|
+
* This wakes up the body.
|
|
296
|
+
* @param torque torque about the z-axis (out of the screen), usually in N-m.
|
|
297
|
+
*/
|
|
298
|
+
export function apply_torque(torque: number): void
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Print the body representation to the log output
|
|
302
|
+
*/
|
|
303
|
+
export function dump(): void
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Get the angular damping of the body.
|
|
307
|
+
* @return damping the damping
|
|
308
|
+
*/
|
|
309
|
+
export function get_angular_damping(): number
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Set the angular velocity.
|
|
313
|
+
* @param omega the new angular velocity in radians/second.
|
|
314
|
+
*/
|
|
315
|
+
export function get_angular_velocity(omega: number): void
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Get the angular velocity.
|
|
319
|
+
* @return velocity the angular velocity in radians/second.
|
|
320
|
+
*/
|
|
321
|
+
export function get_angular_velocity(): number
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Get the gravity scale of the body.
|
|
325
|
+
* @return scale the scale
|
|
326
|
+
*/
|
|
327
|
+
export function get_gravity_scale(): number
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Get the rotational inertia of the body about the local origin.
|
|
331
|
+
* @return inertia the rotational inertia, usually in kg-m^2.
|
|
332
|
+
*/
|
|
333
|
+
export function get_inertia(): number
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Get the linear damping of the body.
|
|
337
|
+
* @return damping the damping
|
|
338
|
+
*/
|
|
339
|
+
export function get_linear_damping(): number
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Get the linear velocity of the center of mass.
|
|
343
|
+
* @return velocity the linear velocity of the center of mass.
|
|
344
|
+
*/
|
|
345
|
+
export function get_linear_velocity(): vmath.vector3
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Get the world linear velocity of a world point attached to this body.
|
|
349
|
+
* @param world_point a point in world coordinates.
|
|
350
|
+
* @return velocity the world velocity of a point.
|
|
351
|
+
*/
|
|
352
|
+
export function get_linear_velocity_from_world_point(world_point: vmath.vector3): vmath.vector3
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Get the world velocity of a local point.
|
|
356
|
+
* @param world_point a point in local coordinates.
|
|
357
|
+
* @return velocity the world velocity of a point.
|
|
358
|
+
*/
|
|
359
|
+
export function get_linear_velocity_from_world_point(world_point: vmath.vector3): vmath.vector3
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Get the local position of the center of mass.
|
|
363
|
+
* @return center Get the local position of the center of mass.
|
|
364
|
+
*/
|
|
365
|
+
export function get_local_center(): vmath.vector3
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Gets a local point relative to the body's origin given a world point.
|
|
369
|
+
* @param world_point a point in world coordinates.
|
|
370
|
+
* @return vector the corresponding local point relative to the body's origin.
|
|
371
|
+
*/
|
|
372
|
+
export function get_local_point(world_point: vmath.vector3): vmath.vector3
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Gets a local vector given a world vector.
|
|
376
|
+
* @param world_vector a vector in world coordinates.
|
|
377
|
+
* @return vector the corresponding local vector.
|
|
378
|
+
*/
|
|
379
|
+
export function get_local_vector(world_vector: vmath.vector3): vmath.vector3
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Get the total mass of the body.
|
|
383
|
+
* @return mass the mass, usually in kilograms (kg).
|
|
384
|
+
*/
|
|
385
|
+
export function get_mass(): number
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Get the next body in the world's body list.
|
|
389
|
+
* @return body the next body
|
|
390
|
+
*/
|
|
391
|
+
export function get_next(): any
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Get the world body origin position.
|
|
395
|
+
* @return position the world position of the body's origin.
|
|
396
|
+
*/
|
|
397
|
+
export function get_position(): vmath.vector3
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Get the type of this body.
|
|
401
|
+
* @return type the body type
|
|
402
|
+
*/
|
|
403
|
+
export function get_type(): any
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Get the parent world of this body.
|
|
407
|
+
* @return world
|
|
408
|
+
*/
|
|
409
|
+
export function get_world(): any
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Get the angle in radians.
|
|
413
|
+
* @return angle the current world rotation angle in radians.
|
|
414
|
+
*/
|
|
415
|
+
export function get_world_center(): number
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Get the world position of the center of mass.
|
|
419
|
+
* @return center Get the world position of the center of mass.
|
|
420
|
+
*/
|
|
421
|
+
export function get_world_center(): vmath.vector3
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Get the world coordinates of a point given the local coordinates.
|
|
425
|
+
* @param local_vector localPoint a point on the body measured relative the the body's origin.
|
|
426
|
+
* @return vector the same point expressed in world coordinates.
|
|
427
|
+
*/
|
|
428
|
+
export function get_world_point(local_vector: vmath.vector3): vmath.vector3
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Get the world coordinates of a vector given the local coordinates.
|
|
432
|
+
* @param local_vector a vector fixed in the body.
|
|
433
|
+
* @return vector the same vector expressed in world coordinates.
|
|
434
|
+
*/
|
|
435
|
+
export function get_world_vector(local_vector: vmath.vector3): vmath.vector3
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Get the active state of the body.
|
|
439
|
+
* @return enabled is the body active
|
|
440
|
+
*/
|
|
441
|
+
export function is_active(): any
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Get the sleeping state of this body.
|
|
445
|
+
* @return enabled true if the body is awake, false if it's sleeping.
|
|
446
|
+
*/
|
|
447
|
+
export function is_awake(): any
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Is this body in bullet mode
|
|
451
|
+
* @return enabled true if the body is in bullet mode
|
|
452
|
+
*/
|
|
453
|
+
export function is_bullet(): any
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Does this body have fixed rotation?
|
|
457
|
+
* @return enabled is the rotation fixed
|
|
458
|
+
*/
|
|
459
|
+
export function is_fixed_rotation(): any
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Is this body allowed to sleep
|
|
463
|
+
* @return enabled true if the body is allowed to sleep
|
|
464
|
+
*/
|
|
465
|
+
export function is_sleeping_allowed(): any
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* This resets the mass properties to the sum of the mass properties of the fixtures.
|
|
469
|
+
* This normally does not need to be called unless you called SetMassData to override
|
|
470
|
+
*/
|
|
471
|
+
export function reset_mass_data(): void
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Set the active state of the body. An inactive body is not
|
|
475
|
+
* simulated and cannot be collided with or woken up.
|
|
476
|
+
* If you pass a flag of true, all fixtures will be added to the
|
|
477
|
+
* broad-phase.
|
|
478
|
+
* If you pass a flag of false, all fixtures will be removed from
|
|
479
|
+
* the broad-phase and all contacts will be destroyed.
|
|
480
|
+
* Fixtures and joints are otherwise unaffected. You may continue
|
|
481
|
+
* to create/destroy fixtures and joints on inactive bodies.
|
|
482
|
+
* Fixtures on an inactive body are implicitly inactive and will
|
|
483
|
+
* not participate in collisions, ray-casts, or queries.
|
|
484
|
+
* Joints connected to an inactive body are implicitly inactive.
|
|
485
|
+
* An inactive body is still owned by a b2World object and remains
|
|
486
|
+
* in the body list.
|
|
487
|
+
* @param enable true if the body should be active
|
|
488
|
+
*/
|
|
489
|
+
export function set_active(enable: any): void
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Set the angular damping of the body.
|
|
493
|
+
* @param damping the damping
|
|
494
|
+
*/
|
|
495
|
+
export function set_angular_damping(damping: number): void
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Set the sleep state of the body. A sleeping body has very low CPU cost.
|
|
499
|
+
* @param enable flag set to false to put body to sleep, true to wake it.
|
|
500
|
+
*/
|
|
501
|
+
export function set_awake(enable: any): void
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Should this body be treated like a bullet for continuous collision detection?
|
|
505
|
+
* @param enable if true, the body will be in bullet mode
|
|
506
|
+
*/
|
|
507
|
+
export function set_bullet(enable: any): void
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Set this body to have fixed rotation. This causes the mass to be reset.
|
|
511
|
+
* @param enable true if the rotation should be fixed
|
|
512
|
+
*/
|
|
513
|
+
export function set_fixed_rotation(enable: any): void
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Set the gravity scale of the body.
|
|
517
|
+
* @param scale the scale
|
|
518
|
+
*/
|
|
519
|
+
export function set_gravity_scale(scale: number): void
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Set the linear damping of the body.
|
|
523
|
+
* @param damping the damping
|
|
524
|
+
*/
|
|
525
|
+
export function set_linear_damping(damping: number): void
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Set the linear velocity of the center of mass.
|
|
529
|
+
* @param velocity the new linear velocity of the center of mass.
|
|
530
|
+
*/
|
|
531
|
+
export function set_linear_velocity(velocity: vmath.vector3): void
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* You can disable sleeping on this body. If you disable sleeping, the body will be woken.
|
|
535
|
+
* @param enable if false, the body will never sleep, and consume more CPU
|
|
536
|
+
*/
|
|
537
|
+
export function set_sleeping_allowed(enable: any): void
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Set the position of the body's origin and rotation.
|
|
541
|
+
* This breaks any contacts and wakes the other bodies.
|
|
542
|
+
* Manipulating a body's transform may cause non-physical behavior.
|
|
543
|
+
* @param position the world position of the body's local origin.
|
|
544
|
+
* @param angle the world position of the body's local origin.
|
|
545
|
+
*/
|
|
546
|
+
export function set_transform(position: vmath.vector3, angle: number): void
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Set the type of this body. This may alter the mass and velocity.
|
|
550
|
+
* @param type the body type
|
|
551
|
+
*/
|
|
552
|
+
export function set_type(type: any): void
|
|
553
|
+
|
|
554
|
+
}
|
|
555
|
+
// =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
|
|
556
|
+
|
|
557
|
+
|
|
226
558
|
declare namespace crash {
|
|
227
559
|
|
|
228
560
|
/**
|
|
@@ -1368,6 +1700,11 @@ declare namespace gui {
|
|
|
1368
1700
|
*/
|
|
1369
1701
|
export let PROP_COLOR: any
|
|
1370
1702
|
|
|
1703
|
+
/**
|
|
1704
|
+
* euler property
|
|
1705
|
+
*/
|
|
1706
|
+
export let PROP_EULER: any
|
|
1707
|
+
|
|
1371
1708
|
/**
|
|
1372
1709
|
* fill_angle property
|
|
1373
1710
|
*/
|
|
@@ -1459,6 +1796,7 @@ declare namespace gui {
|
|
|
1459
1796
|
|
|
1460
1797
|
- `"position"`
|
|
1461
1798
|
- `"rotation"`
|
|
1799
|
+
- `"euler"`
|
|
1462
1800
|
- `"scale"`
|
|
1463
1801
|
- `"color"`
|
|
1464
1802
|
- `"outline"`
|
|
@@ -1472,6 +1810,7 @@ The following property constants are defined equaling the corresponding property
|
|
|
1472
1810
|
|
|
1473
1811
|
- `gui.PROP_POSITION`
|
|
1474
1812
|
- `gui.PROP_ROTATION`
|
|
1813
|
+
- `gui.PROP_EULER`
|
|
1475
1814
|
- `gui.PROP_SCALE`
|
|
1476
1815
|
- `gui.PROP_COLOR`
|
|
1477
1816
|
- `gui.PROP_OUTLINE`
|
|
@@ -1508,6 +1847,7 @@ with a custom curve. See the animation guide for more information.
|
|
|
1508
1847
|
|
|
1509
1848
|
- `"position"`
|
|
1510
1849
|
- `"rotation"`
|
|
1850
|
+
- `"euler"`
|
|
1511
1851
|
- `"scale"`
|
|
1512
1852
|
- `"color"`
|
|
1513
1853
|
- `"outline"`
|
|
@@ -1558,6 +1898,31 @@ with a custom curve. See the animation guide for more information.
|
|
|
1558
1898
|
*/
|
|
1559
1899
|
export function delete_texture(texture: string | hash): void
|
|
1560
1900
|
|
|
1901
|
+
/**
|
|
1902
|
+
* Instead of using specific getters such as gui.get_position or gui.get_scale,
|
|
1903
|
+
* you can use gui.get instead and supply the property as a string or a hash.
|
|
1904
|
+
* While this function is similar to go.get, there are a few more restrictions
|
|
1905
|
+
* when operating in the gui namespace. Most notably, only these propertie identifiers are supported:
|
|
1906
|
+
*
|
|
1907
|
+
* - `"position"`
|
|
1908
|
+
* - `"rotation"`
|
|
1909
|
+
* - `"euler"`
|
|
1910
|
+
* - `"scale"`
|
|
1911
|
+
* - `"color"`
|
|
1912
|
+
* - `"outline"`
|
|
1913
|
+
* - `"shadow"`
|
|
1914
|
+
* - `"size"`
|
|
1915
|
+
* - `"fill_angle"` (pie)
|
|
1916
|
+
* - `"inner_radius"` (pie)
|
|
1917
|
+
* - `"slice9"` (slice9)
|
|
1918
|
+
*
|
|
1919
|
+
* The value returned will either be a vmath.vector4 or a single number, i.e getting the "position"
|
|
1920
|
+
* property will return a vec4 while getting the "position.x" property will return a single value.
|
|
1921
|
+
* @param node node to get the property for
|
|
1922
|
+
* @param property the property to retrieve
|
|
1923
|
+
*/
|
|
1924
|
+
export function get(node: node, property: any): void
|
|
1925
|
+
|
|
1561
1926
|
/**
|
|
1562
1927
|
* Returns the adjust mode of a node.
|
|
1563
1928
|
* The adjust mode defines how the node will adjust itself to screen
|
|
@@ -1652,6 +2017,14 @@ with a custom curve. See the animation guide for more information.
|
|
|
1652
2017
|
*/
|
|
1653
2018
|
export function get_color(node: node): vmath.vector4
|
|
1654
2019
|
|
|
2020
|
+
/**
|
|
2021
|
+
* Returns the rotation of the supplied node.
|
|
2022
|
+
* The rotation is expressed in degree Euler angles.
|
|
2023
|
+
* @param node node to get the rotation from
|
|
2024
|
+
* @return rotation node rotation
|
|
2025
|
+
*/
|
|
2026
|
+
export function get_euler(node: node): vmath.vector3
|
|
2027
|
+
|
|
1655
2028
|
/**
|
|
1656
2029
|
* Returns the sector angle of a pie node.
|
|
1657
2030
|
* @param node node from which to get the fill angle
|
|
@@ -1841,11 +2214,11 @@ with a custom curve. See the animation guide for more information.
|
|
|
1841
2214
|
|
|
1842
2215
|
/**
|
|
1843
2216
|
* Returns the rotation of the supplied node.
|
|
1844
|
-
* The rotation is expressed
|
|
2217
|
+
* The rotation is expressed as a quaternion
|
|
1845
2218
|
* @param node node to get the rotation from
|
|
1846
2219
|
* @return rotation node rotation
|
|
1847
2220
|
*/
|
|
1848
|
-
export function get_rotation(node: node): vmath.
|
|
2221
|
+
export function get_rotation(node: node): vmath.quaternion
|
|
1849
2222
|
|
|
1850
2223
|
/**
|
|
1851
2224
|
* Returns the scale of the supplied node.
|
|
@@ -2137,6 +2510,36 @@ the new state of the emitter:
|
|
|
2137
2510
|
*/
|
|
2138
2511
|
export function screen_to_local(node: node, screen_position: vmath.vector3): vmath.vector3
|
|
2139
2512
|
|
|
2513
|
+
/**
|
|
2514
|
+
* Instead of using specific setteres such as gui.set_position or gui.set_scale,
|
|
2515
|
+
* you can use gui.set instead and supply the property as a string or a hash.
|
|
2516
|
+
* While this function is similar to go.get and go.set, there are a few more restrictions
|
|
2517
|
+
* when operating in the gui namespace. Most notably, only these propertie identifiers are supported:
|
|
2518
|
+
*
|
|
2519
|
+
* - `"position"`
|
|
2520
|
+
* - `"rotation"`
|
|
2521
|
+
* - `"euler"`
|
|
2522
|
+
* - `"scale"`
|
|
2523
|
+
* - `"color"`
|
|
2524
|
+
* - `"outline"`
|
|
2525
|
+
* - `"shadow"`
|
|
2526
|
+
* - `"size"`
|
|
2527
|
+
* - `"fill_angle"` (pie)
|
|
2528
|
+
* - `"inner_radius"` (pie)
|
|
2529
|
+
* - `"slice9"` (slice9)
|
|
2530
|
+
*
|
|
2531
|
+
* The value to set must either be a vmath.vector4, vmath.vector3, vmath.quat or a single number and depends on the property name you want to set.
|
|
2532
|
+
* I.e when setting the "position" property, you need to use a vmath.vector4 and when setting a single component of the property,
|
|
2533
|
+
* such as "position.x", you need to use a single value.
|
|
2534
|
+
* Note: When setting the rotation using the "rotation" property, you need to pass in a vmath.quat. This behaviour is different than from the gui.set_rotation function,
|
|
2535
|
+
* the intention is to move new functionality closer to go namespace so that migrating between gui and go is easier. To set the rotation using degrees instead,
|
|
2536
|
+
* use the "euler" property instead. The rotation and euler properties are linked, changing one of them will change the backing data of the other.
|
|
2537
|
+
* @param node node to set the property for
|
|
2538
|
+
* @param property the property to set
|
|
2539
|
+
* @param value the property to set
|
|
2540
|
+
*/
|
|
2541
|
+
export function set(node: node, property: any, value: number | vmath.vector4 | vmath.vector3 | vmath.quaternion): void
|
|
2542
|
+
|
|
2140
2543
|
/**
|
|
2141
2544
|
* Sets the adjust mode on a node.
|
|
2142
2545
|
* The adjust mode defines how the node will adjust itself to screen
|
|
@@ -2240,6 +2643,14 @@ the new state of the emitter:
|
|
|
2240
2643
|
*/
|
|
2241
2644
|
export function set_enabled(node: node, enabled: boolean): void
|
|
2242
2645
|
|
|
2646
|
+
/**
|
|
2647
|
+
* Sets the rotation of the supplied node.
|
|
2648
|
+
* The rotation is expressed in degree Euler angles.
|
|
2649
|
+
* @param node node to set the rotation for
|
|
2650
|
+
* @param rotation new rotation
|
|
2651
|
+
*/
|
|
2652
|
+
export function set_euler(node: node, rotation: vmath.vector3 | vmath.vector4): void
|
|
2653
|
+
|
|
2243
2654
|
/**
|
|
2244
2655
|
* Set the sector angle of a pie node.
|
|
2245
2656
|
* @param node node to set the fill angle for
|
|
@@ -2406,11 +2817,11 @@ the new state of the emitter:
|
|
|
2406
2817
|
|
|
2407
2818
|
/**
|
|
2408
2819
|
* Sets the rotation of the supplied node.
|
|
2409
|
-
* The rotation is expressed
|
|
2820
|
+
* The rotation is expressed as a quaternion
|
|
2410
2821
|
* @param node node to set the rotation for
|
|
2411
2822
|
* @param rotation new rotation
|
|
2412
2823
|
*/
|
|
2413
|
-
export function set_rotation(node: node, rotation: vmath.
|
|
2824
|
+
export function set_rotation(node: node, rotation: vmath.quaternion | vmath.vector4): void
|
|
2414
2825
|
|
|
2415
2826
|
/**
|
|
2416
2827
|
* Sets the scaling of the supplied node.
|
|
@@ -4341,7 +4752,7 @@ declare namespace resource {
|
|
|
4341
4752
|
* Note that releasing a resource essentially means decreasing the reference count of that resource,
|
|
4342
4753
|
* and not necessarily that it will be deleted.
|
|
4343
4754
|
* @param path The path to the resource.
|
|
4344
|
-
* @param table A table containing info about how to create the
|
|
4755
|
+
* @param table A table containing info about how to create the atlas. Supported entries:
|
|
4345
4756
|
|
|
4346
4757
|
|
|
4347
4758
|
|
|
@@ -4417,6 +4828,12 @@ A list of the geometries that should map to the texture data. Supports the follo
|
|
|
4417
4828
|
|
|
4418
4829
|
|
|
4419
4830
|
|
|
4831
|
+
`id`
|
|
4832
|
+
The name of the geometry. Used when matching animations between multiple atlases
|
|
4833
|
+
|
|
4834
|
+
|
|
4835
|
+
|
|
4836
|
+
|
|
4420
4837
|
`vertices`
|
|
4421
4838
|
a list of the vertices in texture space of the geometry in the form {px0, py0, px1, py1, ..., pxn, pyn}
|
|
4422
4839
|
|
|
@@ -4542,6 +4959,85 @@ Creating an empty texture with no buffer data is not supported as a core feature
|
|
|
4542
4959
|
*/
|
|
4543
4960
|
export function create_texture(path: string, table: any, buffer?: buffer): hash
|
|
4544
4961
|
|
|
4962
|
+
/**
|
|
4963
|
+
* Creates a new texture resource that can be used in the same way as any texture created during build time.
|
|
4964
|
+
* The path used for creating the texture must be unique, trying to create a resource at a path that is already
|
|
4965
|
+
* registered will trigger an error. If the intention is to instead modify an existing texture, use the resource.set_texture
|
|
4966
|
+
* function. Also note that the path to the new texture resource must have a '.texturec' extension,
|
|
4967
|
+
* meaning "/path/my_texture" is not a valid path but "/path/my_texture.texturec" is.
|
|
4968
|
+
* If the texture is created without a buffer, the pixel data will be blank.
|
|
4969
|
+
* The difference between the async version and resource.create_texture is that the texture data will be uploaded
|
|
4970
|
+
* in a graphics worker thread. The function will return a resource immediately that contains a 1x1 blank texture which can be used
|
|
4971
|
+
* immediately after the function call. When the new texture has been uploaded, the initial blank texture will be deleted and replaced with the
|
|
4972
|
+
* new texture. Be careful when using the initial texture handle handle as it will not be valid after the upload has finished.
|
|
4973
|
+
* @param path The path to the resource.
|
|
4974
|
+
* @param table
|
|
4975
|
+
A table containing info about how to create the texture. Supported entries:
|
|
4976
|
+
`type`
|
|
4977
|
+
The texture type. Supported values:
|
|
4978
|
+
|
|
4979
|
+
|
|
4980
|
+
- `resource.TEXTURE_TYPE_2D`
|
|
4981
|
+
- `resource.TEXTURE_TYPE_CUBE_MAP`
|
|
4982
|
+
|
|
4983
|
+
|
|
4984
|
+
`width`
|
|
4985
|
+
The width of the texture (in pixels). Must be larger than 0.
|
|
4986
|
+
`height`
|
|
4987
|
+
The width of the texture (in pixels). Must be larger than 0.
|
|
4988
|
+
`format`
|
|
4989
|
+
The texture format, note that some of these formats might not be supported by the running device. Supported values:
|
|
4990
|
+
|
|
4991
|
+
|
|
4992
|
+
- `resource.TEXTURE_FORMAT_LUMINANCE`
|
|
4993
|
+
- `resource.TEXTURE_FORMAT_RGB`
|
|
4994
|
+
- `resource.TEXTURE_FORMAT_RGBA`
|
|
4995
|
+
|
|
4996
|
+
These constants might not be available on the device:
|
|
4997
|
+
|
|
4998
|
+
- `resource.TEXTURE_FORMAT_RGB_PVRTC_2BPPV1`
|
|
4999
|
+
- `resource.TEXTURE_FORMAT_RGB_PVRTC_4BPPV1`
|
|
5000
|
+
- `resource.TEXTURE_FORMAT_RGBA_PVRTC_2BPPV1`
|
|
5001
|
+
- `resource.TEXTURE_FORMAT_RGBA_PVRTC_4BPPV1`
|
|
5002
|
+
- `resource.TEXTURE_FORMAT_RGB_ETC1`
|
|
5003
|
+
- `resource.TEXTURE_FORMAT_RGBA_ETC2`
|
|
5004
|
+
- `resource.TEXTURE_FORMAT_RGBA_ASTC_4x4`
|
|
5005
|
+
- `resource.TEXTURE_FORMAT_RGB_BC1`
|
|
5006
|
+
- `resource.TEXTURE_FORMAT_RGBA_BC3`
|
|
5007
|
+
- `resource.TEXTURE_FORMAT_R_BC4`
|
|
5008
|
+
- `resource.TEXTURE_FORMAT_RG_BC5`
|
|
5009
|
+
- `resource.TEXTURE_FORMAT_RGBA_BC7`
|
|
5010
|
+
- `resource.TEXTURE_FORMAT_RGB16F`
|
|
5011
|
+
- `resource.TEXTURE_FORMAT_RGB32F`
|
|
5012
|
+
- `resource.TEXTURE_FORMAT_RGBA16F`
|
|
5013
|
+
- `resource.TEXTURE_FORMAT_RGBA32F`
|
|
5014
|
+
- `resource.TEXTURE_FORMAT_R16F`
|
|
5015
|
+
- `resource.TEXTURE_FORMAT_RG16F`
|
|
5016
|
+
- `resource.TEXTURE_FORMAT_R32F`
|
|
5017
|
+
- `resource.TEXTURE_FORMAT_RG32F`
|
|
5018
|
+
|
|
5019
|
+
You can test if the device supports these values by checking if a specific enum is nil or not:
|
|
5020
|
+
`if resource.TEXTURE_FORMAT_RGBA16F ~= nil then
|
|
5021
|
+
-- it is safe to use this format
|
|
5022
|
+
end
|
|
5023
|
+
`
|
|
5024
|
+
|
|
5025
|
+
|
|
5026
|
+
`max_mipmaps`
|
|
5027
|
+
optional max number of mipmaps. Defaults to zero, i.e no mipmap support
|
|
5028
|
+
`compression_type`
|
|
5029
|
+
optional specify the compression type for the data in the buffer object that holds the texture data. Will only be used when a compressed buffer has been passed into the function.
|
|
5030
|
+
Creating an empty texture with no buffer data is not supported as a core feature. Defaults to resource.COMPRESSION_TYPE_DEFAULT, i.e no compression. Supported values:
|
|
5031
|
+
|
|
5032
|
+
|
|
5033
|
+
- `COMPRESSION_TYPE_DEFAULT`
|
|
5034
|
+
- `COMPRESSION_TYPE_BASIS_UASTC`
|
|
5035
|
+
|
|
5036
|
+
* @param buffer optional buffer of precreated pixel data
|
|
5037
|
+
* @return path_ The path to the resource and the request id for the async request.
|
|
5038
|
+
*/
|
|
5039
|
+
export function create_texture_async(path: string, table: any, buffer?: buffer): any
|
|
5040
|
+
|
|
4545
5041
|
/**
|
|
4546
5042
|
* Constructor-like function with two purposes:
|
|
4547
5043
|
*
|
|
@@ -7381,6 +7877,13 @@ declare namespace sprite {
|
|
|
7381
7877
|
*/
|
|
7382
7878
|
export let size: any
|
|
7383
7879
|
|
|
7880
|
+
/**
|
|
7881
|
+
* The slice values of the sprite. The type of the property is a vector4 that corresponds to
|
|
7882
|
+
* the left, top, right, bottom values of the sprite in the editor.
|
|
7883
|
+
* It is not possible to set the slice property if the size mode of the sprite is set to auto.
|
|
7884
|
+
*/
|
|
7885
|
+
export let slice: any
|
|
7886
|
+
|
|
7384
7887
|
/**
|
|
7385
7888
|
* Play an animation on a sprite component from its tile set
|
|
7386
7889
|
* An optional completion callback function can be provided that will be called when
|