Browse Source

[godot] More in-editor docs.

Mario Zechner 3 years ago
parent
commit
e94e279057

+ 52 - 0
spine-godot/spine_godot/docs/SpineSkeleton.xml

@@ -1,8 +1,11 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <class name="SpineSkeleton" inherits="Reference" version="3.4">
 	<brief_description>
+		Stores the current pose for a skeleton.
 	</brief_description>
 	<description>
+		Stores the current pose for a skeleton.
+		See [url]http://esotericsoftware.com/spine-runtime-architecture#Instance-objects[/url] in the Spine Runtimes Guide.
 	</description>
 	<tutorials>
 	</tutorials>
@@ -11,30 +14,35 @@
 			<return type="SpineBone" />
 			<argument index="0" name="bone_name" type="String" />
 			<description>
+				Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it repeatedly.
 			</description>
 		</method>
 		<method name="find_ik_constraint">
 			<return type="SpineIkConstraint" />
 			<argument index="0" name="constraint_name" type="String" />
 			<description>
+				Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method than to call it repeatedly.
 			</description>
 		</method>
 		<method name="find_path_constraint">
 			<return type="SpinePathConstraint" />
 			<argument index="0" name="constraint_name" type="String" />
 			<description>
+				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.
 			</description>
 		</method>
 		<method name="find_slot">
 			<return type="SpineSlot" />
 			<argument index="0" name="slot_name" type="String" />
 			<description>
+				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.
 			</description>
 		</method>
 		<method name="find_transform_constraint">
 			<return type="SpineTransformConstraint" />
 			<argument index="0" name="constraint_name" type="String" />
 			<description>
+				Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of this method than to call it repeatedly.
 			</description>
 		</method>
 		<method name="get_attachment_by_slot_index">
@@ -42,6 +50,8 @@
 			<argument index="0" name="slot_index" type="int" />
 			<argument index="1" name="attachment_name" type="String" />
 			<description>
+				Finds an attachment by looking in the active skin and default skin using the slot index and attachment name. First the skin is checked and if the attachment was not found, the default skin is checked.
+				See [url]http://esotericsoftware.com/spine-runtime-skins">Runtime skins[/url] in the Spine Runtimes Guide.
 			</description>
 		</method>
 		<method name="get_attachment_by_slot_name">
@@ -49,81 +59,102 @@
 			<argument index="0" name="slot_name" type="String" />
 			<argument index="1" name="attachment_name" type="String" />
 			<description>
+				Finds an attachment by looking in the active skin and default skin using the slot index and attachment name. First the skin is checked and if the attachment was not found, the default skin is checked.
+				See [url]http://esotericsoftware.com/spine-runtime-skins">Runtime skins[/url] in the Spine Runtimes Guide.
 			</description>
 		</method>
 		<method name="get_bones">
 			<return type="Array" />
 			<description>
+				The skeleton's bones, sorted parent first. The root bone is always the first bone. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_bounds">
 			<return type="Rect2" />
 			<description>
+				Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose. The bounds are relative to the [code]SpineSprite[/code] that stores the skeleton.
 			</description>
 		</method>
 		<method name="get_color">
 			<return type="Color" />
 			<description>
+				The color to tint all the skeleton's attachments.
 			</description>
 		</method>
 		<method name="get_data" qualifiers="const">
 			<return type="SpineSkeletonDataResource" />
 			<description>
+				The skeleton's setup pose data.
 			</description>
 		</method>
 		<method name="get_draw_order">
 			<return type="Array" />
 			<description>
+				The skeleton's slots in the order they should be drawn. The returned array may be modified to change the draw order. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_ik_constraints">
 			<return type="Array" />
 			<description>
+				The skeleton's IK constraints. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_path_constraints">
 			<return type="Array" />
 			<description>
+				The skeleton's path constraints. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_root_bone">
 			<return type="SpineBone" />
 			<description>
+				Returns the root bone, or null if the skeleton has no bones.
 			</description>
 		</method>
 		<method name="get_scale_x">
 			<return type="float" />
 			<description>
+				Scales the entire skeleton on the X axis.
+				Bones that do not inherit scale are still affected by this property.
 			</description>
 		</method>
 		<method name="get_scale_y">
 			<return type="float" />
 			<description>
+				Scales the entire skeleton on the Y axis.
+				Bones that do not inherit scale are still affected by this property.
 			</description>
 		</method>
 		<method name="get_skin">
 			<return type="SpineSkin" />
 			<description>
+				The skeleton's current skin.
 			</description>
 		</method>
 		<method name="get_slots">
 			<return type="Array" />
 			<description>
+				The skeleton's slots. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_transform_constraints">
 			<return type="Array" />
 			<description>
+				The skeleton's transform constraints. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_x">
 			<return type="float" />
 			<description>
+				Sets the skeleton X position, which is added to the root bone worldX position. Relative to the [code]SpineSprite[/code].
+				Bones that do not inherit translation are still affected by this property.
 			</description>
 		</method>
 		<method name="get_y">
 			<return type="float" />
 			<description>
+				Sets the skeleton Y position, which is added to the root bone worldX position. Relative to the [code]SpineSprite[/code].
+				Bones that do not inherit translation are still affected by this property.
 			</description>
 		</method>
 		<method name="set_attachment">
@@ -131,74 +162,95 @@
 			<argument index="0" name="slot_name" type="String" />
 			<argument index="1" name="attachment_name" type="String" />
 			<description>
+				A convenience method to set an attachment by finding the slot with [code]find_slot()[/code], finding the attachment with [code]get_attachment()[/code], then setting the slot's attachment.
+				[code]attachmentName[/code] may be null to clear the slot's attachment.
 			</description>
 		</method>
 		<method name="set_bones_to_setup_pose">
 			<return type="void" />
 			<description>
+				Sets the bones and constraints to their setup pose values.
 			</description>
 		</method>
 		<method name="set_color">
 			<return type="void" />
 			<argument index="0" name="v" type="Color" />
 			<description>
+				Sets the skeleton color.
 			</description>
 		</method>
 		<method name="set_position">
 			<return type="void" />
 			<argument index="0" name="position" type="Vector2" />
 			<description>
+				Sets the skeleton position relative to the [code]SpineSprite[/code].
 			</description>
 		</method>
 		<method name="set_scale_x">
 			<return type="void" />
 			<argument index="0" name="v" type="float" />
 			<description>
+				Scales the skeleton on the X axis.
 			</description>
 		</method>
 		<method name="set_scale_y">
 			<return type="void" />
 			<argument index="0" name="v" type="float" />
 			<description>
+				Scales the skeleton on the Y axis.
 			</description>
 		</method>
 		<method name="set_skin">
 			<return type="void" />
 			<argument index="0" name="new_skin" type="SpineSkin" />
 			<description>
+				Sets the skin used to look up attachments before looking in the default skin. If the skin is changed, [code]update_cache()[/code] is called.
+				Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no old skin, each slot's setup mode attachment is attached from the new skin.
+				After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling [code]set_slots_to_setup_pose()[/code]. Also, often [code]AnimationState.apply()[/code] is called before the next time the skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin.
 			</description>
 		</method>
 		<method name="set_skin_by_name">
 			<return type="void" />
 			<argument index="0" name="skin_name" type="String" />
 			<description>
+				Sets the skin by name used to look up attachments before looking in the default skin. If the skin is changed, [code]update_cache()[/code] is called.
+				Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no old skin, each slot's setup mode attachment is attached from the new skin.
+				After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling [code]set_slots_to_setup_pose()[/code]. Also, often [code]AnimationState.apply()[/code] is called before the next time the skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin.
 			</description>
 		</method>
 		<method name="set_slots_to_setup_pose">
 			<return type="void" />
 			<description>
+				Sets the slots and draw order to their setup pose values.
 			</description>
 		</method>
 		<method name="set_to_setup_pose">
 			<return type="void" />
 			<description>
+				Sets the bones, constraints, slots, and draw order to their setup pose values.
 			</description>
 		</method>
 		<method name="set_x">
 			<return type="void" />
 			<argument index="0" name="v" type="float" />
 			<description>
+				Sets the skeleton X position, which is added to the root bone worldX position.
+				Bones that do not inherit translation are still affected by this property.
 			</description>
 		</method>
 		<method name="set_y">
 			<return type="void" />
 			<argument index="0" name="v" type="float" />
 			<description>
+				Sets the skeleton Y position, which is added to the root bone worldX position.
+				Bones that do not inherit translation are still affected by this property.
 			</description>
 		</method>
 		<method name="update_world_transform">
 			<return type="void" />
 			<description>
+				Updates the world transform for each bone and applies all constraints.
+				See [url]http://esotericsoftware.com/spine-runtime-skeletons#World-transforms[/url] in the Spine Runtimes Guide.
 			</description>
 		</method>
 	</methods>

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

@@ -1,8 +1,11 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <class name="SpineSkeletonDataResource" inherits="Resource" version="3.4">
 	<brief_description>
+		Resource used to spawn new [code]SpineSkeleton[/code] instances.
 	</brief_description>
 	<description>
+		Resource used to spawn new [code]SpineSkeleton[/code] instances. The skeleton data resource consists of the skeleton data loaded from a .json or .skel [code]SpineSkeletonFileResource[/code], the texture atlas loaded from a .atlas and .png files making up a [code]SpineAtlasResource[/code], as well as animation mixes, governing for how long two specific animations should be cross faded via [code]SpineAnimationState[/code].
+		A single skeleton data resource can be shared among multiple [code]SpineSprite[/code] instances to avoid duplication of resources.
 	</description>
 	<tutorials>
 	</tutorials>
@@ -11,154 +14,184 @@
 			<return type="SpineAnimation" />
 			<argument index="0" name="animation_name" type="String" />
 			<description>
+				Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to call it multiple times.
 			</description>
 		</method>
 		<method name="find_bone" qualifiers="const">
 			<return type="SpineBoneData" />
 			<argument index="0" name="bone_name" type="String" />
 			<description>
+				Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it multiple times.
 			</description>
 		</method>
 		<method name="find_event" qualifiers="const">
 			<return type="SpineEventData" />
 			<argument index="0" name="event_data_name" type="String" />
 			<description>
+				Finds an event by comparing each events's name. It is more efficient to cache the results of this method than to call it multiple times.
 			</description>
 		</method>
 		<method name="find_ik_constraint_data" qualifiers="const">
 			<return type="SpineIkConstraintData" />
 			<argument index="0" name="constraint_name" type="String" />
 			<description>
+				Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method than to call it multiple times.
 			</description>
 		</method>
 		<method name="find_path_constraint_data" qualifiers="const">
 			<return type="SpinePathConstraintData" />
 			<argument index="0" name="constraint_name" type="String" />
 			<description>
+				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 multiple times.
 			</description>
 		</method>
 		<method name="find_skin" qualifiers="const">
 			<return type="SpineSkin" />
 			<argument index="0" name="skin_name" type="String" />
 			<description>
+				Finds a skin by comparing each skin's name. It is more efficient to cache the results of this method than to call it multiple times.
 			</description>
 		</method>
 		<method name="find_slot" qualifiers="const">
 			<return type="SpineSlotData" />
 			<argument index="0" name="slot_name" type="String" />
 			<description>
+				Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it multiple times.
 			</description>
 		</method>
 		<method name="find_transform_constraint_data" qualifiers="const">
 			<return type="SpineTransformConstraintData" />
 			<argument index="0" name="constraint_name" type="String" />
 			<description>
+				Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of this method than to call it multiple times.
 			</description>
 		</method>
 		<method name="get_animations" qualifiers="const">
 			<return type="Array" />
 			<description>
+				The skeleton's animations. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_audio_path" qualifiers="const">
 			<return type="String" />
 			<description>
+				The path to the audio directory as defined in Spine, or null if nonessential data was not exported.
 			</description>
 		</method>
 		<method name="get_bones" qualifiers="const">
 			<return type="Array" />
 			<description>
+				The skeleton's bones, sorted parent first. The root bone is always the first bone. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_default_skin" qualifiers="const">
 			<return type="SpineSkin" />
 			<description>
+				The skeleton's default skin. By default this skin contains all attachments that were not in a skin in Spine.
+				See [code]Skeleton.get_attachment()[/code].
 			</description>
 		</method>
 		<method name="get_events" qualifiers="const">
 			<return type="Array" />
 			<description>
+				The skeleton's events. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_fps" qualifiers="const">
 			<return type="float" />
 			<description>
+				The dopesheet FPS in Spine, or zero if nonessential data was not exported.
 			</description>
 		</method>
 		<method name="get_hash" qualifiers="const">
 			<return type="String" />
 			<description>
+				The skeleton data hash. This value will change if any of the skeleton data has changed.
 			</description>
 		</method>
 		<method name="get_height" qualifiers="const">
 			<return type="float" />
 			<description>
+				The height of the skeleton's axis aligned bounding box in the setup pose.
 			</description>
 		</method>
 		<method name="get_ik_constraints" qualifiers="const">
 			<return type="Array" />
 			<description>
+				The skeleton's IK constraints. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_images_path" qualifiers="const">
 			<return type="String" />
 			<description>
+				The path to the images directory as defined in Spine, or null if nonessential data was not exported.
 			</description>
 		</method>
 		<method name="get_path_constraints" qualifiers="const">
 			<return type="Array" />
 			<description>
+				The skeleton's path constraints. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_skeleton_name" qualifiers="const">
 			<return type="String" />
 			<description>
+				The skeleton's name, which by default is the name of the skeleton data file when possible, or null when a name hasn't been set.
 			</description>
 		</method>
 		<method name="get_skins" qualifiers="const">
 			<return type="Array" />
 			<description>
+				All skins, including the default skin. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_slots" qualifiers="const">
 			<return type="Array" />
 			<description>
+				The skeleton's slots. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_transform_constraints" qualifiers="const">
 			<return type="Array" />
 			<description>
+				The skeleton's transform constraints. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_version" qualifiers="const">
 			<return type="String" />
 			<description>
+				The Spine version used to export the skeleton data, or null.
 			</description>
 		</method>
 		<method name="get_width" qualifiers="const">
 			<return type="float" />
 			<description>
+				The width of the skeleton's axis aligned bounding box in the setup pose.
 			</description>
 		</method>
 		<method name="get_x" qualifiers="const">
 			<return type="float" />
 			<description>
+				The X coordinate of the skeleton's axis aligned bounding box in the setup pose.
 			</description>
 		</method>
 		<method name="get_y" qualifiers="const">
 			<return type="float" />
 			<description>
+				The Y coordinate of the skeleton's axis aligned bounding box in the setup pose.
 			</description>
 		</method>
 		<method name="is_skeleton_data_loaded" qualifiers="const">
 			<return type="bool" />
 			<description>
+				Whether the skeleton data file and atlas have been successfully loaded.
 			</description>
 		</method>
 		<method name="set_default_skin">
 			<return type="void" />
 			<argument index="0" name="skin" type="SpineSkin" />
 			<description>
+				Sets the skeleton's default skin.
 			</description>
 		</method>
 	</methods>

+ 2 - 0
spine-godot/spine_godot/docs/SpineSkeletonFileResource.xml

@@ -1,8 +1,10 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <class name="SpineSkeletonFileResource" inherits="Resource" version="3.4">
 	<brief_description>
+		Resource wrapping a Spine skeleton .json or .skel file. Used by [code]SpineSkeletonDataResource[/code].
 	</brief_description>
 	<description>
+		Resource wrapping a Spine skeleton .json or .skel file. Used by [code]SpineSkeletonDataResource[/code].
 	</description>
 	<tutorials>
 	</tutorials>

+ 14 - 0
spine-godot/spine_godot/docs/SpineSkin.xml

@@ -1,8 +1,11 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <class name="SpineSkin" inherits="SpineObjectWrapper" version="3.4">
 	<brief_description>
+		Stores attachments by slot index and attachment name.
 	</brief_description>
 	<description>
+		Stores attachments by slot index and attachment name.
+		See [url]http://esotericsoftware.com/spine-runtime-skins[/url] in the Spine Runtimes Guide.
 	</description>
 	<tutorials>
 	</tutorials>
@@ -11,24 +14,28 @@
 			<return type="void" />
 			<argument index="0" name="other" type="SpineSkin" />
 			<description>
+				Adds all attachments, bones, and constraints from the specified skin to this skin.
 			</description>
 		</method>
 		<method name="copy_skin">
 			<return type="void" />
 			<argument index="0" name="other" type="SpineSkin" />
 			<description>
+				Adds all bones and constraints and copies of all attachments from the specified skin to this skin. Mesh attachments are not copied, instead a new linked mesh is created. The attachment copies can be modified without affecting the originals.
 			</description>
 		</method>
 		<method name="find_attachments_for_slot">
 			<return type="Array" />
 			<argument index="0" name="slot_index" type="int" />
 			<description>
+				Returns all attachments for a slot index. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="find_names_for_slot">
 			<return type="Array" />
 			<argument index="0" name="slot_index" type="int" />
 			<description>
+				Finds the skin keys for a given slot. The results are added to the passed array of names. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_attachment">
@@ -36,26 +43,31 @@
 			<argument index="0" name="slot_index" type="int" />
 			<argument index="1" name="name" type="String" />
 			<description>
+				Returns the attachment for the specified slot index and name, or null.
 			</description>
 		</method>
 		<method name="get_attachments">
 			<return type="Array" />
 			<description>
+				Returns all attachments in this skin. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_bones">
 			<return type="Array" />
 			<description>
+				Returns the bones associated with this skin. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_constraints">
 			<return type="Array" />
 			<description>
+				Returns the constraints associated with this skin. Modifying the array has no effect.
 			</description>
 		</method>
 		<method name="get_name">
 			<return type="String" />
 			<description>
+				The name of the skin.
 			</description>
 		</method>
 		<method name="remove_attachment">
@@ -63,6 +75,7 @@
 			<argument index="0" name="slot_index" type="int" />
 			<argument index="1" name="name" type="String" />
 			<description>
+				Removes the attachment in the skin for the specified slot index and name, if any.
 			</description>
 		</method>
 		<method name="set_attachment">
@@ -71,6 +84,7 @@
 			<argument index="1" name="name" type="String" />
 			<argument index="2" name="attachment" type="SpineAttachment" />
 			<description>
+				Adds an attachment to the skin for the specified slot index and name.
 			</description>
 		</method>
 	</methods>