Skip to content

Commit 4498500

Browse files
committed
[godot] Update API documentation
Refs #3133.
1 parent c13274e commit 4498500

12 files changed

Lines changed: 375 additions & 414 deletions

‎spine-godot/spine_godot/docs/SpineAnimation.xml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
<argument index="3" name="loop" type="bool" />
1818
<argument index="4" name="events" type="Array" />
1919
<argument index="5" name="alpha" type="float" />
20-
<argument index="6" name="blend" type="int" enum="SpineConstant.MixBlend" />
21-
<argument index="7" name="direction" type="int" enum="SpineConstant.MixDirection" />
20+
<argument index="6" name="from_setup" type="bool" />
21+
<argument index="7" name="add" type="bool" />
22+
<argument index="8" name="out" type="bool" />
23+
<argument index="9" name="appliedPose" type="bool" />
2224
<description>
23-
Applies the animation's timelines to the specified skeleton.
25+
Applies the animation's timelines to the specified skeleton. [code]from_setup[/code] controls whether mixing starts from the setup pose. [code]add[/code] controls whether values are added to the current pose. [code]out[/code] controls the mix direction. [code]appliedPose[/code] controls whether the applied pose is used.
2426
</description>
2527
</method>
2628
<method name="get_duration">

‎spine-godot/spine_godot/docs/SpineAnimationState.xml‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</method>
4343
<method name="clear_track">
4444
<return type="void" />
45-
<argument index="0" name="arg0" type="int" />
45+
<argument index="0" name="track_id" type="int" />
4646
<description>
4747
Removes all animations from the track, leaving skeletons in their current pose.
4848
It may be desired to use [code]set_empty_animation()[/code] to mix the skeletons back to the setup pose, rather than leaving them in their current pose.
@@ -67,13 +67,6 @@
6767
Resumes the emission of any animation state events.
6868
</description>
6969
</method>
70-
<method name="get_current">
71-
<return type="SpineTrackEntry" />
72-
<argument index="0" name="track_id" type="int" />
73-
<description>
74-
Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing.
75-
</description>
76-
</method>
7770
<method name="get_num_tracks">
7871
<return type="int" />
7972
<description>
@@ -86,6 +79,13 @@
8679
Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower or faster. Defaults to 1.
8780
</description>
8881
</method>
82+
<method name="get_track">
83+
<return type="SpineTrackEntry" />
84+
<argument index="0" name="track_id" type="int" />
85+
<description>
86+
Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing.
87+
</description>
88+
</method>
8989
<method name="set_animation">
9090
<return type="SpineTrackEntry" />
9191
<argument index="0" name="animation_name" type="String" />

‎spine-godot/spine_godot/docs/SpineBone.xml‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,6 @@
113113
Updates this bone. This is called internally when the skeleton's world transform is computed and should typically not be called directly. The physics parameter determines how physics are applied. See [enum SpineConstant.Physics].
114114
</description>
115115
</method>
116-
<method name="apply_world_transform_2d">
117-
<return type="void" />
118-
<param index="0" name="o" type="Variant" />
119-
<description>
120-
Applies a world transform to this bone from a Node2D or Bone2D object.
121-
</description>
122-
</method>
123116
<method name="get_transform">
124117
<return type="Transform2D" />
125118
<description>
@@ -128,7 +121,7 @@
128121
</method>
129122
<method name="set_transform">
130123
<return type="void" />
131-
<param index="0" name="transform" type="Transform2D" />
124+
<param index="0" name="local_transform" type="Transform2D" />
132125
<description>
133126
Sets the bone transform to the Godot Transform2D relative to the SpineSprite.
134127
</description>
@@ -141,10 +134,10 @@
141134
</method>
142135
<method name="set_global_transform">
143136
<return type="void" />
144-
<param index="0" name="trans" type="Transform2D" />
137+
<param index="0" name="global_transform" type="Transform2D" />
145138
<description>
146139
Sets the bone's transform to the global Godot Transform2D.
147140
</description>
148141
</method>
149142
</methods>
150-
</class>
143+
</class>

‎spine-godot/spine_godot/docs/SpineConstant.xml‎

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,6 @@
77
The SpineConstant class provides access to various enumeration values used by the Spine runtime system in Godot. These constants are used to configure animation mixing, bone inheritance, path constraints, blend modes, and physics settings.
88
</description>
99
<constants>
10-
<constant name="MixBlend_Setup" value="0" enum="MixBlend">
11-
Transitions between the setup and timeline values (the current value is not used). Before the first frame, the setup value is used. MixBlend_Setup is intended to transition to or from the setup pose, not for animations layered on top of others.
12-
</constant>
13-
<constant name="MixBlend_First" value="1" enum="MixBlend">
14-
Transitions between the current and timeline values. Before the first frame, transitions between the current and setup values. Timelines which perform instant transitions, such as DrawOrderTimeline or AttachmentTimeline, use the setup value before the first frame. MixBlend_First is intended for the first animations applied, not for animations layered on top of others.
15-
</constant>
16-
<constant name="MixBlend_Replace" value="2" enum="MixBlend">
17-
Transitions between the current and timeline values. No change is made before the first frame. MixBlend_Replace is intended for animations layered on top of others, not for the first animations applied.
18-
</constant>
19-
<constant name="MixBlend_Add" value="3" enum="MixBlend">
20-
Transitions between the current value and the current plus timeline values. No change is made before the first frame. MixBlend_Add is intended for animations layered on top of others, not for the first animations applied. Properties set by additive animations must be set manually or by another animation before applying the additive animations, else the property values will increase each time the additive animations are applied.
21-
</constant>
22-
<constant name="MixDirection_In" value="0" enum="MixDirection">
23-
Spine animation mix direction for mixing in.
24-
</constant>
25-
<constant name="MixDirection_Out" value="1" enum="MixDirection">
26-
Spine animation mix direction for mixing out.
27-
</constant>
2810
<constant name="Property_Rotate" value="1" enum="PropertyId">
2911
Timeline property for rotation.
3012
</constant>
@@ -136,6 +118,15 @@
136118
<constant name="BlendMode_Screen" value="3" enum="BlendMode">
137119
Screen blending.
138120
</constant>
121+
<constant name="ScaleYMode_None" value="0" enum="ScaleYMode">
122+
No Y-scale mode adjustment.
123+
</constant>
124+
<constant name="ScaleYMode_Uniform" value="1" enum="ScaleYMode">
125+
Uniform Y-scale mode.
126+
</constant>
127+
<constant name="ScaleYMode_Volume" value="2" enum="ScaleYMode">
128+
Volume-preserving Y-scale mode.
129+
</constant>
139130
<constant name="UpdateMode_Process" value="0" enum="UpdateMode">
140131
Update during the process step.
141132
</constant>
@@ -163,5 +154,20 @@
163154
<constant name="Physics_Pose" value="3" enum="Physics">
164155
Physics are not updated but the pose from physics is applied.
165156
</constant>
157+
<constant name="MixInterpolation_Linear" value="0" enum="MixInterpolation">
158+
Linear interpolation between mix values.
159+
</constant>
160+
<constant name="MixInterpolation_Smooth" value="1" enum="MixInterpolation">
161+
Smooth (ease in/out) interpolation between mix values.
162+
</constant>
163+
<constant name="MixInterpolation_SlowFast" value="2" enum="MixInterpolation">
164+
Slow-to-fast interpolation between mix values.
165+
</constant>
166+
<constant name="MixInterpolation_FastSlow" value="3" enum="MixInterpolation">
167+
Fast-to-slow interpolation between mix values.
168+
</constant>
169+
<constant name="MixInterpolation_Circle" value="4" enum="MixInterpolation">
170+
Circular interpolation between mix values.
171+
</constant>
166172
</constants>
167-
</class>
173+
</class>

‎spine-godot/spine_godot/docs/SpinePathConstraint.xml‎

Lines changed: 13 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
<tutorials>
1111
</tutorials>
1212
<methods>
13+
<method name="get_applied_pose">
14+
<return type="SpinePathConstraintPose" />
15+
<description>
16+
The constraint's applied pose data.
17+
</description>
18+
</method>
1319
<method name="get_bones">
1420
<return type="Array" />
1521
<description>
@@ -22,45 +28,16 @@
2228
The path constraint's setup pose data.
2329
</description>
2430
</method>
25-
<method name="get_mix_rotate">
26-
<return type="float" />
27-
<description>
28-
A percentage (0-1) that controls the mix between the constrained and unconstrained rotation.
29-
</description>
30-
</method>
31-
<method name="get_mix_x">
32-
<return type="float" />
31+
<method name="get_pose">
32+
<return type="SpinePathConstraintPose" />
3333
<description>
34-
A percentage (0-1) that controls the mix between the constrained and unconstrained translation X.
34+
The constraint's pose data.
3535
</description>
3636
</method>
37-
<method name="get_mix_y">
38-
<return type="float" />
39-
<description>
40-
A percentage (0-1) that controls the mix between the constrained and unconstrained translation Y.
41-
</description>
42-
</method>
43-
<method name="get_order">
44-
<return type="int" />
45-
<description>
46-
</description>
47-
</method>
48-
<method name="get_position">
49-
<return type="float" />
50-
<description>
51-
The position along the path.
52-
</description>
53-
</method>
54-
<method name="get_spacing">
55-
<return type="float" />
56-
<description>
57-
The spacing between bones.
58-
</description>
59-
</method>
60-
<method name="get_target">
37+
<method name="get_slot">
6138
<return type="SpineSlot" />
6239
<description>
63-
The slot whose path attachment will be used to constrained the bones.
40+
The slot whose path attachment will be used to constrain the bones.
6441
</description>
6542
</method>
6643
<method name="is_active">
@@ -74,44 +51,15 @@
7451
<description>
7552
</description>
7653
</method>
77-
<method name="set_mix_rotate">
78-
<return type="void" />
79-
<argument index="0" name="v" type="float" />
80-
<description>
81-
</description>
82-
</method>
83-
<method name="set_mix_x">
84-
<return type="void" />
85-
<argument index="0" name="v" type="float" />
86-
<description>
87-
</description>
88-
</method>
89-
<method name="set_mix_y">
90-
<return type="void" />
91-
<argument index="0" name="v" type="float" />
92-
<description>
93-
</description>
94-
</method>
95-
<method name="set_position">
96-
<return type="void" />
97-
<argument index="0" name="v" type="float" />
98-
<description>
99-
</description>
100-
</method>
101-
<method name="set_spacing">
102-
<return type="void" />
103-
<argument index="0" name="v" type="float" />
104-
<description>
105-
</description>
106-
</method>
107-
<method name="set_target">
54+
<method name="set_slot">
10855
<return type="void" />
10956
<argument index="0" name="v" type="SpineSlot" />
11057
<description>
11158
</description>
11259
</method>
11360
<method name="update">
11461
<return type="void" />
62+
<argument index="0" name="skeleton" type="SpineSkeleton" />
11563
<description>
11664
</description>
11765
</method>

‎spine-godot/spine_godot/docs/SpineSkeleton.xml‎

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,27 @@
3131
Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method than to call it repeatedly.
3232
</description>
3333
</method>
34+
<method name="find_physics_constraint">
35+
<return type="SpinePhysicsConstraint" />
36+
<argument index="0" name="constraint_name" type="String" />
37+
<description>
38+
Finds a physics constraint by comparing each physics constraint's name. It is more efficient to cache the results of this method than to call it repeatedly.
39+
</description>
40+
</method>
3441
<method name="find_slot">
3542
<return type="SpineSlot" />
3643
<argument index="0" name="slot_name" type="String" />
3744
<description>
3845
Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it repeatedly.
3946
</description>
4047
</method>
48+
<method name="find_slider">
49+
<return type="SpineSlider" />
50+
<argument index="0" name="slider_name" type="String" />
51+
<description>
52+
Finds a slider by comparing each slider's name. It is more efficient to cache the results of this method than to call it repeatedly.
53+
</description>
54+
</method>
4155
<method name="find_transform_constraint">
4256
<return type="SpineTransformConstraint" />
4357
<argument index="0" name="constraint_name" type="String" />
@@ -131,12 +145,24 @@
131145
The skeleton's current skin.
132146
</description>
133147
</method>
148+
<method name="get_sliders">
149+
<return type="Array" />
150+
<description>
151+
The skeleton's sliders. Modifying the array has no effect.
152+
</description>
153+
</method>
134154
<method name="get_slots">
135155
<return type="Array" />
136156
<description>
137157
The skeleton's slots. Modifying the array has no effect.
138158
</description>
139159
</method>
160+
<method name="get_time">
161+
<return type="float" />
162+
<description>
163+
Returns the skeleton's current time. This is used to evaluate physics constraints.
164+
</description>
165+
</method>
140166
<method name="get_transform_constraints">
141167
<return type="Array" />
142168
<description>
@@ -146,17 +172,34 @@
146172
<method name="get_x">
147173
<return type="float" />
148174
<description>
149-
Sets the skeleton X position, which is added to the root bone worldX position. Relative to the [code]SpineSprite[/code].
175+
Returns the skeleton X position, which is added to the root bone worldX position. Relative to the [code]SpineSprite[/code].
150176
Bones that do not inherit translation are still affected by this property.
151177
</description>
152178
</method>
153179
<method name="get_y">
154180
<return type="float" />
155181
<description>
156-
Sets the skeleton Y position, which is added to the root bone worldX position. Relative to the [code]SpineSprite[/code].
182+
Returns the skeleton Y position, which is added to the root bone worldY position. Relative to the [code]SpineSprite[/code].
157183
Bones that do not inherit translation are still affected by this property.
158184
</description>
159185
</method>
186+
<method name="physics_rotate">
187+
<return type="void" />
188+
<argument index="0" name="x" type="float" />
189+
<argument index="1" name="y" type="float" />
190+
<argument index="2" name="degrees" type="float" />
191+
<description>
192+
Calls [code]PhysicsConstraint.rotate()[/code] for each physics constraint with the specified position and rotation.
193+
</description>
194+
</method>
195+
<method name="physics_translate">
196+
<return type="void" />
197+
<argument index="0" name="x" type="float" />
198+
<argument index="1" name="y" type="float" />
199+
<description>
200+
Calls [code]PhysicsConstraint.translate()[/code] for each physics constraint with the specified position.
201+
</description>
202+
</method>
160203
<method name="set_attachment">
161204
<return type="void" />
162205
<argument index="0" name="slot_name" type="String" />
@@ -224,6 +267,13 @@
224267
Sets the slots and draw order to their setup pose values.
225268
</description>
226269
</method>
270+
<method name="set_time">
271+
<return type="void" />
272+
<argument index="0" name="time" type="float" />
273+
<description>
274+
Sets the skeleton's current time. This is used to evaluate physics constraints.
275+
</description>
276+
</method>
227277
<method name="set_to_setup_pose">
228278
<return type="void" />
229279
<description>
@@ -242,12 +292,20 @@
242292
<return type="void" />
243293
<argument index="0" name="v" type="float" />
244294
<description>
245-
Sets the skeleton Y position, which is added to the root bone worldX position.
295+
Sets the skeleton Y position, which is added to the root bone worldY position.
246296
Bones that do not inherit translation are still affected by this property.
247297
</description>
248298
</method>
299+
<method name="update">
300+
<return type="void" />
301+
<argument index="0" name="delta" type="float" />
302+
<description>
303+
Increments the skeleton's time and updates physics constraints.
304+
</description>
305+
</method>
249306
<method name="update_world_transform">
250307
<return type="void" />
308+
<argument index="0" name="physics" type="int" enum="SpineConstant.Physics" />
251309
<description>
252310
Updates the world transform for each bone and applies all constraints.
253311
See [url]http://esotericsoftware.com/spine-runtime-skeletons#World-transforms[/url] in the Spine Runtimes Guide.

0 commit comments

Comments
 (0)