Browse Source

[godot] Finished in-editor docs.

Mario Zechner 3 năm trước cách đây
mục cha
commit
fe5d84e022

+ 6 - 0
spine-godot/spine_godot/docs/SpineSlotNode.xml

@@ -1,8 +1,14 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?xml version="1.0" encoding="UTF-8" ?>
 <class name="SpineSlotNode" inherits="Node2D" version="3.4">
 <class name="SpineSlotNode" inherits="Node2D" version="3.4">
 	<brief_description>
 	<brief_description>
+		A node to insert other Node2D instances into the skeleton drawing order and override materials for a specific slot.
 	</brief_description>
 	</brief_description>
 	<description>
 	<description>
+		A node to insert other Node2D instances into the skeleton drawing order and override materials for a specific slot.
+		A slot node needs to be parented to a [code]SpineSprite[/code] directly. To insert the node and its children into the skeleton drawing order, the slot name property needs to be set to the name of the slot the node should be inserted into.
+		The children of the slot node will be rendered on top any active attachment of the slot.
+		If any of the slot node materials are set, they will be used for the active attachment of the slot.
+		See the [code]examples/07-slot-node[/code] and [code]examples/09-custom-material[/code] examples.
 	</description>
 	</description>
 	<tutorials>
 	<tutorials>
 	</tutorials>
 	</tutorials>

+ 33 - 0
spine-godot/spine_godot/docs/SpineSprite.xml

@@ -1,8 +1,21 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?xml version="1.0" encoding="UTF-8" ?>
 <class name="SpineSprite" inherits="Node2D" version="3.4">
 <class name="SpineSprite" inherits="Node2D" version="3.4">
 	<brief_description>
 	<brief_description>
+		A node for animating and rendering a Spine skeleton to a 2D scene.
 	</brief_description>
 	</brief_description>
 	<description>
 	<description>
+		A Spine sprite node is the main node type used to animate and render a Spine skeleton in a 2D scene.
+		The Spine sprite gets its skeleton, texture atlas data, and animation mixes from a [code]SpineSkeletonDataResource[/code]. The skeleton data resource can and should be shared across multiple Spine sprites to save resources.
+		The Spine sprite provides a [code]SpineAnimationState[/code] via [code]get_animation_state()[/code] through which it can be animated.
+		The Spine sprite also provides acccess to the underlying [code]SpineSkeleton[/code] via [code]get_skeleton[/code] which allows querying bones, slots, constraints, and other parts of the skeleton.
+		The [code]SpineSkeleton[/code] is also used to set the active skin. For mix-and-match scenarios, a new skin can be created via [code]new_skin()[/code] to which the attachments of existing skins can be added via [code]SpineSkin.add_skin()[/code].
+		To insert other nodes into the drawing order of the Spine sprite's slots, a [code]SpineSlotNode[/code] can be used. This allows attaching particle systems, collision shapes, and other Godot nodes to specific slots and bones of the Spine sprite's skeleton.
+		The Spine sprite allows overriding the internal materials through 4 material properties. If set, these materials will be used instead of the default internal materials for all attachments. For more fine grained control, a [code]SpineSlotNode[/code] can override the material of the attachment on a specific slot.
+		By default, a Spine sprite is updated during the standard [code]process[/code] update. It can be set to update during the physics update via the [code]process_mode[/code] property. It can also be set to be updated manually, in which case [code]update_skeleton[/code] must be called so the internal animation state is updated and applied to the skeleon.
+		The Spine sprite provides the method to query ([code]get_global_bone_transform()[/code]) and set ([code]set_global_bone_transform[/code]) a bone's global transform. This can be used to have another node follow a bone, or have a bone follow e.g. the mouse or another node. Alternatively, a [code]SpineBoneNode[/code] can be used to achieve the same, without having to manually update and synchronize transforms.
+		The Spine sprite provides signals to listen for animation state events, such as an animation having completed or when a user defined event occurred. It also provides signals before the animations state is updated and applied, and before and after the world transforms of bones have been computed, allowing to modify the underlying skeleton before these actions happen.
+		In editor mode, the Spine sprite provides properties to show debugging information, such as bone and slot names on hover, regions and meshes, and so forth. This can be used to inspect a skeleton and its hierarchy in the editor viewport.
+		To animate a Spine sprite via the Godot animation player, [code]SpineAnimationTrack[/code] instances can be used. See the Spine Godot Runtimes documentation and the [code]examples/08-animation-player[/code] examople for more information.
 	</description>
 	</description>
 	<tutorials>
 	<tutorials>
 	</tutorials>
 	</tutorials>
@@ -10,23 +23,27 @@
 		<method name="get_animation_state">
 		<method name="get_animation_state">
 			<return type="SpineAnimationState" />
 			<return type="SpineAnimationState" />
 			<description>
 			<description>
+				Returns the animation state for animating the skeleton.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="get_global_bone_transform">
 		<method name="get_global_bone_transform">
 			<return type="Transform2D" />
 			<return type="Transform2D" />
 			<argument index="0" name="bone_name" type="String" />
 			<argument index="0" name="bone_name" type="String" />
 			<description>
 			<description>
+				Returns the bone's global transform.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="get_skeleton">
 		<method name="get_skeleton">
 			<return type="SpineSkeleton" />
 			<return type="SpineSkeleton" />
 			<description>
 			<description>
+				Returns the skeleton.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="new_skin">
 		<method name="new_skin">
 			<return type="SpineSkin" />
 			<return type="SpineSkin" />
 			<argument index="0" name="name" type="String" />
 			<argument index="0" name="name" type="String" />
 			<description>
 			<description>
+				Creates a new skin.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="on_skeleton_data_changed">
 		<method name="on_skeleton_data_changed">
@@ -39,12 +56,14 @@
 			<argument index="0" name="bone_name" type="String" />
 			<argument index="0" name="bone_name" type="String" />
 			<argument index="1" name="global_transform" type="Transform2D" />
 			<argument index="1" name="global_transform" type="Transform2D" />
 			<description>
 			<description>
+				Sets a bone's global transform. This must be done before the skeleton world transforms are computed.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="update_skeleton">
 		<method name="update_skeleton">
 			<return type="void" />
 			<return type="void" />
 			<argument index="0" name="delta" type="float" />
 			<argument index="0" name="delta" type="float" />
 			<description>
 			<description>
+				Updates and applies the animation state, then updates the world transforms. Only needed for the manual processing mode.
 			</description>
 			</description>
 		</method>
 		</method>
 	</methods>
 	</methods>
@@ -98,6 +117,9 @@
 			<argument index="1" name="animation_state" type="Object" />
 			<argument index="1" name="animation_state" type="Object" />
 			<argument index="2" name="track_entry" type="Object" />
 			<argument index="2" name="track_entry" type="Object" />
 			<description>
 			<description>
+				Invoked every time this entry's animation completes a loop. This may occur during mixing (after interrupt).
+				If this entry's [code]get_mixing_to()[/code] is not null, this entry is mixing out (it is not the current entry).
+				Because this event is triggered at the end of [code]AnimationState.apply[/code], any animations set in response to the event won't be applied until the next time the AnimationState is applied.
 			</description>
 			</description>
 		</signal>
 		</signal>
 		<signal name="animation_disposed">
 		<signal name="animation_disposed">
@@ -105,6 +127,8 @@
 			<argument index="1" name="animation_state" type="Object" />
 			<argument index="1" name="animation_state" type="Object" />
 			<argument index="2" name="track_entry" type="Object" />
 			<argument index="2" name="track_entry" type="Object" />
 			<description>
 			<description>
+				Invoked when this entry will be disposed. This may occur without the entry ever being set as the current entry.
+				References to the entry should not be kept after [code]dispose[/code] is called, as it may be destroyed or reused.
 			</description>
 			</description>
 		</signal>
 		</signal>
 		<signal name="animation_ended">
 		<signal name="animation_ended">
@@ -112,6 +136,7 @@
 			<argument index="1" name="animation_state" type="Object" />
 			<argument index="1" name="animation_state" type="Object" />
 			<argument index="2" name="track_entry" type="Object" />
 			<argument index="2" name="track_entry" type="Object" />
 			<description>
 			<description>
+				Invoked when this entry will never be applied again. This only occurs if this entry has previously been set as the current entry (start was invoked).
 			</description>
 			</description>
 		</signal>
 		</signal>
 		<signal name="animation_event">
 		<signal name="animation_event">
@@ -120,6 +145,8 @@
 			<argument index="2" name="track_entry" type="Object" />
 			<argument index="2" name="track_entry" type="Object" />
 			<argument index="3" name="event" type="Object" />
 			<argument index="3" name="event" type="Object" />
 			<description>
 			<description>
+				Invoked when this entry's animation triggers an event. This may occur during mixing (after interrupt), see [code]TrackEntry.get_event_threshold()[/code].
+				Because this event is triggered at the end of {@link AnimationState#apply(Skeleton)}, any animations set in response to the event won't be applied until the next time the AnimationState is applied.
 			</description>
 			</description>
 		</signal>
 		</signal>
 		<signal name="animation_interrupted">
 		<signal name="animation_interrupted">
@@ -127,6 +154,7 @@
 			<argument index="1" name="animation_state" type="Object" />
 			<argument index="1" name="animation_state" type="Object" />
 			<argument index="2" name="track_entry" type="Object" />
 			<argument index="2" name="track_entry" type="Object" />
 			<description>
 			<description>
+				Invoked when another entry has replaced this entry as the current entry. This entry may continue being applied for mixing.
 			</description>
 			</description>
 		</signal>
 		</signal>
 		<signal name="animation_started">
 		<signal name="animation_started">
@@ -134,26 +162,31 @@
 			<argument index="1" name="animation_state" type="Object" />
 			<argument index="1" name="animation_state" type="Object" />
 			<argument index="2" name="track_entry" type="Object" />
 			<argument index="2" name="track_entry" type="Object" />
 			<description>
 			<description>
+				Invoked when this entry has been set as the current entry. {@link #end(TrackEntry)} will occur when this entry will no longer be applied.
 			</description>
 			</description>
 		</signal>
 		</signal>
 		<signal name="before_animation_state_apply">
 		<signal name="before_animation_state_apply">
 			<argument index="0" name="spine_sprite" type="Object" />
 			<argument index="0" name="spine_sprite" type="Object" />
 			<description>
 			<description>
+				Invoked before the animation state is applied to the skeleton.
 			</description>
 			</description>
 		</signal>
 		</signal>
 		<signal name="before_animation_state_update">
 		<signal name="before_animation_state_update">
 			<argument index="0" name="spine_sprite" type="Object" />
 			<argument index="0" name="spine_sprite" type="Object" />
 			<description>
 			<description>
+				Invoked before the animation state is updated.
 			</description>
 			</description>
 		</signal>
 		</signal>
 		<signal name="before_world_transforms_change">
 		<signal name="before_world_transforms_change">
 			<argument index="0" name="spine_sprite" type="Object" />
 			<argument index="0" name="spine_sprite" type="Object" />
 			<description>
 			<description>
+				Invoked before the world transforms are computed.
 			</description>
 			</description>
 		</signal>
 		</signal>
 		<signal name="world_transforms_changed">
 		<signal name="world_transforms_changed">
 			<argument index="0" name="spine_sprite" type="Object" />
 			<argument index="0" name="spine_sprite" type="Object" />
 			<description>
 			<description>
+				Invoked after the world transforms have been computed.
 			</description>
 			</description>
 		</signal>
 		</signal>
 	</signals>
 	</signals>