forked from dasannikov/DefoldTypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
defold.d.ts
4693 lines (3885 loc) · 160 KB
/
defold.d.ts
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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// DEFOLD. Version 1.2.134
///////////////////////////////////////////////////////////////////////////////
declare namespace crash {
let SYSFIELD_ANDROID_BUILD_FINGERPRINT: any
let SYSFIELD_DEVICE_LANGUAGE: any
let SYSFIELD_DEVICE_MANUFACTURER: any
let SYSFIELD_DEVICE_MODEL: any
let SYSFIELD_ENGINE_HASH: any
let SYSFIELD_ENGINE_VERSION: any
let SYSFIELD_LANGUAGE: any
let SYSFIELD_SYSTEM_NAME: any
let SYSFIELD_SYSTEM_VERSION: any
let SYSFIELD_TERRITORY: any
/**
A table is returned containing the addresses of the call stack.
@param handle number crash dump handle
@return table table containing the backtrace
**/
function get_backtrace(handle: number): any
/**
The format of read text blob is platform specific
and not guaranteed
but can be useful for manual inspection.
@param handle number crash dump handle
@return string string with the platform specific data
**/
function get_extra_data(handle: number): string
/**
The function returns a table containing entries with sub-tables that
have fields 'name' and 'address' set for all loaded modules.
@param handle number crash dump handle
@return table module table
**/
function get_modules(handle: number): any
/**
@param handle number crash dump handle
@return number signal number
**/
function get_signum(handle: number): number
/**
@param handle number crash dump handle
@param index number system field enum
@return string value recorded in the crash dump
**/
function get_sys_field(handle: number, index: number): string
/**
@param handle number crash dump handle
@param index number user data slot index
@return string user data value recorded in the crash dump
**/
function get_user_field(handle: number, index: number): string
/**
The crash dump will be removed from disk upon a successful
load, so loading is one-shot.
@return number handle to the loaded dump, or nil if no dump was found
**/
function load_previous(): number
/**
@param handle number handle to loaded crash dump
**/
function release(handle: number): void
/**
Crashes occuring before the path is set will be stored to a default engine location.
@param path string file path to use
**/
function set_file_path(path: string): void
/**
Store a user value that will get written to a crash dump when
a crash occurs. This can be user id:s, breadcrumb data etc.
There are 32 slots indexed from 0. Each slot stores at most 255 characters.
@param index number slot index. 0-indexed
@param value string string value to store
**/
function set_user_field(index: number, value: string): void
/**
Performs the same steps as if a crash had just occured but
allows the program to continue.
The generated dump can be read by crash.load_previous
**/
function write_dump(): void
}
declare namespace gui {
let ADJUST_FIT: any
let ADJUST_STRETCH: any
let ADJUST_ZOOM: any
let ANCHOR_BOTTOM: any
let ANCHOR_LEFT: any
let ANCHOR_RIGHT: any
let ANCHOR_TOP: any
let BLEND_ADD: any
let BLEND_ADD_ALPHA: any
let BLEND_ALPHA: any
let BLEND_MULT: any
let CLIPPING_MODE_NONE: any
let CLIPPING_MODE_STENCIL: any
let EASING_INBACK: any
let EASING_INBOUNCE: any
let EASING_INCIRC: any
let EASING_INCUBIC: any
let EASING_INELASTIC: any
let EASING_INEXPO: any
let EASING_INOUTBACK: any
let EASING_INOUTBOUNCE: any
let EASING_INOUTCIRC: any
let EASING_INOUTCUBIC: any
let EASING_INOUTELASTIC: any
let EASING_INOUTEXPO: any
let EASING_INOUTQUAD: any
let EASING_INOUTQUART: any
let EASING_INOUTQUINT: any
let EASING_INOUTSINE: any
let EASING_INQUAD: any
let EASING_INQUART: any
let EASING_INQUINT: any
let EASING_INSINE: any
let EASING_LINEAR: any
let EASING_OUTBACK: any
let EASING_OUTBOUNCE: any
let EASING_OUTCIRC: any
let EASING_OUTCUBIC: any
let EASING_OUTELASTIC: any
let EASING_OUTEXPO: any
let EASING_OUTINBACK: any
let EASING_OUTINBOUNCE: any
let EASING_OUTINCIRC: any
let EASING_OUTINCUBIC: any
let EASING_OUTINELASTIC: any
let EASING_OUTINEXPO: any
let EASING_OUTINQUAD: any
let EASING_OUTINQUART: any
let EASING_OUTINQUINT: any
let EASING_OUTINSINE: any
let EASING_OUTQUAD: any
let EASING_OUTQUART: any
let EASING_OUTQUINT: any
let EASING_OUTSINE: any
let KEYBOARD_TYPE_DEFAULT: any
let KEYBOARD_TYPE_EMAIL: any
let KEYBOARD_TYPE_NUMBER_PAD: any
let KEYBOARD_TYPE_PASSWORD: any
let PIEBOUNDS_ELLIPSE: any
let PIEBOUNDS_RECTANGLE: any
let PIVOT_CENTER: any
let PIVOT_E: any
let PIVOT_N: any
let PIVOT_NE: any
let PIVOT_NW: any
let PIVOT_S: any
let PIVOT_SE: any
let PIVOT_SW: any
let PIVOT_W: any
let PLAYBACK_LOOP_BACKWARD: any
let PLAYBACK_LOOP_FORWARD: any
let PLAYBACK_LOOP_PINGPONG: any
let PLAYBACK_ONCE_BACKWARD: any
let PLAYBACK_ONCE_FORWARD: any
let PLAYBACK_ONCE_PINGPONG: any
let PROP_COLOR: any
let PROP_FILL_ANGLE: any
let PROP_INNER_RADIUS: any
let PROP_OUTLINE: any
let PROP_POSITION: any
let PROP_ROTATION: any
let PROP_SCALE: any
let PROP_SHADOW: any
let PROP_SIZE: any
let PROP_SLICE9: any
let SIZE_MODE_AUTO: any
let SIZE_MODE_MANUAL: any
/**
This starts an animation of a node property according to the specified parameters.
If the node property is already being animated, that animation will be canceled and
replaced by the new one. Note however that several different node properties
can be animated simultaneously. Use gui.cancel_animation to stop the animation
before it has completed.
Composite properties of type vector3, vector4 or quaternion
also expose their sub-components (x, y, z and w).
You can address the components individually by suffixing the name with a dot '.'
and the name of the component.
For instance, "position.x" (the position x coordinate) or "color.w"
(the color alpha value).
If a complete_function (Lua function) is specified, that function will be called
when the animation has completed.
By starting a new animation in that function, several animations can be sequenced
together. See the examples below for more information.
@param node node node to animate
@param property string | constant property to animate
"position"
"rotation"
"scale"
"color"
"outline"
"shadow"
"size"
"fill_angle" (pie)
"inner_radius" (pie)
"slice9" (slice9)
The following property constants are defined equaling the corresponding property string names.
gui.PROP_POSITION
gui.PROP_ROTATION
gui.PROP_SCALE
gui.PROP_COLOR
gui.PROP_OUTLINE
gui.PROP_SHADOW
gui.PROP_SIZE
gui.PROP_FILL_ANGLE
gui.PROP_INNER_RADIUS
gui.PROP_SLICE9
@param to vector3 | vector4 target property value
@param easing constant | vector easing to use during animation.
Either specify one of the gui.EASING_* constants or provide a
vector with a custom curve.
@param duration number duration of the animation in seconds.
@param [delay] number delay before the animation starts in seconds.
@param [complete_function] function(self, node) function to call when the
animation has completed
@param [playback] constant playback mode
gui.PLAYBACK_ONCE_FORWARD
gui.PLAYBACK_ONCE_BACKWARD
gui.PLAYBACK_ONCE_PINGPONG
gui.PLAYBACK_LOOP_FORWARD
gui.PLAYBACK_LOOP_BACKWARD
gui.PLAYBACK_LOOP_PINGPONG
**/
function animate(node: node, property: string, to: vmath.vector3 | vmath.vector4, easing: any, duration: number, delay?: number, complete_function?: any, playback?: any): void
/**
If an animation of the specified node is currently running (started by gui.animate), it will immediately be canceled.
@param node node node that should have its animation canceled
@param property string | constant property for which the animation should be canceled
"position"
"rotation"
"scale"
"color"
"outline"
"shadow"
"size"
"fill_angle" (pie)
"inner_radius" (pie)
"slice9" (slice9)
**/
function cancel_animation(node: node, property: string): void
/**
Cancels any running flipbook animation on the specified node.
@param node node node cancel flipbook animation for
**/
function cancel_flipbook(node: node): void
/**
@param node node spine node that should cancel its animation
**/
function cancel_spine(node: node): void
/**
Make a clone instance of a node.
This function does not clone the supplied node's children nodes.
Use gui.clone_tree for that purpose.
@param node node node to clone
@return node the cloned node
**/
function clone(node: node): node
/**
Make a clone instance of a node and all its children.
Use gui.clone to clone a node excluding its children.
@param node node root node to clone
@return table a table mapping node ids to the corresponding cloned nodes
**/
function clone_tree(node: node): any
/**
Deletes the specified node. Any child nodes of the specified node will be
recursively deleted.
@param node node node to delete
**/
function delete_node(node: node): void
/**
Delete a dynamically created texture.
@param texture string | hash texture id
**/
function delete_texture(texture: string | hash): void
/**
Returns the adjust mode of a node.
The adjust mode defines how the node will adjust itself to screen
resolutions that differs from the one in the project settings.
@param node node node from which to get the adjust mode (node)
@return constant the current adjust mode
gui.ADJUST_FIT
gui.ADJUST_ZOOM
gui.ADJUST_STRETCH
**/
function get_adjust_mode(node: node): any
/**
Returns the blend mode of a node.
Blend mode defines how the node will be blended with the background.
@param node node node from which to get the blend mode
@return constant blend mode
gui.BLEND_ALPHA
gui.BLEND_ADD
gui.BLEND_ADD_ALPHA
gui.BLEND_MULT
**/
function get_blend_mode(node: node): any
/**
If node is set as an inverted clipping node, it will clip anything inside as opposed to outside.
@param node node node from which to get the clipping inverted state
@return boolean true or false
**/
function get_clipping_inverted(node: node): boolean
/**
Clipping mode defines how the node will clipping it's children nodes
@param node node node from which to get the clipping mode
@return constant clipping mode
gui.CLIPPING_MODE_NONE
gui.CLIPPING_MODE_STENCIL
**/
function get_clipping_mode(node: node): any
/**
If node is set as visible clipping node, it will be shown as well as clipping. Otherwise, it will only clip but not show visually.
@param node node node from which to get the clipping visibility state
@return boolean true or false
**/
function get_clipping_visible(node: node): boolean
/**
Returns the color of the supplied node. The components
of the returned vector4 contains the color channel values:
Component
Color value
x
Red value
y
Green value
z
Blue value
w
Alpha value
@param node node node to get the color from
@return vector4 node color
**/
function get_color(node: node): vmath.vector4
/**
Returns the sector angle of a pie node.
@param node node node from which to get the fill angle
@return number sector angle
**/
function get_fill_angle(node: node): number
/**
Get node flipbook animation.
@param node node node to get flipbook animation from
@return hash animation id
**/
function get_flipbook(node: node): hash
/**
This is only useful for text nodes. The font must be mapped to the gui scene in the gui editor.
@param node node node from which to get the font
@return hash font id
**/
function get_font(node: node): hash
/**
Returns the scene height.
@return number scene height
**/
function get_height(): number
/**
Retrieves the id of the specified node.
@param node node the node to retrieve the id from
@return hash the id of the node
**/
function get_id(node: node): hash
/**
Retrieve the index of the specified node.
The index defines the order in which a node appear in a GUI scene.
Higher index means the node is drawn on top of lower indexed nodes.
@param node node the node to retrieve the id from
@return number the index of the node
**/
function get_index(node: node): number
/**
@param node node node from which to get the inherit alpha state
**/
function get_inherit_alpha(node: node): void
/**
Returns the inner radius of a pie node.
The radius is defined along the x-axis.
@param node node node from where to get the inner radius
@return number inner radius
**/
function get_inner_radius(node: node): number
/**
The layer must be mapped to the gui scene in the gui editor.
@param node node node from which to get the layer
@return hash layer id
**/
function get_layer(node: node): hash
/**
@return hash layout id
**/
function get_layout(): hash
/**
Returns the leading value for a text node.
@param node node node from where to get the leading
@return number leading scaling value (default=1)
**/
function get_leading(node: node): number
/**
Returns whether a text node is in line-break mode or not.
This is only useful for text nodes.
@param node node node from which to get the line-break for
@return boolean true or false
**/
function get_line_break(node: node): boolean
/**
Retrieves the node with the specified id.
@param id string | hash id of the node to retrieve
@return node a new node instance
**/
function get_node(id: string | hash): node
/**
Returns the outer bounds mode for a pie node.
@param node node node from where to get the outer bounds mode
@return constant the outer bounds mode of the pie node:
gui.PIEBOUNDS_RECTANGLE
gui.PIEBOUNDS_ELLIPSE
**/
function get_outer_bounds(node: node): any
/**
Returns the outline color of the supplied node.
See gui.get_color for info how vectors encode color values.
@param node node node to get the outline color from
@return vector4 outline color
**/
function get_outline(node: node): vmath.vector4
/**
Returns the parent node of the specified node.
If the supplied node does not have a parent, nil is returned.
@param node node the node from which to retrieve its parent
@return node parent instance or nil
**/
function get_parent(node: node): node
/**
Get the paricle fx for a gui node
@param node node node to get particle fx for
@return particle fx id
**/
function get_particlefx(node: node): any
/**
Returns the number of generated vertices around the perimeter
of a pie node.
@param node node pie node
@return number vertex count
**/
function get_perimeter_vertices(node: node): number
/**
The pivot specifies how the node is drawn and rotated from its position.
@param node node node to get pivot from
@return constant pivot constant
gui.PIVOT_CENTER
gui.PIVOT_N
gui.PIVOT_NE
gui.PIVOT_E
gui.PIVOT_SE
gui.PIVOT_S
gui.PIVOT_SW
gui.PIVOT_W
gui.PIVOT_NW
**/
function get_pivot(node: node): any
/**
Returns the position of the supplied node.
@param node node node to get the position from
@return vector3 node position
**/
function get_position(node: node): vmath.vector3
/**
Returns the rotation of the supplied node.
The rotation is expressed in degree Euler angles.
@param node node node to get the rotation from
@return vector3 node rotation
**/
function get_rotation(node: node): vmath.vector3
/**
Returns the scale of the supplied node.
@param node node node to get the scale from
@return vector3 node scale
**/
function get_scale(node: node): vmath.vector3
/**
Returns the screen position of the supplied node. This function returns the
calculated transformed position of the node, taking into account any parent node
transforms.
@param node node node to get the screen position from
@return vector3 node screen position
**/
function get_screen_position(node: node): vmath.vector3
/**
Returns the shadow color of the supplied node.
See gui.get_color for info how vectors encode color values.
@param node node node to get the shadow color from
@return vector4 node shadow color
**/
function get_shadow(node: node): vmath.vector4
/**
Returns the size of the supplied node.
@param node node node to get the size from
@return vector3 node size
**/
function get_size(node: node): vmath.vector3
/**
Returns the size of a node.
The size mode defines how the node will adjust itself in size. Automatic
size mode alters the node size based on the node's content.
@param node node node from which to get the size mode (node)
@return constant the current size mode
gui.SIZE_MODE_MANUAL
gui.SIZE_MODE_AUTO
**/
function get_size_mode(node: node): any
/**
Returns the slice9 configuration values for the node.
@param node node node to manipulate
@return vector4 configuration values
**/
function get_slice9(node: node): vmath.vector4
/**
Gets the playing animation on a spine node
@param node node node to get spine skin from
@return hash spine animation id, 0 if no animation is playing
**/
function get_spine_animation(node: node): hash
/**
The returned node can be used for parenting and transform queries.
This function has complexity O(n), where n is the number of bones in the spine model skeleton.
@param node node spine node to query for bone node
@param bone_id string | hash id of the corresponding bone
@return node node corresponding to the spine bone
**/
function get_spine_bone(node: node, bone_id: string | hash): node
/**
This is only useful for spine nodes. Gets the normalized cursor of the animation on a spine node.
@param node spine node to set the cursor for (node)
@return value number cursor value
**/
function get_spine_cursor(node: node): number
/**
This is only useful for spine nodes. Gets the playback rate of the animation on a spine node.
@param node node spine node to set the cursor for
@return number playback rate
**/
function get_spine_playback_rate(node: node): number
/**
Returns the spine scene id of the supplied node.
This is currently only useful for spine nodes.
The returned spine scene must be mapped to the gui scene in the gui editor.
@param node node node to get texture from
@return hash spine scene id
**/
function get_spine_scene(node: node): hash
/**
Gets the spine skin of a spine node
@param node node node to get spine skin from
@return hash spine skin id, 0 if no explicit skin is set
**/
function get_spine_skin(node: node): hash
/**
Returns the text value of a text node. This is only useful for text nodes.
@param node node node from which to get the text
@return string text value
**/
function get_text(node: node): string
/**
Get text metrics given the provided font, text and parameters.
@param font string | hash font id
@param text string text to measure
@param width number max-width. Use for line-breaks (default=FLT_MAX)
@param line_break boolean true to break lines accordingly to width (default=false)
@param leading number scale value for line spacing (default=1)
@param tracking number scale value for letter spacing (default=0)
@return table a table with the following fields:
width
height
max_ascent
max_descent
**/
function get_text_metrics(font: string | hash, text: string, width: number, line_break: boolean, leading: number, tracking: number): any
/**
Get the text metrics from a text node.
@param node node text node to measure text from
@return table a table with the following fields:
width
height
max_ascent
max_descent
**/
function get_text_metrics_from_node(node: node): any
/**
Returns the texture of a node.
This is currently only useful for box or pie nodes.
The texture must be mapped to the gui scene in the gui editor.
@param node node node to get texture from
@return hash texture id
**/
function get_texture(node: node): hash
/**
Returns the tracking value of a text node.
@param node node node from where to get the tracking
@return number tracking scaling number (default=0)
**/
function get_tracking(node: node): number
/**
Returns the scene width.
@return number scene width
**/
function get_width(): number
/**
The x-anchor specifies how the node is moved when the game is run in a different resolution.
@param node node node to get x-anchor from
@return constant anchor constant
gui.ANCHOR_NONE
gui.ANCHOR_LEFT
gui.ANCHOR_RIGHT
**/
function get_xanchor(node: node): any
/**
The y-anchor specifies how the node is moved when the game is run in a different resolution.
@param node node node to get y-anchor from
@return constant anchor constant
gui.ANCHOR_NONE
gui.ANCHOR_TOP
gui.ANCHOR_BOTTOM
**/
function get_yanchor(node: node): any
/**
Hides the on-display touch keyboard on the device.
**/
function hide_keyboard(): void
/**
Returns true if a node is enabled and false if it's not.
Disabled nodes are not rendered and animations acting on them are not evaluated.
@param node node node to query
@return boolean whether the node is enabled or not
**/
function is_enabled(node: node): boolean
/**
Alters the ordering of the two supplied nodes by moving the first node
above the second.
If the second argument is nil the first node is moved to the top.
@param node node to move
@param node node | nil reference node above which the first node should be moved
**/
function move_above(node: node, node_: node): void
/**
Alters the ordering of the two supplied nodes by moving the first node
below the second.
If the second argument is nil the first node is moved to the bottom.
@param node node to move
@param node node | nil reference node below which the first node should be moved
**/
function move_below(node: node, node_: node): void
/**
Dynamically create a new box node.
@param pos vector3 | vector4 node position
@param size vector3 node size
@return node new box node
**/
function new_box_node(pos: vmath.vector3 | vmath.vector4, size: vmath.vector3): node
/**
Dynamically create a particle fx node.
@param pos vector3 | vector4 node position
@param particlefx hash | string particle fx resource name
@return node new particle fx node
**/
function new_particlefx_node(pos: vmath.vector3 | vmath.vector4, particlefx: string | hash): node
/**
Dynamically create a new pie node.
@param pos vector3 | vector4 node position
@param size vector3 node size
@return node new box node
**/
function new_pie_node(pos: vmath.vector3 | vmath.vector4, size: vmath.vector3): node
/**
Dynamically create a new spine node.
@param pos vector3 | vector4 node position
@param spine_scene string | hash spine scene id
@return node new spine node
**/
function new_spine_node(pos: vmath.vector3 | vmath.vector4, spine_scene: string | hash): node
/**
Dynamically create a new text node.
@param pos vector3 | vector4 node position
@param text string node text
@return node new text node
**/
function new_text_node(pos: vmath.vector3 | vmath.vector4, text: string): node
/**
Dynamically create a new texture.
@param texture string | hash texture id
@param width number texture width
@param height number texture height
@param type string | constant texture type
"rgb" - RGB
"rgba" - RGBA
"l" - LUMINANCE
@param buffer string texture data
@param flip boolean flip texture vertically
@return boolean texture creation was successful
**/
function new_texture(texture: string | hash, width: number, height: number, type: string, buffer: string, flip: boolean): boolean
/**
Tests whether a coordinate is within the bounding box of a
node.
@param node node node to be tested for picking
@param x number x-coordinate (see on_input )
@param y number y-coordinate (see on_input )
@return boolean pick result
**/
function pick_node(node: node, x: number, y: number): boolean
/**
Play flipbook animation on a box or pie node.
The current node texture must contain the animation.
Use this function to set one-frame still images on the node.
@param node node node to set animation for
@param animation string | hash animation id
@param [complete_function] function(self, node) optional function to call when the animation has completed
self
object The current object.
node
node The node that is animated.
**/
function play_flipbook(node: node, animation: string | hash, complete_function?: any): void
/**
Plays the paricle fx for a gui node
@param node node node to play particle fx for
@param [emitter_state_function] function(self, node, emitter, state) optional callback function that will be called when an emitter attached to this particlefx changes state.
self
object The current object
id
hash The id of the particle fx component
emitter
hash The id of the emitter
state
constant the new state of the emitter:
gui.EMITTER_STATE_SLEEPING
gui.EMITTER_STATE_PRESPAWN
gui.EMITTER_STATE_SPAWNING
gui.EMITTER_STATE_POSTSPAWN
**/
function play_particlefx(node: node, emitter_state_function?: any): void
/**
Starts a spine animation.
@param node node spine node that should play the animation
@param animation_id string | hash id of the animation to play
@param playback constant playback mode
gui.PLAYBACK_ONCE_FORWARD
gui.PLAYBACK_ONCE_BACKWARD
gui.PLAYBACK_ONCE_PINGPONG
gui.PLAYBACK_LOOP_FORWARD
gui.PLAYBACK_LOOP_BACKWARD
gui.PLAYBACK_LOOP_PINGPONG
@param [play_properties] table optional table with properties
blend_duration
number The duration of a linear blend between the current and new animation
offset
number The normalized initial value of the animation cursor when the animation starts playing
playback_rate
number The rate with which the animation will be played. Must be positive
@param [complete_function] function(self, node) function to call when the animation has completed
**/
function play_spine_anim(node: node, animation_id: string | hash, playback: any, play_properties?: any, complete_function?: any): void
/**
Resets the input context of keyboard. This will clear marked text.
**/
function reset_keyboard(): void
/**
Resets all nodes in the current GUI scene to their initial state.
The reset only applies to static node loaded from the scene.
Nodes that are created dynamically from script are not affected.
**/
function reset_nodes(): void
/**
Sets the adjust mode on a node.
The adjust mode defines how the node will adjust itself to screen
resolutions that differs from the one in the project settings.
@param node node node to set adjust mode for
@param adjust_mode constant adjust mode to set
gui.ADJUST_FIT
gui.ADJUST_ZOOM
gui.ADJUST_STRETCH
**/
function set_adjust_mode(node: node, adjust_mode: any): void
/**
Set the blend mode of a node.
Blend mode defines how the node will be blended with the background.
@param node node node to set blend mode for
@param blend_mode constant blend mode to set
gui.BLEND_ALPHA
gui.BLEND_ADD
gui.BLEND_ADD_ALPHA
gui.BLEND_MULT
**/
function set_blend_mode(node: node, blend_mode: any): void
/**
If node is set as an inverted clipping node, it will clip anything inside as opposed to outside.
@param node node node to set clipping inverted state for
@param inverted boolean true or false
**/
function set_clipping_inverted(node: node, inverted: boolean): void
/**
Clipping mode defines how the node will clipping it's children nodes
@param node node node to set clipping mode for
@param clipping_mode constant clipping mode to set
gui.CLIPPING_MODE_NONE
gui.CLIPPING_MODE_STENCIL
**/
function set_clipping_mode(node: node, clipping_mode: any): void
/**
If node is set as an visible clipping node, it will be shown as well as clipping. Otherwise, it will only clip but not show visually.
@param node node node to set clipping visibility for
@param visible boolean true or false
**/
function set_clipping_visible(node: node, visible: boolean): void
/**
Sets the color of the supplied node. The components
of the supplied vector3 or vector4 should contain the color channel values:
Component
Color value
x
Red value
y
Green value