From ca5ff77a8f653dbf7258b42f8db85e00b6a87553 Mon Sep 17 00:00:00 2001 From: Nathan Sweet Date: Tue, 24 Mar 2026 20:02:18 -0400 Subject: [PATCH] [libgdx] Javadoc. --- .../com/esotericsoftware/spine/BonePose.java | 4 +-- .../src/com/esotericsoftware/spine/Event.java | 3 +- .../com/esotericsoftware/spine/EventData.java | 12 +++++-- .../esotericsoftware/spine/IkConstraint.java | 4 +-- .../spine/PathConstraint.java | 3 +- .../spine/PhysicsConstraint.java | 10 +++--- .../spine/PhysicsConstraintData.java | 14 ++++++++ .../spine/PhysicsConstraintPose.java | 8 ++++- .../com/esotericsoftware/spine/PosedData.java | 1 + .../com/esotericsoftware/spine/Skeleton.java | 33 +++++++++++-------- .../esotericsoftware/spine/SkeletonData.java | 6 ++-- .../src/com/esotericsoftware/spine/Skin.java | 2 ++ .../com/esotericsoftware/spine/Slider.java | 5 +-- .../esotericsoftware/spine/SliderData.java | 8 +++++ .../esotericsoftware/spine/SliderPose.java | 2 ++ .../src/com/esotericsoftware/spine/Slot.java | 7 ++-- .../com/esotericsoftware/spine/SlotPose.java | 4 +-- .../spine/TransformConstraint.java | 3 +- .../spine/TransformConstraintPose.java | 12 +++---- .../spine/attachments/PointAttachment.java | 4 +-- .../spine/attachments/Sequence.java | 14 ++++++++ 21 files changed, 111 insertions(+), 48 deletions(-) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BonePose.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BonePose.java index 213136c37..d996e8da0 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BonePose.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BonePose.java @@ -91,13 +91,13 @@ public class BonePose implements Pose, Update { this.scaleY = scaleY; } - /** Sets local x and y scale. */ + /** Sets local scaleX and scaleY. */ public void setScale (float scaleX, float scaleY) { this.scaleX = scaleX; this.scaleY = scaleY; } - /** Sets local x and y scale to the same value. */ + /** Sets local scaleX and scaleY to the same value. */ public void setScale (float scale) { scaleX = scale; scaleY = scale; diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Event.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Event.java index 8d773214a..e29cb06ee 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Event.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Event.java @@ -29,10 +29,11 @@ package com.esotericsoftware.spine; +import com.esotericsoftware.spine.Animation.EventTimeline; import com.esotericsoftware.spine.Animation.Timeline; import com.esotericsoftware.spine.AnimationState.AnimationStateListener; -/** Stores the current pose values for an {@link Event}. +/** Fired by {@link EventTimeline} when specific animation times are reached. *

* See {@link Timeline#apply(Skeleton, float, float, com.badlogic.gdx.utils.Array, float, boolean, boolean, boolean, boolean)}, * {@link AnimationStateListener#event(com.esotericsoftware.spine.AnimationState.TrackEntry, Event)}, and diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/EventData.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/EventData.java index befe8d8ab..30e522c77 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/EventData.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/EventData.java @@ -29,6 +29,8 @@ package com.esotericsoftware.spine; +import com.badlogic.gdx.utils.Null; + /** Stores the setup pose values for an {@link Event}. *

* See Events in the Spine User Guide. */ @@ -36,7 +38,8 @@ public class EventData { final String name; int intValue; float floatValue; - String stringValue, audioPath; + String stringValue; + @Null String audioPath; float volume, balance; public EventData (String name) { @@ -69,15 +72,17 @@ public class EventData { this.stringValue = stringValue; } - public String getAudioPath () { + /** Path to an audio file relative to the audio path in the Spine project. */ + public @Null String getAudioPath () { return audioPath; } - public void setAudioPath (String audioPath) { + public void setAudioPath (@Null String audioPath) { if (audioPath == null) throw new IllegalArgumentException("audioPath cannot be null."); this.audioPath = audioPath; } + /** If an audio path is set, the volume for the audio. */ public float getVolume () { return volume; } @@ -86,6 +91,7 @@ public class EventData { this.volume = volume; } + /** If an audio path is set, the left/right balance for the audio. */ public float getBalance () { return balance; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java index d03afcd91..bf55d5956 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java @@ -35,8 +35,8 @@ import com.badlogic.gdx.utils.Array; import com.esotericsoftware.spine.BoneData.Inherit; -/** Stores the current pose for an IK constraint. An IK constraint adjusts the rotation of 1 or 2 constrained bones so the tip of - * the last bone is as close to the target bone as possible. +/** Adjusts the local rotation of 1 or 2 constrained bones so the world position of the tip of the last bone is as close to the + * target bone as possible. *

* See IK constraints in the Spine User Guide. */ public class IkConstraint extends Constraint { diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PathConstraint.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PathConstraint.java index 31d6954d6..48847f9b0 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PathConstraint.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PathConstraint.java @@ -43,8 +43,7 @@ import com.esotericsoftware.spine.Skin.SkinEntry; import com.esotericsoftware.spine.attachments.Attachment; import com.esotericsoftware.spine.attachments.PathAttachment; -/** Stores the current pose for a path constraint. A path constraint adjusts the rotation, translation, and scale of the - * constrained bones so they follow a {@link PathAttachment}. +/** Adjusts the rotation, translation, and scale of the constrained bones so they follow a {@link PathAttachment}. *

* See Path constraints in the Spine User Guide. */ public class PathConstraint extends Constraint { diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PhysicsConstraint.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PhysicsConstraint.java index 310bede29..2799698fe 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PhysicsConstraint.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PhysicsConstraint.java @@ -31,7 +31,7 @@ package com.esotericsoftware.spine; import static com.esotericsoftware.spine.utils.SpineUtils.*; -/** Stores the current pose for a physics constraint. A physics constraint applies physics to bones. +/** Applies physics to a bone. *

* See Physics constraints in the Spine User Guide. */ public class PhysicsConstraint extends Constraint { @@ -58,6 +58,8 @@ public class PhysicsConstraint extends Constraint { mix = pose.mix; } + /** Controls how much bone movement is converted into physics movement. */ public float getInertia () { return inertia; } @@ -51,6 +52,7 @@ public class PhysicsConstraintPose implements Pose { this.inertia = inertia; } + /** The amount of force used to return properties to the unconstrained value. */ public float getStrength () { return strength; } @@ -59,6 +61,7 @@ public class PhysicsConstraintPose implements Pose { this.strength = strength; } + /** Reduces the speed of physics movements, with more of a reduction at higher speeds. */ public float getDamping () { return damping; } @@ -67,6 +70,7 @@ public class PhysicsConstraintPose implements Pose { this.damping = damping; } + /** Determines susceptibility to acceleration. */ public float getMassInverse () { return massInverse; } @@ -75,6 +79,7 @@ public class PhysicsConstraintPose implements Pose { this.massInverse = massInverse; } + /** Applies a constant force along the world X axis. */ public float getWind () { return wind; } @@ -83,6 +88,7 @@ public class PhysicsConstraintPose implements Pose { this.wind = wind; } + /** Applies a constant force along the world Y axis. */ public float getGravity () { return gravity; } @@ -91,7 +97,7 @@ public class PhysicsConstraintPose implements Pose { this.gravity = gravity; } - /** A percentage (0-1) that controls the mix between the constrained and unconstrained poses. */ + /** A percentage (0+) that controls the mix between the constrained and unconstrained poses. */ public float getMix () { return mix; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PosedData.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PosedData.java index 5093c7457..cd05fab35 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PosedData.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PosedData.java @@ -45,6 +45,7 @@ abstract public class PosedData

{ return name; } + /** The setup pose that most animations are relative to. */ public P getSetupPose () { return setup; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java index 00f5cd756..4f5e89add 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java @@ -408,38 +408,38 @@ public class Skeleton { * name. *

* See {@link #getAttachment(int, String)}. */ - public @Null Attachment getAttachment (String slotName, String attachmentName) { + public @Null Attachment getAttachment (String slotName, String placeholderName) { SlotData slot = data.findSlot(slotName); if (slot == null) throw new IllegalArgumentException("Slot not found: " + slotName); - return getAttachment(slot.getIndex(), attachmentName); + return getAttachment(slot.getIndex(), placeholderName); } - /** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot index and - * attachment name. First the skin is checked and if the attachment was not found, the default skin is checked. + /** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot index and skin + * placeholder name. First the skin is checked and if the attachment was not found, the default skin is checked. *

* See Runtime skins in the Spine Runtimes Guide. */ - public @Null Attachment getAttachment (int slotIndex, String attachmentName) { - if (attachmentName == null) throw new IllegalArgumentException("attachmentName cannot be null."); + public @Null Attachment getAttachment (int slotIndex, String placeholderName) { + if (placeholderName == null) throw new IllegalArgumentException("placeholderName cannot be null."); if (skin != null) { - Attachment attachment = skin.getAttachment(slotIndex, attachmentName); + Attachment attachment = skin.getAttachment(slotIndex, placeholderName); if (attachment != null) return attachment; } - if (data.defaultSkin != null) return data.defaultSkin.getAttachment(slotIndex, attachmentName); + if (data.defaultSkin != null) return data.defaultSkin.getAttachment(slotIndex, placeholderName); return null; } /** A convenience method to set an attachment by finding the slot with {@link #findSlot(String)}, finding the attachment with * {@link #getAttachment(int, String)}, then setting the slot's {@link SlotPose#attachment}. - * @param attachmentName May be null to clear the slot's attachment. */ - public void setAttachment (String slotName, @Null String attachmentName) { + * @param placeholderName May be null to clear the slot's attachment. */ + public void setAttachment (String slotName, @Null String placeholderName) { if (slotName == null) throw new IllegalArgumentException("slotName cannot be null."); Slot slot = findSlot(slotName); if (slot == null) throw new IllegalArgumentException("Slot not found: " + slotName); Attachment attachment = null; - if (attachmentName != null) { - attachment = getAttachment(slot.data.index, attachmentName); + if (placeholderName != null) { + attachment = getAttachment(slot.data.index, placeholderName); if (attachment == null) - throw new IllegalArgumentException("Attachment not found: " + attachmentName + ", for slot: " + slotName); + throw new IllegalArgumentException("Attachment not found: " + placeholderName + ", for slot: " + slotName); } slot.pose.setAttachment(attachment); } @@ -449,10 +449,13 @@ public class Skeleton { return constraints; } + /** The skeleton's physics constraints. */ public Array getPhysicsConstraints () { return physics; } + /** Finds a constraint of the specified type by comparing each constraints's name. It is more efficient to cache the results of + * this method than to call it multiple times. */ public @Null T findConstraint (String constraintName, Class type) { if (constraintName == null) throw new IllegalArgumentException("constraintName cannot be null."); if (type == null) throw new IllegalArgumentException("type cannot be null."); @@ -604,6 +607,7 @@ public class Skeleton { this.y = y; } + /** The x component of a vector that defines the direction {@link PhysicsConstraintPose#getWind()} is applied. */ public float getWindX () { return windX; } @@ -612,6 +616,7 @@ public class Skeleton { this.windX = windX; } + /** The y component of a vector that defines the direction {@link PhysicsConstraintPose#getWind()} is applied. */ public float getWindY () { return windY; } @@ -620,6 +625,7 @@ public class Skeleton { this.windY = windY; } + /** The x component of a vector that defines the direction {@link PhysicsConstraintPose#getGravity()} is applied. */ public float getGravityX () { return gravityX; } @@ -628,6 +634,7 @@ public class Skeleton { this.gravityX = gravityX; } + /** The y component of a vector that defines the direction {@link PhysicsConstraintPose#getGravity()} is applied. */ public float getGravityY () { return gravityY; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonData.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonData.java index ed14588ba..3288e1c9d 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonData.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonData.java @@ -168,6 +168,8 @@ public class SkeletonData { return constraints; } + /** Finds a constraint of the specified type by comparing each constraints's name. It is more efficient to cache the results of + * this method than to call it multiple times. */ public @Null T findConstraint (String constraintName, Class type) { if (constraintName == null) throw new IllegalArgumentException("constraintName cannot be null."); if (type == null) throw new IllegalArgumentException("type cannot be null."); @@ -255,7 +257,7 @@ public class SkeletonData { this.hash = hash; } - /** The path to the images directory as defined in Spine, or null if nonessential data was not exported. */ + /** The path to the images folder as defined in Spine, or null if nonessential data was not exported. */ public @Null String getImagesPath () { return imagesPath; } @@ -264,7 +266,7 @@ public class SkeletonData { this.imagesPath = imagesPath; } - /** The path to the audio directory as defined in Spine, or null if nonessential data was not exported. */ + /** The path to the audio folder as defined in Spine, or null if nonessential data was not exported. */ public @Null String getAudioPath () { return audioPath; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java index 2b53f7316..a9eca2d43 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java @@ -186,6 +186,7 @@ public class Skin { hashCode = placeholderName.hashCode() + slotIndex * 37; } + /** The {@link Skeleton#getSlots()} index. */ public int getSlotIndex () { return slotIndex; } @@ -195,6 +196,7 @@ public class Skin { return placeholderName; } + /** The attachment for this skin entry. */ public Attachment getAttachment () { return attachment; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slider.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slider.java index 3ae7fafd9..44c5d1ec3 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slider.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slider.java @@ -34,9 +34,9 @@ import com.esotericsoftware.spine.Animation.PhysicsConstraintTimeline; import com.esotericsoftware.spine.Animation.SlotTimeline; import com.esotericsoftware.spine.Animation.Timeline; -/** Stores the setup pose for a {@link PhysicsConstraint}. +/** Applies an animation based on either the slider's {@link SliderPose#time} or a bone's transform property. *

- * See Physics constraints in the Spine User Guide. */ + * See Sliders in the Spine User Guide. */ public class Slider extends Constraint { static private final float[] offsets = new float[6]; @@ -114,6 +114,7 @@ public class Slider extends Constraint { } } + /** When set, the bone's transform property is used to set the slider's {@link SliderPose#time}. */ public Bone getBone () { return bone; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SliderData.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SliderData.java index 01b464e32..07c2760f6 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SliderData.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SliderData.java @@ -50,6 +50,7 @@ public class SliderData extends ConstraintData { return new Slider(this, skeleton); } + /** The animation the slider will apply. */ public Animation getAnimation () { return animation; } @@ -58,6 +59,7 @@ public class SliderData extends ConstraintData { this.animation = animation; } + /** When true, the animation is applied by adding it to the current pose rather than overwriting it. */ public boolean getAdditive () { return additive; } @@ -66,6 +68,7 @@ public class SliderData extends ConstraintData { this.additive = additive; } + /** When true, the animation repeats after its duration, otherwise the last frame is used. */ public boolean getLoop () { return loop; } @@ -74,6 +77,7 @@ public class SliderData extends ConstraintData { this.loop = loop; } + /** When set, the bone's transform property is used to set the slider's {@link SliderPose#time}. */ public @Null BoneData getBone () { return bone; } @@ -82,6 +86,7 @@ public class SliderData extends ConstraintData { this.bone = bone; } + /** When a bone is set, the specified transform property is used to set the slider's {@link SliderPose#time}. */ public @Null FromProperty getProperty () { return property; } @@ -90,6 +95,7 @@ public class SliderData extends ConstraintData { this.property = property; } + /** When a bone is set, the offset is added to the property. */ public float getOffset () { return offset; } @@ -98,6 +104,7 @@ public class SliderData extends ConstraintData { this.offset = offset; } + /** When a bone is set, this is the scale of the {@link #property} value in relation to the slider time. */ public float getScale () { return scale; } @@ -106,6 +113,7 @@ public class SliderData extends ConstraintData { this.scale = scale; } + /** When true and a bone is set, the bone's local transform property is read instead of its world transform. */ public boolean getLocal () { return local; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SliderPose.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SliderPose.java index 6fe29820d..bdf833f54 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SliderPose.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SliderPose.java @@ -38,6 +38,7 @@ public class SliderPose implements Pose { mix = pose.mix; } + /** The time in the {@link SliderData#animation} to apply the animation. */ public float getTime () { return time; } @@ -46,6 +47,7 @@ public class SliderPose implements Pose { this.time = time; } + /** A percentage that controls the mix between the constrained and unconstrained poses. */ public float getMix () { return mix; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java index aefcdf5d7..9617bc278 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java @@ -31,9 +31,10 @@ package com.esotericsoftware.spine; import com.badlogic.gdx.graphics.Color; -/** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store - * state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared - * across multiple skeletons. */ +/** Organizes attachments for {@link Skeleton#drawOrder} purposes and provide a place to store state for an attachment. + *

+ * State cannot be stored in an attachment itself because attachments are stateless and may be shared across multiple + * skeletons. */ public class Slot extends Posed { final Skeleton skeleton; final Bone bone; diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotPose.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotPose.java index ec98413e0..e94068b51 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotPose.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotPose.java @@ -38,9 +38,7 @@ import com.esotericsoftware.spine.attachments.Attachment; import com.esotericsoftware.spine.attachments.Sequence; import com.esotericsoftware.spine.attachments.VertexAttachment; -/** Stores a slot's pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store state - * for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared across - * multiple skeletons. */ +/** Stores a slot's pose. */ public class SlotPose implements Pose { final Color color = new Color(1, 1, 1, 1); @Null Color darkColor; diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraint.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraint.java index 20b33fbce..f21aea9e8 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraint.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraint.java @@ -36,8 +36,7 @@ import com.badlogic.gdx.utils.Array; import com.esotericsoftware.spine.TransformConstraintData.FromProperty; import com.esotericsoftware.spine.TransformConstraintData.ToProperty; -/** Stores the current pose for a transform constraint. A transform constraint adjusts the world transform of the constrained - * bones to match that of the source bone. +/** Adjusts the world transform of the constrained bones to match that of the source bone. *

* See Transform constraints in the Spine User Guide. */ public class TransformConstraint extends Constraint { diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraintPose.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraintPose.java index 8bf7cd603..95be986e0 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraintPose.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraintPose.java @@ -42,7 +42,7 @@ public class TransformConstraintPose implements Pose { mixShearY = pose.mixShearY; } - /** A percentage (0-1) that controls the mix between the constrained and unconstrained rotation. */ + /** A percentage that controls the mix between the constrained and unconstrained rotation. */ public float getMixRotate () { return mixRotate; } @@ -51,7 +51,7 @@ public class TransformConstraintPose implements Pose { this.mixRotate = mixRotate; } - /** A percentage (0-1) that controls the mix between the constrained and unconstrained translation X. */ + /** A percentage that controls the mix between the constrained and unconstrained translation X. */ public float getMixX () { return mixX; } @@ -60,7 +60,7 @@ public class TransformConstraintPose implements Pose { this.mixX = mixX; } - /** A percentage (0-1) that controls the mix between the constrained and unconstrained translation Y. */ + /** A percentage that controls the mix between the constrained and unconstrained translation Y. */ public float getMixY () { return mixY; } @@ -69,7 +69,7 @@ public class TransformConstraintPose implements Pose { this.mixY = mixY; } - /** A percentage (0-1) that controls the mix between the constrained and unconstrained scale X. */ + /** A percentage that controls the mix between the constrained and unconstrained scale X. */ public float getMixScaleX () { return mixScaleX; } @@ -78,7 +78,7 @@ public class TransformConstraintPose implements Pose { this.mixScaleX = mixScaleX; } - /** A percentage (0-1) that controls the mix between the constrained and unconstrained scale X. */ + /** A percentage that controls the mix between the constrained and unconstrained scale X. */ public float getMixScaleY () { return mixScaleY; } @@ -87,7 +87,7 @@ public class TransformConstraintPose implements Pose { this.mixScaleY = mixScaleY; } - /** A percentage (0-1) that controls the mix between the constrained and unconstrained shear Y. */ + /** A percentage that controls the mix between the constrained and unconstrained shear Y. */ public float getMixShearY () { return mixShearY; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PointAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PointAttachment.java index a0bc4aab3..cf69bb141 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PointAttachment.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PointAttachment.java @@ -60,7 +60,7 @@ public class PointAttachment extends Attachment { color.set(other.color); } - /** The local X position. */ + /** The local x position. */ public float getX () { return x; } @@ -69,7 +69,7 @@ public class PointAttachment extends Attachment { this.x = x; } - /** The local Y position. */ + /** The local y position. */ public float getY () { return y; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/Sequence.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/Sequence.java index 7e4b32cc6..267736ba7 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/Sequence.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/Sequence.java @@ -46,6 +46,9 @@ public class Sequence { private float[][] uvs, offsets; private int start, digits, setupIndex; + /** @param count The number of texture regions this sequence will display. + * @param pathSuffix If true, the {@link #getPath(String, int) path} has a numeric suffix. If false, all regions will use the + * same path, so count should be 1. */ public Sequence (int count, boolean pathSuffix) { regions = new TextureRegion[count]; this.pathSuffix = pathSuffix; @@ -95,10 +98,12 @@ public class Sequence { } } + /** The list of texture regions this sequence will display. */ public TextureRegion[] getRegions () { return regions; } + /** Returns the {@link #getRegions()} index for the {@link SlotPose#getSequenceIndex()}. */ public int resolveIndex (SlotPose pose) { int index = pose.getSequenceIndex(); if (index == -1) index = setupIndex; @@ -106,10 +111,13 @@ public class Sequence { return index; } + /** Returns the texture region from {@link #getRegions()} for the specified index. */ public TextureRegion getRegion (int index) { return regions[index]; } + /** Returns the UVs for the specified index. {@link #getRegions() Regions} must be populated and {@link #update(HasSequence)} + * called before calling this method. */ public float[] getUVs (int index) { return uvs[index]; } @@ -119,6 +127,7 @@ public class Sequence { return offsets[index]; } + /** The starting number for the numeric {@link #getPath(String, int) path} suffix. */ public int getStart () { return start; } @@ -127,6 +136,8 @@ public class Sequence { this.start = start; } + /** The minimum number of digits in the numeric {@link #getPath(String, int) path} suffix, for zero padding. 0 for no zero + * padding. */ public int getDigits () { return digits; } @@ -144,10 +155,12 @@ public class Sequence { this.setupIndex = index; } + /** Returns true if the {@link #getPath(String, int) path} has a numeric suffix. */ public boolean hasPathSuffix () { return pathSuffix; } + /** Returns the specified base path with an optional numeric suffix for the specified index. */ public String getPath (String basePath, int index) { if (!pathSuffix) return basePath; var buffer = new StringBuilder(basePath.length() + digits); @@ -168,6 +181,7 @@ public class Sequence { return nextID++; } + /** Controls how {@link Sequence#getRegions()} are displayed over time. */ static public enum SequenceMode { hold, once, loop, pingpong, onceReverse, loopReverse, pingpongReverse;