You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DefoldDocs/api/gui.lua
+13-75Lines changed: 13 additions & 75 deletions
Original file line number
Diff line number
Diff line change
@@ -225,10 +225,6 @@ function gui.cancel_animation(node, property) end
225
225
---@paramnodenode node cancel flipbook animation for
226
226
functiongui.cancel_flipbook(node) end
227
227
228
-
---cancel a spine animation
229
-
---@paramnodenode spine node that should cancel its animation
230
-
functiongui.cancel_spine(node) end
231
-
232
228
---Make a clone instance of a node.
233
229
---This function does not clone the supplied node's children nodes.
234
230
---Use gui.clone_tree for that purpose.
@@ -447,7 +443,7 @@ function gui.get_size(node) end
447
443
---The size mode defines how the node will adjust itself in size. Automatic
448
444
---size mode alters the node size based on the node's content. Automatic size
449
445
---mode works for Box nodes and Pie nodes which will both adjust their size
450
-
---to match the assigned image. Spine, Particle fx and Text nodes will ignore
446
+
---to match the assigned image. Particle fx and Text nodes will ignore
451
447
---any size mode setting.
452
448
---@paramnodenode node from which to get the size mode (node)
453
449
---@returnconstant the current size mode
@@ -458,40 +454,6 @@ function gui.get_size_mode(node) end
458
454
---@returnvector4 configuration values
459
455
functiongui.get_slice9(node) end
460
456
461
-
---Gets the playing animation on a spine node
462
-
---@paramnodenode node to get spine skin from
463
-
---@returnhash spine animation id, 0 if no animation is playing
464
-
functiongui.get_spine_animation(node) end
465
-
466
-
---The returned node can be used for parenting and transform queries.
467
-
---This function has complexity O(n), where n is the number of bones in the spine model skeleton.
468
-
---@paramnodenode spine node to query for bone node
469
-
---@parambone_idstring|hash id of the corresponding bone
470
-
---@returnnode node corresponding to the spine bone
471
-
functiongui.get_spine_bone(node, bone_id) end
472
-
473
-
---This is only useful for spine nodes. Gets the normalized cursor of the animation on a spine node.
474
-
---@paramnodenode spine node to get the cursor for (node)
475
-
---@returnvalue number cursor value
476
-
functiongui.get_spine_cursor(node) end
477
-
478
-
---This is only useful for spine nodes. Gets the playback rate of the animation on a spine node.
479
-
---@paramnodenode spine node to set the cursor for
480
-
---@returnnumber playback rate
481
-
functiongui.get_spine_playback_rate(node) end
482
-
483
-
---Returns the spine scene id of the supplied node.
484
-
---This is currently only useful for spine nodes.
485
-
---The returned spine scene must be mapped to the gui scene in the gui editor.
486
-
---@paramnodenode node to get texture from
487
-
---@returnhash spine scene id
488
-
functiongui.get_spine_scene(node) end
489
-
490
-
---Gets the spine skin of a spine node
491
-
---@paramnodenode node to get spine skin from
492
-
---@returnhash spine skin id, 0 if no explicit skin is set
493
-
functiongui.get_spine_skin(node) end
494
-
495
457
---Returns the text value of a text node. This is only useful for text nodes.
496
458
---@paramnodenode node from which to get the text
497
459
---@returnstring text value
@@ -565,12 +527,6 @@ function gui.new_particlefx_node(pos, particlefx) end
565
527
---@returnnode new pie node
566
528
functiongui.new_pie_node(pos, size) end
567
529
568
-
---Dynamically create a new spine node.
569
-
---@paramposvector3|vector4 node position
570
-
---@paramspine_scenestring|hash spine scene id
571
-
---@returnnode new spine node
572
-
functiongui.new_spine_node(pos, spine_scene) end
573
-
574
530
---Dynamically create a new text node.
575
531
---@paramposvector3|vector4 node position
576
532
---@paramtextstring node text
@@ -610,14 +566,6 @@ function gui.play_flipbook(node, animation, complete_function, play_properties)
610
566
---@paramemitter_state_functionfunction(self, node, emitter, state) optional callback function that will be called when an emitter attached to this particlefx changes state.
611
567
functiongui.play_particlefx(node, emitter_state_function) end
612
568
613
-
---Starts a spine animation.
614
-
---@paramnodenode spine node that should play the animation
615
-
---@paramanimation_idstring|hash id of the animation to play
616
-
---@paramplaybackconstant playback mode
617
-
---@paramplay_propertiestable optional table with properties
618
-
---@paramcomplete_functionfunction(self, node) function to call when the animation has completed
619
-
functiongui.play_spine_anim(node, animation_id, playback, play_properties, complete_function) end
620
-
621
569
---Resets the input context of keyboard. This will clear marked text.
622
570
functiongui.reset_keyboard() end
623
571
@@ -626,6 +574,12 @@ function gui.reset_keyboard() end
626
574
---Nodes that are created dynamically from script are not affected.
627
575
functiongui.reset_nodes() end
628
576
577
+
---Convert the screen position to the local position of supplied node
578
+
---@paramnodenode node used for getting local transformation matrix
579
+
---@paramscreen_positionvector3 screen position
580
+
---@returnvector3 local position
581
+
functiongui.screen_to_local(node, screen_position) end
582
+
629
583
---Sets the adjust mode on a node.
630
584
---The adjust mode defines how the node will adjust itself to screen
631
585
---resolutions that differs from the one in the project settings.
@@ -792,6 +746,11 @@ function gui.set_rotation(node, rotation) end
792
746
---@paramscalevector3|vector4 new scale
793
747
functiongui.set_scale(node, scale) end
794
748
749
+
---Set the screen position to the supplied node
750
+
---@paramnodenode node to set the screen position to
751
+
---@paramscreen_positionvector3 screen position
752
+
functiongui.set_screen_position(node, screen_position) end
753
+
795
754
---Sets the shadow color of the supplied node.
796
755
---See gui.set_color <> for info how vectors encode color values.
797
756
---@paramnodenode node to set the shadow color for
@@ -808,7 +767,7 @@ function gui.set_size(node, size) end
808
767
---The size mode defines how the node will adjust itself in size. Automatic
809
768
---size mode alters the node size based on the node's content. Automatic size
810
769
---mode works for Box nodes and Pie nodes which will both adjust their size
811
-
---to match the assigned image. Spine, Particle fx and Text nodes will ignore
770
+
---to match the assigned image. Particle fx and Text nodes will ignore
812
771
---any size mode setting.
813
772
---@paramnodenode node to set size mode for
814
773
---@paramsize_modeconstant size mode to set
@@ -819,27 +778,6 @@ function gui.set_size_mode(node, size_mode) end
819
778
---@paramvaluesvector4 new values
820
779
functiongui.set_slice9(node, values) end
821
780
822
-
---This is only useful for spine nodes. The cursor is normalized.
823
-
---@paramnodenode spine node to set the cursor for
824
-
---@paramcursornumber cursor value
825
-
functiongui.set_spine_cursor(node, cursor) end
826
-
827
-
---This is only useful for spine nodes. Sets the playback rate of the animation on a spine node. Must be positive.
828
-
---@paramnodenode spine node to set the cursor for
829
-
---@paramplayback_ratenumber playback rate
830
-
functiongui.set_spine_playback_rate(node, playback_rate) end
831
-
832
-
---Set the spine scene on a spine node. The spine scene must be mapped to the gui scene in the gui editor.
833
-
---@paramnodenode node to set spine scene for
834
-
---@paramspine_scenestring|hash spine scene id
835
-
functiongui.set_spine_scene(node, spine_scene) end
836
-
837
-
---Sets the spine skin on a spine node.
838
-
---@paramnodenode node to set the spine skin on
839
-
---@paramspine_skinstring|hash spine skin id
840
-
---@paramspine_slotstring|hash optional slot id to only change a specific slot
841
-
functiongui.set_spine_skin(node, spine_skin, spine_slot) end
842
-
843
781
---Set the text value of a text node. This is only useful for text nodes.
0 commit comments