[haxe] More documentation synchronization with reference implementation

This commit is contained in:
Mario Zechner 2025-05-22 22:11:12 +02:00
parent 6d6e85229a
commit 0c6788cd97
76 changed files with 511 additions and 352 deletions

View File

@ -70,17 +70,17 @@ class Bone implements Updatable {
public var ashearX:Float = 0; public var ashearX:Float = 0;
/** The applied local shearY. */ /** The applied local shearY. */
public var ashearY:Float = 0; public var ashearY:Float = 0;
/** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */ /** Part of the world transform matrix for the X axis. If changed, updateAppliedTransform() should be called. */
public var a:Float = 0; public var a:Float = 0;
/** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */ /** Part of the world transform matrix for the Y axis. If changed, updateAppliedTransform() should be called. */
public var b:Float = 0; public var b:Float = 0;
/** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */ /** Part of the world transform matrix for the X axis. If changed, updateAppliedTransform() should be called. */
public var c:Float = 0; public var c:Float = 0;
/** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */ /** Part of the world transform matrix for the Y axis. If changed, updateAppliedTransform() should be called. */
public var d:Float = 0; public var d:Float = 0;
/** The world X position. If changed, {@link #updateAppliedTransform()} should be called. */ /** The world X position. If changed, updateAppliedTransform() should be called. */
public var worldX:Float = 0; public var worldX:Float = 0;
/** The world Y position. If changed, {@link #updateAppliedTransform()} should be called. */ /** The world Y position. If changed, updateAppliedTransform() should be called. */
public var worldY:Float = 0; public var worldY:Float = 0;
/** Determines how parent world transforms affect this bone. */ /** Determines how parent world transforms affect this bone. */
public var inherit:Inherit = Inherit.normal; public var inherit:Inherit = Inherit.normal;
@ -115,7 +115,7 @@ class Bone implements Updatable {
return _children; return _children;
} }
/** @param parent May be null. */ /** Copy constructor. Does not copy the children bones. */
public function new(data:BoneData, skeleton:Skeleton, parent:Bone) { public function new(data:BoneData, skeleton:Skeleton, parent:Bone) {
if (data == null) if (data == null)
throw new SpineException("data cannot be null."); throw new SpineException("data cannot be null.");
@ -138,7 +138,7 @@ class Bone implements Updatable {
/** Computes the world transform using the parent bone and this bone's local transform. /** Computes the world transform using the parent bone and this bone's local transform.
* <p> * <p>
* See {@link #updateWorldTransformWith(float, float, float, float, float, float, float)}. */ * See updateWorldTransformWith(). */
public function updateWorldTransform():Void { public function updateWorldTransform():Void {
updateWorldTransformWith(x, y, rotation, scaleX, scaleY, shearX, shearY); updateWorldTransformWith(x, y, rotation, scaleX, scaleY, shearX, shearY);
} }
@ -284,7 +284,7 @@ class Bone implements Updatable {
/** Computes the applied transform values from the world transform. /** Computes the applied transform values from the world transform.
* <p> * <p>
* If the world transform is modified (by a constraint, {@link #rotateWorld(float)}, etc) then this method should be called so * If the world transform is modified (by a constraint, rotateWorld(), etc) then this method should be called so
* the applied transform matches the world transform. The applied transform may be needed by other code (eg to apply another * the applied transform matches the world transform. The applied transform may be needed by other code (eg to apply another
* constraint). * constraint).
* <p> * <p>
@ -370,58 +370,49 @@ class Bone implements Updatable {
} }
} }
/** The world rotation for the X axis, calculated using {@link #a} and {@link #c}. */ /** The world rotation for the X axis, calculated using a and c. */
public var worldRotationX(get, never):Float; public var worldRotationX(get, never):Float;
private function get_worldRotationX():Float { private function get_worldRotationX():Float {
return Math.atan2(c, a) * MathUtils.radDeg; return Math.atan2(c, a) * MathUtils.radDeg;
} }
/** The world rotation for the Y axis, calculated using {@link #b} and {@link #d}. */ /** The world rotation for the Y axis, calculated using b and d. */
public var worldRotationY(get, never):Float; public var worldRotationY(get, never):Float;
private function get_worldRotationY():Float { private function get_worldRotationY():Float {
return Math.atan2(d, b) * MathUtils.radDeg; return Math.atan2(d, b) * MathUtils.radDeg;
} }
/** The magnitude (always positive) of the world scale X, calculated using {@link #a} and {@link #c}. */ /** The magnitude (always positive) of the world scale X, calculated using a and c. */
public var worldScaleX(get, never):Float; public var worldScaleX(get, never):Float;
private function get_worldScaleX():Float { private function get_worldScaleX():Float {
return Math.sqrt(a * a + c * c); return Math.sqrt(a * a + c * c);
} }
/** The magnitude (always positive) of the world scale Y, calculated using {@link #b} and {@link #d}. */ /** The magnitude (always positive) of the world scale Y, calculated using b and d. */
public var worldScaleY(get, never):Float; public var worldScaleY(get, never):Float;
private function get_worldScaleY():Float { private function get_worldScaleY():Float {
return Math.sqrt(b * b + d * d); return Math.sqrt(b * b + d * d);
} }
/** Transforms a point from world coordinates to the parent bone's local coordinates. /** Transforms a point from world coordinates to the parent bone's local coordinates. */
* @param world The world coordinates to transform. public function worldToParent(world: Array<Float>):Array<Float> {
* @return The transformed coordinates in the parent's local space.
*/
private function worldToParent(world: Array<Float>):Array<Float> {
if (world == null) if (world == null)
throw new SpineException("world cannot be null."); throw new SpineException("world cannot be null.");
return parent == null ? world : parent.worldToLocal(world); return parent == null ? world : parent.worldToLocal(world);
} }
/** Transforms a point from the parent bone's coordinates to world coordinates. /** Transforms a point from the parent bone's coordinates to world coordinates. */
* @param world The parent coordinates to transform. public function parentToWorld(world: Array<Float>):Array<Float> {
* @return The transformed coordinates in world space.
*/
private function parentToWorld(world: Array<Float>):Array<Float> {
if (world == null) if (world == null)
throw new SpineException("world cannot be null."); throw new SpineException("world cannot be null.");
return parent == null ? world : parent.localToWorld(world); return parent == null ? world : parent.localToWorld(world);
} }
/** Transforms a point from world coordinates to the bone's local coordinates. /** Transforms a point from world coordinates to the bone's local coordinates. */
* @param world The world coordinates to transform.
* @return The transformed coordinates in local space.
*/
public function worldToLocal(world:Array<Float>):Array<Float> { public function worldToLocal(world:Array<Float>):Array<Float> {
var a:Float = a, b:Float = b, c:Float = c, d:Float = d; var a:Float = a, b:Float = b, c:Float = c, d:Float = d;
var invDet:Float = 1 / (a * d - b * c); var invDet:Float = 1 / (a * d - b * c);
@ -431,10 +422,7 @@ class Bone implements Updatable {
return world; return world;
} }
/** Transforms a point from the bone's local coordinates to world coordinates. /** Transforms a point from the bone's local coordinates to world coordinates. */
* @param local The local coordinates to transform.
* @return The transformed coordinates in world space.
*/
public function localToWorld(local:Array<Float>):Array<Float> { public function localToWorld(local:Array<Float>):Array<Float> {
var localX:Float = local[0], localY:Float = local[1]; var localX:Float = local[0], localY:Float = local[1];
local[0] = localX * a + localY * b + worldX; local[0] = localX * a + localY * b + worldX;
@ -442,20 +430,14 @@ class Bone implements Updatable {
return local; return local;
} }
/** Transforms a world rotation to a local rotation. /** Transforms a world rotation to a local rotation. */
* @param worldRotation The world rotation in degrees.
* @return The rotation in local space in degrees.
*/
public function worldToLocalRotation(worldRotation:Float):Float { public function worldToLocalRotation(worldRotation:Float):Float {
var sin:Float = MathUtils.sinDeg(worldRotation), var sin:Float = MathUtils.sinDeg(worldRotation),
cos:Float = MathUtils.cosDeg(worldRotation); cos:Float = MathUtils.cosDeg(worldRotation);
return Math.atan2(a * sin - c * cos, d * cos - b * sin) * MathUtils.radDeg + rotation - shearX; return Math.atan2(a * sin - c * cos, d * cos - b * sin) * MathUtils.radDeg + rotation - shearX;
} }
/** Transforms a local rotation to a world rotation. /** Transforms a local rotation to a world rotation. */
* @param localRotation The local rotation in degrees.
* @return The rotation in world space in degrees.
*/
public function localToWorldRotation(localRotation:Float):Float { public function localToWorldRotation(localRotation:Float):Float {
localRotation -= rotation - shearX; localRotation -= rotation - shearX;
var sin:Float = MathUtils.sinDeg(localRotation), var sin:Float = MathUtils.sinDeg(localRotation),
@ -465,10 +447,8 @@ class Bone implements Updatable {
/** Rotates the world transform the specified amount. /** Rotates the world transform the specified amount.
* <p> * <p>
* After changes are made to the world transform, {@link #updateAppliedTransform()} should be called and * After changes are made to the world transform, updateAppliedTransform() should be called and
* {@link #update(Physics)} will need to be called on any child bones, recursively. * update() will need to be called on any child bones, recursively. */
* @param degrees The rotation in degrees.
*/
public function rotateWorld(degrees:Float):Void { public function rotateWorld(degrees:Float):Void {
degrees *= MathUtils.degRad; degrees *= MathUtils.degRad;
var sin:Float = Math.sin(degrees), cos:Float = Math.cos(degrees); var sin:Float = Math.sin(degrees), cos:Float = Math.cos(degrees);

View File

@ -29,7 +29,7 @@
package spine; package spine;
/** Stores the setup pose for a {@link Bone}. */ /** Stores the setup pose for a spine.Bone. */
class BoneData { class BoneData {
private var _index:Int; private var _index:Int;
private var _name:String; private var _name:String;
@ -53,10 +53,9 @@ class BoneData {
public var shearY:Float = 0; public var shearY:Float = 0;
/** Determines how parent world transforms affect this bone. */ /** Determines how parent world transforms affect this bone. */
public var inherit:Inherit = Inherit.normal; public var inherit:Inherit = Inherit.normal;
/** When true, {@link Skeleton#updateWorldTransform()} only updates this bone if the {@link Skeleton#getSkin()} contains /** When true, spine.Skeleton.updateWorldTransform() only updates this bone if the spine.Skeleton.getSkin() contains
* this bone. * this bone.
* * @see spine.Skin.getBones() */
* See {@link Skin#getBones()}. */
public var skinRequired:Bool = false; public var skinRequired:Bool = false;
/** The color of the bone as it was in Spine, or a default color if nonessential data was not exported. Bones are not usually /** The color of the bone as it was in Spine, or a default color if nonessential data was not exported. Bones are not usually
* rendered at runtime. */ * rendered at runtime. */
@ -66,7 +65,7 @@ class BoneData {
/** False if the bone was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */ /** False if the bone was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */
public var visible:Bool = false; public var visible:Bool = false;
/** @param parent May be null. */ /** Copy constructor. */
public function new(index:Int, name:String, parent:BoneData) { public function new(index:Int, name:String, parent:BoneData) {
if (index < 0) if (index < 0)
throw new SpineException("index must be >= 0"); throw new SpineException("index must be >= 0");
@ -77,7 +76,7 @@ class BoneData {
_parent = parent; _parent = parent;
} }
/** The index of the bone in {@link Skeleton#getBones()}. */ /** The index of the bone in spine.Skeleton.getBones(). */
public var index(get, never):Int; public var index(get, never):Int;
private function get_index():Int { private function get_index():Int {
@ -87,7 +86,7 @@ class BoneData {
/** The name of the bone, which is unique across all bones in the skeleton. */ /** The name of the bone, which is unique across all bones in the skeleton. */
public var name(get, never):String; public var name(get, never):String;
function get_name():String { private function get_name():String {
return _name; return _name;
} }

View File

@ -34,12 +34,11 @@ class ConstraintData {
/** The constraint's name, which is unique across all constraints in the skeleton of the same type. */ /** The constraint's name, which is unique across all constraints in the skeleton of the same type. */
public var name:String; public var name:String;
/** The ordinal of this constraint for the order a skeleton's constraints will be applied by /** The ordinal of this constraint for the order a skeleton's constraints will be applied by
* Skeleton#updateWorldTransform(). */ * spine.Skeleton.updateWorldTransform(). */
public var order:Int = 0; public var order:Int = 0;
/** When true, Skeleton#updateWorldTransform() only updates this constraint if the Skeleton#getSkin() /** When true, spine.Skeleton.updateWorldTransform() only updates this constraint if the spine.Skeleton.getSkin()
* contains this constraint. * contains this constraint.
* * @see spine.Skin.getConstraints() */
* See Skin#getConstraints(). */
public var skinRequired:Bool = false; public var skinRequired:Bool = false;
function new(name:String, order:Int, skinRequired:Bool) { function new(name:String, order:Int, skinRequired:Bool) {

View File

@ -29,12 +29,12 @@
package spine; package spine;
/** Stores the current pose values for an {@link Event}. /** Stores the current pose values for an Event.
* <p> *
* See Timeline * @see spine.Timeline
* {@link Timeline#apply(Skeleton, float, float, com.badlogic.gdx.utils.Array, float, com.esotericsoftware.spine.Animation.MixBlend, com.esotericsoftware.spine.Animation.MixDirection)}, * @see spine.Timeline.apply()
* AnimationStateListener {@link AnimationStateListener#event(com.esotericsoftware.spine.AnimationState.TrackEntry, Event)}, and * @see spine.AnimationStateListener.event()
* <a href="https://esotericsoftware.com/spine-events">Events</a> in the Spine User Guide. */ * @see <a href="https://esotericsoftware.com/spine-events">Events</a> in the Spine User Guide. */
class Event { class Event {
private var _data:EventData; private var _data:EventData;

View File

@ -29,8 +29,8 @@
package spine; package spine;
/** Stores the setup pose values for an {@link Event}. /** Stores the setup pose values for an spine.Event.
* <p> *
* See <a href="https://esotericsoftware.com/spine-events">Events</a> in the Spine User Guide. */ * See <a href="https://esotericsoftware.com/spine-events">Events</a> in the Spine User Guide. */
class EventData { class EventData {
private var _name:String; private var _name:String;

View File

@ -30,15 +30,15 @@
package spine; package spine;
interface HasTextureRegion { interface HasTextureRegion {
/** The name used to find the {@link #region}. */ /** The name used to find the region. */
public var path:String; public var path:String;
/** Sets the region used to draw the attachment. After setting the region or if the region's properties are changed, /** Sets the region used to draw the attachment. After setting the region or if the region's properties are changed,
* {@link #updateRegion()} must be called. */ * updateRegion() must be called. */
public var region:TextureRegion; public var region:TextureRegion;
/** The color to tint the attachment. */ /** The color to tint the attachment. */
public var color:Color; public var color:Color;
public var sequence:Sequence; public var sequence:Sequence;
/** Updates any values the attachment calculates using the {@link #region}. Must be called after setting the /** Updates any values the attachment calculates using the region. Must be called after setting the
* {@link #region} or if the region's properties are changed. */ * region or if the region's properties are changed. */
public function updateRegion():Void; public function updateRegion():Void;
} }

View File

@ -46,7 +46,7 @@ class IkConstraint implements Updatable {
public var compress:Bool = false; public var compress:Bool = false;
/** When true and the target is out of range, the parent bone is scaled to reach it. /** When true and the target is out of range, the parent bone is scaled to reach it.
* <p> * <p>
* For two bone IK: 1) the child bone's local Y translation is set to 0, 2) stretch is not applied if {@link #getSoftness()} is * For two bone IK: 1) the child bone's local Y translation is set to 0, 2) stretch is not applied if getSoftness() is
* > 0, and 3) if the parent bone has local nonuniform scale, stretch is not applied. */ * > 0, and 3) if the parent bone has local nonuniform scale, stretch is not applied. */
public var stretch:Bool = false; public var stretch:Bool = false;
/** A percentage (0-1) that controls the mix between the constrained and unconstrained rotation. /** A percentage (0-1) that controls the mix between the constrained and unconstrained rotation.
@ -58,6 +58,7 @@ class IkConstraint implements Updatable {
public var softness:Float = 0; public var softness:Float = 0;
public var active:Bool = false; public var active:Bool = false;
/** Copy constructor. */
public function new(data:IkConstraintData, skeleton:Skeleton) { public function new(data:IkConstraintData, skeleton:Skeleton) {
if (data == null) if (data == null)
throw new SpineException("data cannot be null."); throw new SpineException("data cannot be null.");
@ -111,7 +112,7 @@ class IkConstraint implements Updatable {
} }
public function toString():String { public function toString():String {
return _data.name != null ? _data.name : "IkContstraint?"; return _data.name != null ? _data.name : "IkConstraint?";
} }
/** Applies 1 bone IK. The target is specified in the world coordinate system. */ /** Applies 1 bone IK. The target is specified in the world coordinate system. */

View File

@ -29,8 +29,8 @@
package spine; package spine;
/** Stores the setup pose for an {@link IkConstraint}. /** Stores the setup pose for a spine.IkConstraint.
* <p> *
* See <a href="https://esotericsoftware.com/spine-ik-constraints">IK constraints</a> in the Spine User Guide. */ * See <a href="https://esotericsoftware.com/spine-ik-constraints">IK constraints</a> in the Spine User Guide. */
class IkConstraintData extends ConstraintData { class IkConstraintData extends ConstraintData {
/** The bones that are constrained by this IK constraint. */ /** The bones that are constrained by this IK constraint. */
@ -47,10 +47,10 @@ class IkConstraintData extends ConstraintData {
public var compress:Bool = false; public var compress:Bool = false;
/** When true and the target is out of range, the parent bone is scaled to reach it. /** When true and the target is out of range, the parent bone is scaled to reach it.
* *
* For two bone IK: 1) the child bone's local Y translation is set to 0, 2) stretch is not applied if {@link #getSoftness()} is * For two bone IK: 1) the child bone's local Y translation is set to 0, 2) stretch is not applied if softness is
* > 0, and 3) if the parent bone has local nonuniform scale, stretch is not applied. */ * > 0, and 3) if the parent bone has local nonuniform scale, stretch is not applied. */
public var stretch:Bool = false; public var stretch:Bool = false;
/** When true and {@link #getCompress()} or {@link #getStretch()} is used, the bone is scaled on both the X and Y axes. */ /** When true and compress or stretch is used, the bone is scaled on both the X and Y axes. */
public var uniform:Bool = false; public var uniform:Bool = false;
/** For two bone IK, the target bone's distance from the maximum reach of the bones where rotation begins to slow. The bones /** For two bone IK, the target bone's distance from the maximum reach of the bones where rotation begins to slow. The bones
* will not straighten completely until the target is this far out of range. */ * will not straighten completely until the target is this far out of range. */

View File

@ -29,14 +29,14 @@
package spine; package spine;
/** Stores the setup pose for a {@link PathConstraint}. /** Stores the setup pose for a spine.PathConstraint.
* <p> *
* See <a href="https://esotericsoftware.com/spine-path-constraints">Path constraints</a> in the Spine User Guide. */ * See <a href="https://esotericsoftware.com/spine-path-constraints">Path constraints</a> in the Spine User Guide. */
class PathConstraintData extends ConstraintData { class PathConstraintData extends ConstraintData {
/** The bones that will be modified by this path constraint. */ /** The bones that will be modified by this path constraint. */
private var _bones:Array<BoneData> = new Array<BoneData>(); private var _bones:Array<BoneData> = new Array<BoneData>();
/** The slot whose path attachment will be used to constrained the bones. */ /** The slot whose path attachment will be used to constrain the bones. */
public var target:SlotData; public var target:SlotData;
/** The mode for positioning the first bone on the path. */ /** The mode for positioning the first bone on the path. */
public var positionMode:PositionMode = PositionMode.fixed; public var positionMode:PositionMode = PositionMode.fixed;

View File

@ -30,7 +30,7 @@
package spine; package spine;
/** Stores the current pose for a physics constraint. A physics constraint applies physics to bones. /** Stores the current pose for a physics constraint. A physics constraint applies physics to bones.
* <p> *
* See <a href="https://esotericsoftware.com/spine-physics-constraints">Physics constraints</a> in the Spine User Guide. */ * See <a href="https://esotericsoftware.com/spine-physics-constraints">Physics constraints</a> in the Spine User Guide. */
class PhysicsConstraint implements Updatable { class PhysicsConstraint implements Updatable {
private var _data:PhysicsConstraintData; private var _data:PhysicsConstraintData;
@ -42,6 +42,7 @@ class PhysicsConstraint implements Updatable {
public var massInverse:Float = 0; public var massInverse:Float = 0;
public var wind:Float = 0; public var wind:Float = 0;
public var gravity:Float = 0; public var gravity:Float = 0;
/** A percentage (0-1) that controls the mix between the constrained and unconstrained poses. */
public var mix:Float = 0; public var mix:Float = 0;
private var _reset:Bool = true; private var _reset:Bool = true;

View File

@ -44,6 +44,11 @@ typedef Function = haxe.Constraints.Function;
this.instantiator = instantiator; this.instantiator = instantiator;
} }
/**
* This pool keeps a reference to the obtained instance, so it should be returned to the pool via Pool.free(),
* Pool.freeAll() or clear() to avoid leaking memory.
* @return The obtained instance from the pool or a new instance if the pool is empty.
*/
public function obtain():T { public function obtain():T {
return this.items.length > 0 ? this.items.pop() : this.instantiator(); return this.items.length > 0 ? this.items.pop() : this.instantiator();
} }

View File

@ -29,10 +29,12 @@
package spine; package spine;
/** Controls how the first bone is positioned along the path. /**
* Controls how the first bone is positioned along the path.
* <p> * <p>
* See <a href="https://esotericsoftware.com/spine-path-constraints#Position-mode">Position mode</a> in the Spine User * See <a href="https://esotericsoftware.com/spine-path-constraints#Position-mode">Position mode</a> in the Spine User
* Guide. */ * Guide.
*/
class PositionMode { class PositionMode {
public static var fixed(default, never):PositionMode = new PositionMode("fixed"); public static var fixed(default, never):PositionMode = new PositionMode("fixed");
public static var percent(default, never):PositionMode = new PositionMode("percent"); public static var percent(default, never):PositionMode = new PositionMode("percent");

View File

@ -86,9 +86,9 @@ class Skeleton {
* <p> * <p>
* Bones that do not inherit translation are still affected by this property. */ * Bones that do not inherit translation are still affected by this property. */
public var y:Float = 0; public var y:Float = 0;
/** Returns the skeleton's time. This is used for time-based manipulations, such as {@link PhysicsConstraint}. /** Returns the skeleton's time. This is used for time-based manipulations, such as spine.PhysicsConstraint.
* <p> * <p>
* See {@link #update(float)}. */ * See Skeleton.update(). */
public var time:Float = 0; public var time:Float = 0;
/** Creates a new skeleton with the specified skeleton data. */ /** Creates a new skeleton with the specified skeleton data. */
@ -143,7 +143,7 @@ class Skeleton {
updateCache(); updateCache();
} }
/** Caches information about bones and constraints. Must be called if the {@link #getSkin()} is modified or if bones, /** Caches information about bones and constraints. Must be called if the Skeleton.skin is modified or if bones,
* constraints, or weighted path attachments are added or removed. */ * constraints, or weighted path attachments are added or removed. */
public function updateCache():Void { public function updateCache():Void {
_updateCache.resize(0); _updateCache.resize(0);
@ -463,7 +463,7 @@ class Skeleton {
return _data; return _data;
} }
/** The list of bones and constraints, sorted in the order they should be updated, as computed by {@link #updateCache()}. */ /** The list of bones and constraints, sorted in the order they should be updated, as computed by Skeleton.updateCache(). */
public var getUpdateCache(get, never):Array<Updatable>; public var getUpdateCache(get, never):Array<Updatable>;
private function get_getUpdateCache():Array<Updatable> { private function get_getUpdateCache():Array<Updatable> {
@ -524,7 +524,7 @@ class Skeleton {
/** Sets a skin by name. /** Sets a skin by name.
* <p> * <p>
* See {@link #setSkin(Skin)}. */ * See Skeleton.skin. */
private function set_skinName(skinName:String):String { private function set_skinName(skinName:String):String {
var skin:Skin = data.findSkin(skinName); var skin:Skin = data.findSkin(skinName);
if (skin == null) if (skin == null)
@ -545,14 +545,14 @@ class Skeleton {
return _skin; return _skin;
} }
/** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}. If the /** Sets the skin used to look up attachments before looking in the spine.SkeletonData default skin. If the
* skin is changed, {@link #updateCache()} is called. * skin is changed, Skeleton.updateCache() is called.
* <p> * <p>
* Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no * 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. * old skin, each slot's setup mode attachment is attached from the new skin.
* <p> * <p>
* After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling * After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling
* {@link #setSlotsToSetupPose()}. Also, often {@link AnimationState#apply(Skeleton)} is called before the next time the * Skeleton.setSlotsToSetupPose(). Also, often spine.AnimationState.apply() 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 * skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new
* skin. */ * skin. */
private function set_skin(newSkin:Skin):Skin { private function set_skin(newSkin:Skin):Skin {
@ -579,15 +579,15 @@ class Skeleton {
return _skin; return _skin;
} }
/** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot name and attachment /** Finds an attachment by looking in the Skeleton.skin and spine.SkeletonData defaultSkin using the slot name and attachment
* name. * name.
* <p> * <p>
* See {@link #getAttachment(int, String)}. */ * See Skeleton.getAttachmentForSlotIndex(). */
public function getAttachmentForSlotName(slotName:String, attachmentName:String):Attachment { public function getAttachmentForSlotName(slotName:String, attachmentName:String):Attachment {
return getAttachmentForSlotIndex(data.findSlot(slotName).index, attachmentName); return getAttachmentForSlotIndex(data.findSlot(slotName).index, attachmentName);
} }
/** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot index and /** Finds an attachment by looking in the Skeleton.skin and spine.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. * attachment name. First the skin is checked and if the attachment was not found, the default skin is checked.
* <p> * <p>
* See <a href="https://esotericsoftware.com/spine-runtime-skins">Runtime skins</a> in the Spine Runtimes Guide. */ * See <a href="https://esotericsoftware.com/spine-runtime-skins">Runtime skins</a> in the Spine Runtimes Guide. */
@ -604,8 +604,8 @@ class Skeleton {
return null; return null;
} }
/** A convenience method to set an attachment by finding the slot with {@link #findSlot(String)}, finding the attachment with /** A convenience method to set an attachment by finding the slot with Skeleton.findSlot(), finding the attachment with
* {@link #getAttachment(int, String)}, then setting the slot's {@link Slot#attachment}. * Skeleton.getAttachmentForSlotIndex(), then setting the slot's spine.Slot attachment.
* @param attachmentName May be null to clear the slot's attachment. */ * @param attachmentName May be null to clear the slot's attachment. */
public function setAttachment(slotName:String, attachmentName:String):Void { public function setAttachment(slotName:String, attachmentName:String):Void {
if (slotName == null) if (slotName == null)
@ -683,8 +683,8 @@ class Skeleton {
private var _tempVertices = new Array<Float>(); private var _tempVertices = new Array<Float>();
private var _bounds = new Rectangle(); private var _bounds = new Rectangle();
/** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose. /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose. Optionally applies
* Optionally applies clipping. */ * clipping. */
public function getBounds(clipper: SkeletonClipping = null):Rectangle { public function getBounds(clipper: SkeletonClipping = null):Rectangle {
var minX:Float = Math.POSITIVE_INFINITY; var minX:Float = Math.POSITIVE_INFINITY;
var minY:Float = Math.POSITIVE_INFINITY; var minY:Float = Math.POSITIVE_INFINITY;
@ -741,18 +741,18 @@ class Skeleton {
return _bounds; return _bounds;
} }
/** Increments the skeleton's {@link #time}. */ /** Increments the skeleton's Skeleton.time. */
public function update (delta:Float):Void { public function update (delta:Float):Void {
time += delta; time += delta;
} }
/** Calls {@link PhysicsConstraint#translate(float, float)} for each physics constraint. */ /** Calls spine.PhysicsConstraint.translate() for each physics constraint. */
public function physicsTranslate (x:Float, y:Float):Void { public function physicsTranslate (x:Float, y:Float):Void {
for (physicsConstraint in physicsConstraints) for (physicsConstraint in physicsConstraints)
physicsConstraint.translate(x, y); physicsConstraint.translate(x, y);
} }
/** Calls {@link PhysicsConstraint#rotate(float, float, float)} for each physics constraint. */ /** Calls spine.PhysicsConstraint.rotate() for each physics constraint. */
public function physicsRotate (x:Float, y:Float, degrees:Float):Void { public function physicsRotate (x:Float, y:Float, degrees:Float):Void {
for (physicsConstraint in physicsConstraints) for (physicsConstraint in physicsConstraints)
physicsConstraint.rotate(x, y, degrees); physicsConstraint.rotate(x, y, degrees);

View File

@ -82,6 +82,13 @@ import spine.attachments.PointAttachment;
import spine.attachments.RegionAttachment; import spine.attachments.RegionAttachment;
import spine.attachments.VertexAttachment; import spine.attachments.VertexAttachment;
/**
* Loads skeleton data in the Spine binary format.
* <p>
* See <a href="https://esotericsoftware.com/spine-binary-format">Spine binary format</a> and
* <a href="https://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data">JSON and binary data</a> in the Spine
* Runtimes Guide.
*/
class SkeletonBinary { class SkeletonBinary {
public var attachmentLoader:AttachmentLoader; public var attachmentLoader:AttachmentLoader;
public var scale:Float = 1; public var scale:Float = 1;

View File

@ -274,8 +274,10 @@ class SkeletonClipping {
} }
} }
/** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping /**
* area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */ * Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping
* area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list.
*/
public function clip(x1:Float, y1:Float, x2:Float, y2:Float, x3:Float, y3:Float, clippingArea:Array<Float>, output:Array<Float>):Bool { public function clip(x1:Float, y1:Float, x2:Float, y2:Float, x3:Float, y3:Float, clippingArea:Array<Float>, output:Array<Float>):Bool {
var originalOutput:Array<Float> = output; var originalOutput:Array<Float> = output;
var clipped:Bool = false; var clipped:Bool = false;

View File

@ -108,6 +108,7 @@ class SkeletonData {
/** Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it /** 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. * multiple times.
* @param boneName The name of the bone to find.
* @return May be null. */ * @return May be null. */
public function findBone(boneName:String):BoneData { public function findBone(boneName:String):BoneData {
if (boneName == null) if (boneName == null)
@ -121,6 +122,7 @@ class SkeletonData {
} }
/** Finds the index of a bone by comparing each bone's name. /** Finds the index of a bone by comparing each bone's name.
* @param boneName The name of the bone to find.
* @return -1 if the bone was not found. */ * @return -1 if the bone was not found. */
public function findBoneIndex(boneName:String):Int { public function findBoneIndex(boneName:String):Int {
if (boneName == null) if (boneName == null)
@ -136,6 +138,7 @@ class SkeletonData {
/** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it /** 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. * multiple times.
* @param slotName The name of the slot to find.
* @return May be null. */ * @return May be null. */
public function findSlot(slotName:String):SlotData { public function findSlot(slotName:String):SlotData {
if (slotName == null) if (slotName == null)
@ -152,6 +155,7 @@ class SkeletonData {
/** Finds a skin by comparing each skin's name. It is more efficient to cache the results of this method than to call it /** 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. * multiple times.
* @param skinName The name of the skin to find.
* @return May be null. */ * @return May be null. */
public function findSkin(skinName:String):Skin { public function findSkin(skinName:String):Skin {
if (skinName == null) if (skinName == null)
@ -167,6 +171,7 @@ class SkeletonData {
/** Finds an event by comparing each events's name. It is more efficient to cache the results of this method than to call it /** 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. * multiple times.
* @param eventName The name of the event to find.
* @return May be null. */ * @return May be null. */
public function findEvent(eventName:String):EventData { public function findEvent(eventName:String):EventData {
if (eventName == null) if (eventName == null)
@ -182,6 +187,7 @@ class SkeletonData {
/** Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to /** 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. * call it multiple times.
* @param animationName The name of the animation to find.
* @return May be null. */ * @return May be null. */
public function findAnimation(animationName:String):Animation { public function findAnimation(animationName:String):Animation {
if (animationName == null) if (animationName == null)
@ -197,6 +203,7 @@ class SkeletonData {
/** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method /** 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. * than to call it multiple times.
* @param constraintName The name of the IK constraint to find.
* @return May be null. */ * @return May be null. */
public function findIkConstraint(constraintName:String):IkConstraintData { public function findIkConstraint(constraintName:String):IkConstraintData {
if (constraintName == null) if (constraintName == null)
@ -212,6 +219,7 @@ class SkeletonData {
/** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of /** 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. * this method than to call it multiple times.
* @param constraintName The name of the transform constraint to find.
* @return May be null. */ * @return May be null. */
public function findTransformConstraint(constraintName:String):TransformConstraintData { public function findTransformConstraint(constraintName:String):TransformConstraintData {
if (constraintName == null) if (constraintName == null)
@ -224,6 +232,7 @@ class SkeletonData {
} }
/** Finds the index of a transform constraint by comparing each transform constraint's name. /** Finds the index of a transform constraint by comparing each transform constraint's name.
* @param transformConstraintName The name of the transform constraint to find.
* @return -1 if the transform constraint was not found. */ * @return -1 if the transform constraint was not found. */
public function findTransformConstraintIndex(transformConstraintName:String):Int { public function findTransformConstraintIndex(transformConstraintName:String):Int {
if (transformConstraintName == null) if (transformConstraintName == null)
@ -239,6 +248,7 @@ class SkeletonData {
/** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method /** 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. * than to call it multiple times.
* @param constraintName The name of the path constraint to find.
* @return May be null. */ * @return May be null. */
public function findPathConstraint(constraintName:String):PathConstraintData { public function findPathConstraint(constraintName:String):PathConstraintData {
if (constraintName == null) if (constraintName == null)
@ -252,6 +262,7 @@ class SkeletonData {
} }
/** Finds the index of a path constraint by comparing each path constraint's name. /** Finds the index of a path constraint by comparing each path constraint's name.
* @param pathConstraintName The name of the path constraint to find.
* @return -1 if the path constraint was not found. */ * @return -1 if the path constraint was not found. */
public function findPathConstraintIndex(pathConstraintName:String):Int { public function findPathConstraintIndex(pathConstraintName:String):Int {
if (pathConstraintName == null) if (pathConstraintName == null)
@ -267,10 +278,11 @@ class SkeletonData {
/** Finds a physics constraint by comparing each physics constraint's name. It is more efficient to cache the results of this /** 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 multiple times. * method than to call it multiple times.
* @param constraintName The name of the physics constraint to find.
* @return May be null. */ * @return May be null. */
public function findPhysicsConstraint(constraintName:String):PhysicsConstraintData { public function findPhysicsConstraint(constraintName:String):PhysicsConstraintData {
if (constraintName == null) if (constraintName == null)
throw new SpineException("physicsConstraintName cannot be null."); throw new SpineException("constraintName cannot be null.");
for (i in 0...physicsConstraints.length) { for (i in 0...physicsConstraints.length) {
var constraint:PhysicsConstraintData = physicsConstraints[i]; var constraint:PhysicsConstraintData = physicsConstraints[i];
if (constraint.name == constraintName) if (constraint.name == constraintName)
@ -280,6 +292,7 @@ class SkeletonData {
} }
/** Finds the index of a physics constraint by comparing each physics constraint's name. /** Finds the index of a physics constraint by comparing each physics constraint's name.
* @param constraintName The name of the physics constraint to find.
* @return -1 if the physics constraint was not found. */ * @return -1 if the physics constraint was not found. */
public function findPhysicsConstraintIndex(constraintName:String):Int { public function findPhysicsConstraintIndex(constraintName:String):Int {
if (constraintName == null) if (constraintName == null)

View File

@ -35,8 +35,8 @@ import spine.attachments.MeshAttachment;
/** Stores attachments by slot index and attachment name. /** Stores attachments by slot index and attachment name.
* *
* See SkeletonData {@link SkeletonData#defaultSkin}, Skeleton {@link Skeleton#skin}, and * See spine.SkeletonData.defaultSkin, spine.Skeleton.skin, and
* <a href="https://esotericsoftware.com/spine-runtime-skins">Runtime skins</a> in the Spine Runtimes Guide. */ * Runtime skins at https://esotericsoftware.com/spine-runtime-skins in the Spine Runtimes Guide. */
class Skin { class Skin {
private var _name:String; private var _name:String;
private var _attachments:Array<StringMap<Attachment>> = new Array<StringMap<Attachment>>(); private var _attachments:Array<StringMap<Attachment>> = new Array<StringMap<Attachment>>();
@ -215,16 +215,16 @@ class Skin {
return _constraints; return _constraints;
} }
/** The skin's name, which is unique across all skins in the skeleton. */
public var name(get, never):String; public var name(get, never):String;
/** The skin's name, which is unique across all skins in the skeleton. */
private function get_name():String { private function get_name():String {
return _name; return _name;
} }
/** The color of the skin as it was in Spine, or a default color if nonessential data was not exported. */
public var color(get, never):Color; public var color(get, never):Color;
/** The color of the skin as it was in Spine, or a default color if nonessential data was not exported. */
private function get_color():Color { private function get_color():Color {
return _color; return _color;
} }

View File

@ -32,14 +32,14 @@ package spine;
import spine.attachments.Attachment; import spine.attachments.Attachment;
import spine.attachments.VertexAttachment; import spine.attachments.VertexAttachment;
/** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store /** Stores a slot's current pose. Slots organize attachments for 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 * state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared
* across multiple skeletons. */ * across multiple skeletons. */
class Slot { class Slot {
private var _data:SlotData; private var _data:SlotData;
private var _bone:Bone; private var _bone:Bone;
/** The color used to tint the slot's attachment. If {@link #darkColor} is set, this is used as the light color for two /** The color used to tint the slot's attachment. If darkColor is set, this is used as the light color for two
* color tinting. */ * color tinting. */
public var color:Color; public var color:Color;
/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
@ -48,16 +48,15 @@ class Slot {
private var _attachment:Attachment; private var _attachment:Attachment;
/** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the /** The index of the texture region to display when the slot's attachment has a spine.attachments.Sequence. -1 represents the
* {@link Sequence#setupIndex}. */ * Sequence.getSetupIndex(). */
public var sequenceIndex = -1; public var sequenceIndex = -1;
public var attachmentState:Int = 0; public var attachmentState:Int = 0;
/** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a /** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a
* weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions. * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.
* <p> * @see spine.attachments.VertexAttachment.computeWorldVertices()
* See {@link VertexAttachment#computeWorldVertices(Slot, int, int, float[], int, int)} and {@link DeformTimeline}. */ * @see spine.animation.DeformTimeline */
public var deform:Array<Float> = new Array<Float>(); public var deform:Array<Float> = new Array<Float>();
/** Copy constructor. */ /** Copy constructor. */
@ -101,8 +100,8 @@ class Slot {
return _attachment; return _attachment;
} }
/** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}. /** Sets the slot's attachment and, if the attachment changed, resets sequenceIndex and clears the deform.
* The deform is not cleared if the old attachment has the same {@link VertexAttachment#timelineAttachment} as the * The deform is not cleared if the old attachment has the same spine.attachments.VertexAttachment.timelineAttachment as the
* specified attachment. */ * specified attachment. */
public function set_attachment(attachmentNew:Attachment):Attachment { public function set_attachment(attachmentNew:Attachment):Attachment {
if (attachment == attachmentNew) if (attachment == attachmentNew)

View File

@ -29,13 +29,13 @@
package spine; package spine;
/** Stores the setup pose for a {@link Slot}. */ /** Stores the setup pose for a spine.Slot. */
class SlotData { class SlotData {
private var _index:Int; private var _index:Int;
private var _name:String; private var _name:String;
private var _boneData:BoneData; private var _boneData:BoneData;
/** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two /** The color used to tint the slot's attachment. If SlotData.darkColor is set, this is used as the light color for two
* color tinting. */ * color tinting. */
public var color:Color = new Color(1, 1, 1, 1); public var color:Color = new Color(1, 1, 1, 1);
/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
@ -60,7 +60,7 @@ class SlotData {
_boneData = boneData; _boneData = boneData;
} }
/** The index of the slot in {@link Skeleton#getSlots()}. */ /** The index of the slot in spine.Skeleton.getSlots(). */
public var index(get, never):Int; public var index(get, never):Int;
private function get_index():Int { private function get_index():Int {

View File

@ -29,9 +29,11 @@
package spine; package spine;
/** Stores the setup pose for a {@link TransformConstraint}. /**
* <p> * Stores the setup pose for a spine.TransformConstraint.
* See <a href="https://esotericsoftware.com/spine-transform-constraints">Transform constraints</a> in the Spine User Guide. */ *
* See <a href="https://esotericsoftware.com/spine-transform-constraints">Transform constraints</a> in the Spine User Guide.
*/
class TransformConstraintData extends ConstraintData { class TransformConstraintData extends ConstraintData {
private var _bones:Array<BoneData> = new Array<BoneData>(); private var _bones:Array<BoneData> = new Array<BoneData>();
@ -68,7 +70,9 @@ class TransformConstraintData extends ConstraintData {
super(name, 0, false); super(name, 0, false);
} }
/** The bones that will be modified by this transform constraint. */ /**
* The bones that will be modified by this transform constraint.
*/
public var bones(get, never):Array<BoneData>; public var bones(get, never):Array<BoneData>;
private function get_bones():Array<BoneData> { private function get_bones():Array<BoneData> {

View File

@ -29,9 +29,6 @@
package spine; package spine;
/**
* Triangulator class used for polygon triangulation and decomposition.
*/
class Triangulator { class Triangulator {
private var convexPolygons:Array<Array<Float>> = new Array<Array<Float>>(); private var convexPolygons:Array<Array<Float>> = new Array<Array<Float>>();
private var convexPolygonsIndices:Array<Array<Int>> = new Array<Array<Int>>(); private var convexPolygonsIndices:Array<Array<Int>> = new Array<Array<Int>>();

View File

@ -29,17 +29,17 @@
package spine; package spine;
/** The interface for items updated by {@link Skeleton#updateWorldTransform(Physics)}. */ /** The interface for items updated by spine.Skeleton.updateWorldTransform(). */
interface Updatable { interface Updatable {
/** @param physics Determines how physics and other non-deterministic updates are applied. */ /** @param physics Determines how physics and other non-deterministic updates are applied. */
function update(physics:Physics):Void; function update(physics:Physics):Void;
/** Returns false when this item won't be updated by /** Returns false when this item won't be updated by
* {@link Skeleton#updateWorldTransform(Physics)} because a skin is required and the * spine.Skeleton.updateWorldTransform() because a skin is required and the
* {@link Skeleton#getSkin() active skin} does not contain this item. * active skin does not contain this item.
* @see Skin#getBones() * @see spine.Skin.getBones()
* @see Skin#getConstraints() * @see spine.Skin.getConstraints()
* @see BoneData#getSkinRequired() * @see spine.BoneData.getSkinRequired()
* @see ConstraintData#getSkinRequired() */ * @see spine.ConstraintData.getSkinRequired() */
function isActive():Bool; function isActive():Bool;
} }

View File

@ -33,7 +33,7 @@ import spine.Event;
import spine.Skeleton; import spine.Skeleton;
import spine.Slot; import spine.Slot;
/** Changes the alpha for a slot's {@link Slot#color}. */ /** Changes the alpha for a slot's spine.Slot.color. */
class AlphaTimeline extends CurveTimeline1 implements SlotTimeline { class AlphaTimeline extends CurveTimeline1 implements SlotTimeline {
private static inline var ENTRIES:Int = 4; private static inline var ENTRIES:Int = 4;
private static inline var R:Float = 1; private static inline var R:Float = 1;

View File

@ -74,25 +74,25 @@ class Animation {
} }
/** Applies the animation's timelines to the specified skeleton. /** Applies the animation's timelines to the specified skeleton.
* <p> *
* See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}. * See Timeline.apply().
* @param skeleton The skeleton the animation is being applied to. This provides access to the bones, slots, and other skeleton * @param skeleton The skeleton the animation is being applied to. This provides access to the bones, slots, and other skeleton
* components the timelines may change. * components the timelines may change.
* @param lastTime The last time in seconds this animation was applied. Some timelines trigger only at specific times rather * @param lastTime The last time in seconds this animation was applied. Some timelines trigger only at specific times rather
* than every frame. Pass -1 the first time an animation is applied to ensure frame 0 is triggered. * than every frame. Pass -1 the first time an animation is applied to ensure frame 0 is triggered.
* @param time The time in seconds the skeleton is being posed for. Most timelines find the frame before and the frame after * @param time The time in seconds the skeleton is being posed for. Most timelines find the frame before and the frame after
* this time and interpolate between the frame values. If beyond the {@link #getDuration()} and <code>loop</code> is * this time and interpolate between the frame values. If beyond the duration and loop is
* true then the animation will repeat, else the last frame will be applied. * true then the animation will repeat, else the last frame will be applied.
* @param loop If true, the animation repeats after the {@link #getDuration()}. * @param loop If true, the animation repeats after the duration.
* @param events If any events are fired, they are added to this list. Can be null to ignore fired events or if no timelines * @param events If any events are fired, they are added to this list. Can be null to ignore fired events or if no timelines
* fire events. * fire events.
* @param alpha 0 applies the current or setup values (depending on <code>blend</code>). 1 applies the timeline values. Between * @param alpha 0 applies the current or setup values (depending on blend). 1 applies the timeline values. Between
* 0 and 1 applies values between the current or setup values and the timeline values. By adjusting * 0 and 1 applies values between the current or setup values and the timeline values. By adjusting
* <code>alpha</code> over time, an animation can be mixed in or out. <code>alpha</code> can also be useful to apply * alpha over time, an animation can be mixed in or out. alpha can also be useful to apply
* animations on top of each other (layering). * animations on top of each other (layering).
* @param blend Controls how mixing is applied when <code>alpha</code> < 1. * @param blend Controls how mixing is applied when alpha < 1.
* @param direction Indicates whether the timelines are mixing in or out. Used by timelines which perform instant transitions, * @param direction Indicates whether the timelines are mixing in or out. Used by timelines which perform instant transitions,
* such as {@link DrawOrderTimeline} or {@link AttachmentTimeline}. */ * such as DrawOrderTimeline or AttachmentTimeline. */
public function apply(skeleton:Skeleton, lastTime:Float, time:Float, loop:Bool, events:Array<Event>, alpha:Float, blend:MixBlend, public function apply(skeleton:Skeleton, lastTime:Float, time:Float, loop:Bool, events:Array<Event>, alpha:Float, blend:MixBlend,
direction:MixDirection):Void { direction:MixDirection):Void {
if (skeleton == null) if (skeleton == null)
@ -109,9 +109,9 @@ class Animation {
} }
} }
/** The animation's name, which is unique across all animations in the skeleton. */
public var name(get, never):String; public var name(get, never):String;
/** The animation's name, which is unique across all animations in the skeleton. */
private function get_name():String { private function get_name():String {
return _name; return _name;
} }
@ -120,9 +120,9 @@ class Animation {
return _name; return _name;
} }
/** If the returned array or the timelines it contains are modified, setTimelines() must be called. */
public var timelines(get, never):Array<Timeline>; public var timelines(get, never):Array<Timeline>;
/** If the returned array or the timelines it contains are modified, {@link #setTimelines(Array)} must be called. */
private function get_timelines():Array<Timeline> { private function get_timelines():Array<Timeline> {
return _timelines; return _timelines;
} }

View File

@ -35,11 +35,52 @@ import spine.Event;
import spine.Pool; import spine.Pool;
import spine.Skeleton; import spine.Skeleton;
/**
* Applies animations over time, queues animations for later playback, mixes (crossfading) between animations, and applies
* multiple animations on top of each other (layering).
* <p>
* See <a href='https://esotericsoftware.com/spine-applying-animations/'>Applying Animations</a> in the Spine Runtimes Guide.
*/
class AnimationState { class AnimationState {
/**
* 1) A previously applied timeline has set this property.<br>
* Result: Mix from the current pose to the timeline pose.
*/
public static inline var SUBSEQUENT:Int = 0; public static inline var SUBSEQUENT:Int = 0;
/**
* 1) This is the first timeline to set this property.<br>
* 2) The next track entry applied after this one does not have a timeline to set this property.<br>
* Result: Mix from the setup pose to the timeline pose.
*/
public static inline var FIRST:Int = 1; public static inline var FIRST:Int = 1;
/**
* 1) A previously applied timeline has set this property.<br>
* 2) The next track entry to be applied does have a timeline to set this property.<br>
* 3) The next track entry after that one does not have a timeline to set this property.<br>
* Result: Mix from the current pose to the timeline pose, but do not mix out. This avoids "dipping" when crossfading
* animations that key the same property. A subsequent timeline will set this property using a mix.
*/
public static inline var HOLD_SUBSEQUENT:Int = 2; public static inline var HOLD_SUBSEQUENT:Int = 2;
/**
* 1) This is the first timeline to set this property.<br>
* 2) The next track entry to be applied does have a timeline to set this property.<br>
* 3) The next track entry after that one does not have a timeline to set this property.<br>
* Result: Mix from the setup pose to the timeline pose, but do not mix out. This avoids "dipping" when crossfading animations
* that key the same property. A subsequent timeline will set this property using a mix.
*/
public static inline var HOLD_FIRST:Int = 3; public static inline var HOLD_FIRST:Int = 3;
/**
* 1) This is the first timeline to set this property.<br>
* 2) The next track entry to be applied does have a timeline to set this property.<br>
* 3) The next track entry after that one does have a timeline to set this property.<br>
* 4) timelineHoldMix stores the first subsequent track entry that does not have a timeline to set this property.<br>
* Result: The same as HOLD except the mix percentage from the timelineHoldMix track entry is used. This handles when more than
* 2 track entries in a row have a timeline that sets the same property.<br>
* Eg, A -> B -> C -> D where A, B, and C have a timeline setting same property, but D does not. When A is applied, to avoid
* "dipping" A is not mixed out, however D (the first entry that doesn't set the property) mixing in is used to mix out A
* (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap to the mixed
* out position.
*/
public static inline var HOLD_MIX:Int = 4; public static inline var HOLD_MIX:Int = 4;
public static inline var SETUP:Int = 1; public static inline var SETUP:Int = 1;
public static inline var CURRENT:Int = 2; public static inline var CURRENT:Int = 2;
@ -67,6 +108,9 @@ class AnimationState {
private var unkeyedState:Int = 0; private var unkeyedState:Int = 0;
/**
* Creates an uninitialized AnimationState. The animation state data must be set before use.
*/
public function new(data:AnimationStateData) { public function new(data:AnimationStateData) {
if (data == null) if (data == null)
throw new SpineException("data can not be null"); throw new SpineException("data can not be null");
@ -77,6 +121,9 @@ class AnimationState {
}); });
} }
/**
* Increments each track entry spine.animation.TrackEntry.getTrackTime(), setting queued animations as current if needed.
*/
public function update(delta:Float):Void { public function update(delta:Float):Void {
delta *= timeScale; delta *= timeScale;
for (i in 0...tracks.length) { for (i in 0...tracks.length) {
@ -138,6 +185,9 @@ class AnimationState {
queue.drain(); queue.drain();
} }
/**
* Returns true when all mixing from entries are complete.
*/
private function updateMixingFrom(to:TrackEntry, delta:Float):Bool { private function updateMixingFrom(to:TrackEntry, delta:Float):Bool {
var from:TrackEntry = to.mixingFrom; var from:TrackEntry = to.mixingFrom;
if (from == null) if (from == null)
@ -165,6 +215,11 @@ class AnimationState {
return false; return false;
} }
/**
* Poses the skeleton using the track entry animations. The animation state is not changed, so can be applied to multiple
* skeletons to pose them identically.
* @return True if any animations were applied.
*/
public function apply(skeleton:Skeleton):Bool { public function apply(skeleton:Skeleton):Bool {
if (skeleton == null) if (skeleton == null)
throw new SpineException("skeleton cannot be null."); throw new SpineException("skeleton cannot be null.");
@ -350,6 +405,12 @@ class AnimationState {
return mix; return mix;
} }
/**
* Applies the attachment timeline and sets spine.Slot.attachmentState.
* @param attachments False when: 1) the attachment timeline is mixing out, 2) mix < attachmentThreshold, and 3) the timeline
* is not the last timeline to set the slot's attachment. In that case the timeline is applied only so subsequent
* timelines see any deform.
*/
public function applyAttachmentTimeline(timeline:AttachmentTimeline, skeleton:Skeleton, time:Float, blend:MixBlend, attachments:Bool) { public function applyAttachmentTimeline(timeline:AttachmentTimeline, skeleton:Skeleton, time:Float, blend:MixBlend, attachments:Bool) {
var slot = skeleton.slots[timeline.slotIndex]; var slot = skeleton.slots[timeline.slotIndex];
if (!slot.bone.active) if (!slot.bone.active)
@ -366,6 +427,10 @@ class AnimationState {
slot.attachmentState = this.unkeyedState + SETUP; slot.attachmentState = this.unkeyedState + SETUP;
} }
/**
* Applies the rotate timeline, mixing with the current pose while keeping the same rotation direction chosen as the shortest
* the first time the mixing was applied.
*/
public function applyRotateTimeline(timeline:RotateTimeline, skeleton:Skeleton, time:Float, alpha:Float, blend:MixBlend, timelinesRotation:Array<Float>, public function applyRotateTimeline(timeline:RotateTimeline, skeleton:Skeleton, time:Float, alpha:Float, blend:MixBlend, timelinesRotation:Array<Float>,
i:Int, firstFrame:Bool) { i:Int, firstFrame:Bool) {
if (firstFrame) if (firstFrame)
@ -481,6 +546,12 @@ class AnimationState {
} }
} }
/**
* Removes all animations from all tracks, leaving skeletons in their current pose.
* <p>
* It may be desired to use spine.animation.AnimationState.setEmptyAnimations() to mix the skeletons back to the setup pose,
* rather than leaving them in their current pose.
*/
public function clearTracks():Void { public function clearTracks():Void {
var oldTrainDisabled:Bool = queue.drainDisabled; var oldTrainDisabled:Bool = queue.drainDisabled;
queue.drainDisabled = true; queue.drainDisabled = true;
@ -492,6 +563,12 @@ class AnimationState {
queue.drain(); queue.drain();
} }
/**
* Removes all animations from the track, leaving skeletons in their current pose.
* <p>
* It may be desired to use spine.animation.AnimationState.setEmptyAnimation() to mix the skeletons back to the setup pose,
* rather than leaving them in their current pose.
*/
public function clearTrack(trackIndex:Int):Void { public function clearTrack(trackIndex:Int):Void {
if (trackIndex >= tracks.length) if (trackIndex >= tracks.length)
return; return;
@ -540,6 +617,11 @@ class AnimationState {
queue.start(current); queue.start(current);
} }
/**
* Sets an animation by name.
* <p>
* See spine.animation.AnimationState.setAnimation().
*/
public function setAnimationByName(trackIndex:Int, animationName:String, loop:Bool):TrackEntry { public function setAnimationByName(trackIndex:Int, animationName:String, loop:Bool):TrackEntry {
var animation:Animation = data.skeletonData.findAnimation(animationName); var animation:Animation = data.skeletonData.findAnimation(animationName);
if (animation == null) if (animation == null)
@ -547,6 +629,14 @@ class AnimationState {
return setAnimation(trackIndex, animation, loop); return setAnimation(trackIndex, animation, loop);
} }
/**
* Sets the current animation for a track, discarding any queued animations. If the formerly current track entry was never
* applied to a skeleton, it is replaced (not mixed from).
* @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its
* duration. In either case spine.animation.TrackEntry.getTrackEnd() determines when the track is cleared.
* @return A track entry to allow further customization of animation playback. References to the track entry must not be kept
* after the spine.animation.AnimationStateListener.dispose() event occurs.
*/
public function setAnimation(trackIndex:Int, animation:Animation, loop:Bool):TrackEntry { public function setAnimation(trackIndex:Int, animation:Animation, loop:Bool):TrackEntry {
if (animation == null) if (animation == null)
throw new SpineException("animation cannot be null."); throw new SpineException("animation cannot be null.");
@ -571,6 +661,11 @@ class AnimationState {
return entry; return entry;
} }
/**
* Queues an animation by name.
* <p>
* See spine.animation.AnimationState.addAnimation().
*/
public function addAnimationByName(trackIndex:Int, animationName:String, loop:Bool, delay:Float):TrackEntry { public function addAnimationByName(trackIndex:Int, animationName:String, loop:Bool, delay:Float):TrackEntry {
var animation:Animation = data.skeletonData.findAnimation(animationName); var animation:Animation = data.skeletonData.findAnimation(animationName);
if (animation == null) if (animation == null)
@ -578,6 +673,16 @@ class AnimationState {
return addAnimation(trackIndex, animation, loop, delay); return addAnimation(trackIndex, animation, loop, delay);
} }
/**
* Adds an animation to be played after the current or last queued animation for a track. If the track is empty, it is
* equivalent to calling spine.animation.AnimationState.setAnimation().
* @param delay If > 0, sets spine.animation.TrackEntry.getDelay(). If <= 0, the delay set is the duration of the previous track entry
* minus any mix duration (from the spine.animation.AnimationStateData) plus the specified delay (ie the mix
* ends at (delay = 0) or before (delay < 0) the previous track entry duration). If the
* previous entry is looping, its next loop completion is used instead of its duration.
* @return A track entry to allow further customization of animation playback. References to the track entry must not be kept
* after the spine.animation.AnimationStateListener.dispose() event occurs.
*/
public function addAnimation(trackIndex:Int, animation:Animation, loop:Bool, delay:Float):TrackEntry { public function addAnimation(trackIndex:Int, animation:Animation, loop:Bool, delay:Float):TrackEntry {
if (animation == null) if (animation == null)
throw new SpineException("animation cannot be null."); throw new SpineException("animation cannot be null.");
@ -605,6 +710,23 @@ class AnimationState {
return entry; return entry;
} }
/**
* Sets an empty animation for a track, discarding any queued animations, and sets the track entry's
* spine.animation.TrackEntry.getMixDuration(). An empty animation has no timelines and serves as a placeholder for mixing in or out.
* <p>
* Mixing out is done by setting an empty animation with a mix duration using either spine.animation.AnimationState.setEmptyAnimation(),
* spine.animation.AnimationState.setEmptyAnimations(), or spine.animation.AnimationState.addEmptyAnimation(). Mixing to an empty animation causes
* the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation
* transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of
* 0 still mixes out over one frame.
* <p>
* Mixing in is done by first setting an empty animation, then adding an animation using
* spine.animation.AnimationState.addAnimation() with the desired delay (an empty animation has a duration of 0) and on
* the returned track entry, set the spine.animation.TrackEntry.setMixDuration(). Mixing from an empty animation causes the new
* animation to be applied more and more over the mix duration. Properties keyed in the new animation transition from the value
* from lower tracks or from the setup pose value if no lower tracks key the property to the value keyed in the new
* animation.
*/
public function setEmptyAnimation(trackIndex:Int, mixDuration:Float):TrackEntry { public function setEmptyAnimation(trackIndex:Int, mixDuration:Float):TrackEntry {
var entry:TrackEntry = setAnimation(trackIndex, emptyAnimation, false); var entry:TrackEntry = setAnimation(trackIndex, emptyAnimation, false);
entry.mixDuration = mixDuration; entry.mixDuration = mixDuration;
@ -612,6 +734,19 @@ class AnimationState {
return entry; return entry;
} }
/**
* Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's
* spine.animation.TrackEntry.getMixDuration(). If the track is empty, it is equivalent to calling
* spine.animation.AnimationState.setEmptyAnimation().
* <p>
* See spine.animation.AnimationState.setEmptyAnimation().
* @param delay If > 0, sets spine.animation.TrackEntry.getDelay(). If <= 0, the delay set is the duration of the previous track entry
* minus any mix duration plus the specified delay (ie the mix ends at (delay = 0) or
* before (delay < 0) the previous track entry duration). If the previous entry is looping, its next
* loop completion is used instead of its duration.
* @return A track entry to allow further customization of animation playback. References to the track entry must not be kept
* after the spine.animation.AnimationStateListener.dispose() event occurs.
*/
public function addEmptyAnimation(trackIndex:Int, mixDuration:Float, delay:Float):TrackEntry { public function addEmptyAnimation(trackIndex:Int, mixDuration:Float, delay:Float):TrackEntry {
var entry:TrackEntry = addAnimation(trackIndex, emptyAnimation, false, delay); var entry:TrackEntry = addAnimation(trackIndex, emptyAnimation, false, delay);
if (delay <= 0) entry.delay = Math.max(entry.delay + entry.mixDuration - mixDuration, 0); if (delay <= 0) entry.delay = Math.max(entry.delay + entry.mixDuration - mixDuration, 0);
@ -620,6 +755,10 @@ class AnimationState {
return entry; return entry;
} }
/**
* Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix
* duration.
*/
public function setEmptyAnimations(mixDuration:Float):Void { public function setEmptyAnimations(mixDuration:Float):Void {
var oldDrainDisabled:Bool = queue.drainDisabled; var oldDrainDisabled:Bool = queue.drainDisabled;
queue.drainDisabled = true; queue.drainDisabled = true;
@ -675,7 +814,9 @@ class AnimationState {
return entry; return entry;
} }
/** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */ /**
* Removes the spine.animation.TrackEntry.getNext() next entry and all entries after it for the specified entry.
*/
public function clearNext(entry:TrackEntry):Void { public function clearNext(entry:TrackEntry):Void {
var next:TrackEntry = entry.next; var next:TrackEntry = entry.next;
while (next != null) { while (next != null) {
@ -757,6 +898,9 @@ class AnimationState {
} }
} }
/**
* Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing.
*/
public function getCurrent(trackIndex:Int):TrackEntry { public function getCurrent(trackIndex:Int):TrackEntry {
if (trackIndex >= tracks.length) if (trackIndex >= tracks.length)
return null; return null;
@ -769,6 +913,9 @@ class AnimationState {
return onComplete.listeners.length > 0 || onEnd.listeners.length > 0; return onComplete.listeners.length > 0 || onEnd.listeners.length > 0;
} }
/**
* Removes all listeners added with spine.animation.AnimationState.addListener().
*/
public function clearListeners():Void { public function clearListeners():Void {
onStart.listeners.resize(0); onStart.listeners.resize(0);
onInterrupt.listeners.resize(0); onInterrupt.listeners.resize(0);
@ -778,6 +925,11 @@ class AnimationState {
onEvent.listeners.resize(0); onEvent.listeners.resize(0);
} }
/**
* Discards all listener notifications that have not yet been delivered. This can be useful to call from an
* spine.animation.AnimationStateListener when it is known that further notifications that may have been already queued for delivery
* are not wanted because new animations are being set.
*/
public function clearListenerNotifications():Void { public function clearListenerNotifications():Void {
queue.clear(); queue.clear();
} }

View File

@ -32,7 +32,7 @@ package spine.animation;
import haxe.ds.StringMap; import haxe.ds.StringMap;
import spine.SkeletonData; import spine.SkeletonData;
/** Stores mix (crossfade) durations to be applied when {@link AnimationState} animations are changed. */ /** Stores mix (crossfade) durations to be applied when spine.animation.AnimationState animations are changed. */
class AnimationStateData { class AnimationStateData {
private var _skeletonData:SkeletonData; private var _skeletonData:SkeletonData;
private var animationToMixTime:StringMap<Float> = new StringMap<Float>(); private var animationToMixTime:StringMap<Float> = new StringMap<Float>();
@ -53,7 +53,7 @@ class AnimationStateData {
/** Sets a mix duration by animation name. /** Sets a mix duration by animation name.
* *
* See {@link #setMix(Animation, Animation, float)}. */ * See AnimationStateData.setMix(). */
public function setMixByName(fromName:String, toName:String, duration:Float):Void { public function setMixByName(fromName:String, toName:String, duration:Float):Void {
var from:Animation = _skeletonData.findAnimation(fromName); var from:Animation = _skeletonData.findAnimation(fromName);
if (from == null) if (from == null)
@ -66,7 +66,7 @@ class AnimationStateData {
/** Sets the mix duration when changing from the specified animation to the other. /** Sets the mix duration when changing from the specified animation to the other.
* *
* See {@link TrackEntry#mixDuration}. */ * See spine.animation.TrackEntry.mixDuration. */
public function setMix(from:Animation, to:Animation, duration:Float):Void { public function setMix(from:Animation, to:Animation, duration:Float):Void {
if (from == null) if (from == null)
throw new SpineException("from cannot be null."); throw new SpineException("from cannot be null.");
@ -75,7 +75,7 @@ class AnimationStateData {
animationToMixTime.set(from.name + ":" + to.name, duration); animationToMixTime.set(from.name + ":" + to.name, duration);
} }
/** Returns the mix duration to use when changing from the specified animation to the other, or the {@link #defaultMix} if /** Returns the mix duration to use when changing from the specified animation to the other, or the AnimationStateData.defaultMix if
* no mix duration has been set. */ * no mix duration has been set. */
public function getMix(from:Animation, to:Animation):Float { public function getMix(from:Animation, to:Animation):Float {
if (animationToMixTime.exists(from.name + ":" + to.name)) if (animationToMixTime.exists(from.name + ":" + to.name))

View File

@ -33,7 +33,7 @@ import spine.Event;
import spine.Skeleton; import spine.Skeleton;
import spine.Slot; import spine.Slot;
/** Changes a slot's attachment. */ /** Changes a slot's spine.Slot.attachment. */
class AttachmentTimeline extends Timeline implements SlotTimeline { class AttachmentTimeline extends Timeline implements SlotTimeline {
public var slotIndex:Int = 0; public var slotIndex:Int = 0;

View File

@ -31,6 +31,6 @@ package spine.animation;
/** An interface for timelines which change the property of a bone. */ /** An interface for timelines which change the property of a bone. */
interface BoneTimeline { interface BoneTimeline {
/** The index of the bone in {@link Skeleton#getBones()} that will be changed when this timeline is applied. */ /** The index of the bone in spine.Skeleton.getBones() that will be changed when this timeline is applied. */
function getBoneIndex():Int; function getBoneIndex():Int;
} }

View File

@ -38,7 +38,7 @@ class CurveTimeline extends Timeline {
private var curves:Array<Float>; // type, x, y, ... private var curves:Array<Float>; // type, x, y, ...
/** @param bezierCount The maximum number of Bezier curves. See {@link #shrink(int)}. /** @param bezierCount The maximum number of Bezier curves. See CurveTimeline.shrink().
* @param propertyIds Unique identifiers for the properties the timeline modifies. */ * @param propertyIds Unique identifiers for the properties the timeline modifies. */
public function new(frameCount:Int, bezierCount:Int, propertyIds:Array<String>) { public function new(frameCount:Int, bezierCount:Int, propertyIds:Array<String>) {
super(frameCount, propertyIds); super(frameCount, propertyIds);
@ -109,9 +109,9 @@ class CurveTimeline extends Timeline {
} }
/** Returns the Bezier interpolated value for the specified time. /** Returns the Bezier interpolated value for the specified time.
* @param frameIndex The index into {@link #getFrames()} for the values of the frame before <code>time</code>. * @param frameIndex The index into Timeline.getFrames() for the values of the frame before <code>time</code>.
* @param valueOffset The offset from <code>frameIndex</code> to the value this curve is used for. * @param valueOffset The offset from <code>frameIndex</code> to the value this curve is used for.
* @param i The index of the Bezier segments. See {@link #getCurveType}. */ * @param i The index of the Bezier segments. See CurveTimeline.getCurveType(). */
public function getBezierValue(time:Float, frameIndex:Int, valueOffset:Int, i:Int):Float { public function getBezierValue(time:Float, frameIndex:Int, valueOffset:Int, i:Int):Float {
var x:Float, y:Float; var x:Float, y:Float;
if (curves[i] > time) { if (curves[i] > time) {

View File

@ -29,12 +29,13 @@
package spine.animation; package spine.animation;
/** The base class for a {@link CurveTimeline} that sets one property. */ /** The base class for a spine.animation.CurveTimeline that sets one property. */
class CurveTimeline1 extends CurveTimeline { class CurveTimeline1 extends CurveTimeline {
private static inline var ENTRIES:Int = 2; private static inline var ENTRIES:Int = 2;
private static inline var VALUE:Int = 1; private static inline var VALUE:Int = 1;
/** @param bezierCount The maximum number of Bezier curves. See {@link #shrink(Int)}. /** @param frameCount The number of frames in the timeline.
* @param bezierCount The maximum number of Bezier curves. See spine.animation.CurveTimeline.shrink().
* @param propertyIds Unique identifiers for the properties the timeline modifies. */ * @param propertyIds Unique identifiers for the properties the timeline modifies. */
public function new(frameCount:Int, bezierCount:Int, propertyIds:Array<String>) { public function new(frameCount:Int, bezierCount:Int, propertyIds:Array<String>) {
super(frameCount, bezierCount, propertyIds); super(frameCount, bezierCount, propertyIds);

View File

@ -29,14 +29,15 @@
package spine.animation; package spine.animation;
/** The base class for a {@link CurveTimeline} which sets two properties. */ /** The base class for a spine.animation.CurveTimeline which sets two properties. */
class CurveTimeline2 extends CurveTimeline { class CurveTimeline2 extends CurveTimeline {
private static inline var ENTRIES:Int = 3; private static inline var ENTRIES:Int = 3;
private static inline var VALUE1:Int = 1; private static inline var VALUE1:Int = 1;
private static inline var VALUE2:Int = 2; private static inline var VALUE2:Int = 2;
/** @param bezierCount The maximum number of Bezier curves. See {@link #shrink(Int)}. /** @param frameCount The number of frames in the timeline.
* @param propertyIds Unique identifiers for the properties the timeline modifies. */ * @param bezierCount The maximum number of Bezier curves. See spine.animation.CurveTimeline.shrink().
* @param propertyIds Array of unique identifiers for the properties the timeline modifies. */
public function new(frameCount:Int, bezierCount:Int, propertyIds:Array<String>) { public function new(frameCount:Int, bezierCount:Int, propertyIds:Array<String>) {
super(frameCount, bezierCount, propertyIds); super(frameCount, bezierCount, propertyIds);
} }

View File

@ -36,13 +36,13 @@ import spine.Event;
import spine.Skeleton; import spine.Skeleton;
import spine.Slot; import spine.Slot;
/** Changes a slot's {@link Slot#getDeform()} to deform a {@link VertexAttachment}. */ /** Changes a slot's spine.Slot.deform to deform a spine.attachments.VertexAttachment. */
class DeformTimeline extends CurveTimeline implements SlotTimeline { class DeformTimeline extends CurveTimeline implements SlotTimeline {
public var slotIndex:Int = 0; public var slotIndex:Int = 0;
/** The attachment that will be deformed. /** The attachment that will be deformed.
* <p> *
* See {@link VertexAttachment#getTimelineAttachment()}. */ * @see spine.attachments.VertexAttachment.getTimelineAttachment() */
public var attachment:VertexAttachment; public var attachment:VertexAttachment;
/** The vertices for each frame. */ /** The vertices for each frame. */

View File

@ -35,7 +35,7 @@ import spine.Slot;
/** Changes a skeleton's {@link Skeleton#drawOrder}. */ /** Changes a skeleton's {@link Skeleton#drawOrder}. */
class DrawOrderTimeline extends Timeline { class DrawOrderTimeline extends Timeline {
/** The draw order for each frame. See {@link #setFrame(Int, Float, Array<Int>)}. */ /** The draw order for each frame. See setFrame(). */
public var drawOrders:Array<Array<Int>>; public var drawOrders:Array<Array<Int>>;
public function new(frameCount:Int) { public function new(frameCount:Int) {
@ -53,7 +53,7 @@ class DrawOrderTimeline extends Timeline {
/** Sets the time and draw order for the specified frame. /** Sets the time and draw order for the specified frame.
* @param frame Between 0 and <code>frameCount</code>, inclusive. * @param frame Between 0 and <code>frameCount</code>, inclusive.
* @param time The frame time in seconds. * @param time The frame time in seconds.
* @param drawOrder For each slot in {@link Skeleton#slots}, the index of the slot in the new draw order. May be null to use setup pose draw order. */ * @param drawOrder For each slot in spine.Skeleton.slots, the index of the slot in the new draw order. May be null to use setup pose draw order. */
public function setFrame(frame:Int, time:Float, drawOrder:Array<Int>):Void { public function setFrame(frame:Int, time:Float, drawOrder:Array<Int>):Void {
frames[frame] = time; frames[frame] = time;
drawOrders[frame] = drawOrder; drawOrders[frame] = drawOrder;

View File

@ -33,7 +33,7 @@ import spine.animation.Timeline;
import spine.Event; import spine.Event;
import spine.Skeleton; import spine.Skeleton;
/** Fires an {@link Event} when specific animation times are reached. */ /** Fires an spine.Event when specific animation times are reached. */
class EventTimeline extends Timeline { class EventTimeline extends Timeline {
/** The event for each frame. */ /** The event for each frame. */
public var events:Array<Event>; public var events:Array<Event>;
@ -49,8 +49,7 @@ class EventTimeline extends Timeline {
} }
/** Sets the time and event for the specified frame. /** Sets the time and event for the specified frame.
* @param frame Between 0 and <code>frameCount</code>, inclusive. * @param frame Between 0 and <code>frameCount</code>, inclusive. */
* @param event The event to set for the frame. */
public function setFrame(frame:Int, event:Event):Void { public function setFrame(frame:Int, event:Event):Void {
frames[frame] = event.time; frames[frame] = event.time;
events[frame] = event; events[frame] = event;

View File

@ -29,9 +29,6 @@
package spine.animation; package spine.animation;
/**
* Animation state event type.
*/
class EventType { class EventType {
public static var start(default, never):EventType = new EventType(); public static var start(default, never):EventType = new EventType();
public static var interrupt(default, never):EventType = new EventType(); public static var interrupt(default, never):EventType = new EventType();

View File

@ -33,8 +33,8 @@ import spine.Event;
import spine.IkConstraint; import spine.IkConstraint;
import spine.Skeleton; import spine.Skeleton;
/** Changes an IK constraint's {@link IkConstraint#mix}, {@link IkConstraint#softness}, /** Changes an IK constraint's spine.IkConstraint.mix, spine.IkConstraint.softness,
* {@link IkConstraint#bendDirection}, {@link IkConstraint#stretch}, and {@link IkConstraint#compress}. */ * spine.IkConstraint.bendDirection, spine.IkConstraint.stretch, and spine.IkConstraint.compress. */
class IkConstraintTimeline extends CurveTimeline { class IkConstraintTimeline extends CurveTimeline {
private static inline var ENTRIES:Int = 6; private static inline var ENTRIES:Int = 6;
private static inline var MIX:Int = 1; private static inline var MIX:Int = 1;
@ -43,7 +43,7 @@ class IkConstraintTimeline extends CurveTimeline {
private static inline var COMPRESS:Int = 4; private static inline var COMPRESS:Int = 4;
private static inline var STRETCH:Int = 5; private static inline var STRETCH:Int = 5;
/** The index of the IK constraint in {@link Skeleton#ikConstraints} that will be changed when this timeline is /** The index of the IK constraint in spine.Skeleton.ikConstraints that will be changed when this timeline is
* applied. */ * applied. */
public var constraintIndex:Int = 0; public var constraintIndex:Int = 0;
@ -59,11 +59,7 @@ class IkConstraintTimeline extends CurveTimeline {
/** Sets the time, mix, softness, bend direction, compress, and stretch for the specified frame. /** Sets the time, mix, softness, bend direction, compress, and stretch for the specified frame.
* @param frame Between 0 and <code>frameCount</code>, inclusive. * @param frame Between 0 and <code>frameCount</code>, inclusive.
* @param time The frame time in seconds. * @param time The frame time in seconds.
* @param mix The mix value. * @param bendDirection 1 or -1. */
* @param softness The softness value.
* @param bendDirection 1 or -1.
* @param compress Whether to compress.
* @param stretch Whether to stretch. */
public function setFrame(frame:Int, time:Float, mix:Float, softness:Float, bendDirection:Int, compress:Bool, stretch:Bool):Void { public function setFrame(frame:Int, time:Float, mix:Float, softness:Float, bendDirection:Int, compress:Bool, stretch:Bool):Void {
frame *= ENTRIES; frame *= ENTRIES;
frames[frame] = time; frames[frame] = time;

View File

@ -33,7 +33,7 @@ import spine.Bone;
import spine.Event; import spine.Event;
import spine.Skeleton; import spine.Skeleton;
/** Changes a bone's {@link Bone#getInherit()}. */ /** Changes a bone's spine.Bone.inherit. */
class InheritTimeline extends Timeline implements BoneTimeline { class InheritTimeline extends Timeline implements BoneTimeline {
public static inline var ENTRIES:Int = 2; public static inline var ENTRIES:Int = 2;
private static inline var INHERIT:Int = 1; private static inline var INHERIT:Int = 1;
@ -53,10 +53,9 @@ class InheritTimeline extends Timeline implements BoneTimeline {
return boneIndex; return boneIndex;
} }
/** Sets the inherit value for the specified frame. /** Sets the transform mode for the specified frame.
* @param frame Between 0 and <code>frameCount</code>, inclusive. * @param frame Between 0 and <code>frameCount</code>, inclusive.
* @param time The frame time in seconds. * @param time The frame time in seconds. */
* @param inherit The inherit value for this frame. */
public function setFrame(frame:Int, time:Float, inherit: Inherit):Void { public function setFrame(frame:Int, time:Float, inherit: Inherit):Void {
frame *= ENTRIES; frame *= ENTRIES;
frames[frame] = time; frames[frame] = time;

View File

@ -29,14 +29,9 @@
package spine.animation; package spine.animation;
/** The interface to implement for receiving TrackEntry events. It is always safe to call AnimationState methods when receiving /**
* events. * Manages a collection of listeners for TrackEntry events.
* <p> */
* TrackEntry events are collected during {@link AnimationState#update(float)} and {@link AnimationState#apply(Skeleton)} and
* fired only after those methods are finished.
* <p>
* See TrackEntry {@link TrackEntry#setListener(AnimationStateListener)} and AnimationState
* {@link AnimationState#addListener(AnimationStateListener)}. */
class Listeners { class Listeners {
private var _listeners:Array<TrackEntry->Void>; private var _listeners:Array<TrackEntry->Void>;
@ -50,7 +45,7 @@ class Listeners {
_listeners = new Array<TrackEntry->Void>(); _listeners = new Array<TrackEntry->Void>();
} }
/** Invoked when this entry has been set as the current entry. {@link #end(TrackEntry)} will occur when this entry will no /** Invoked when this entry has been set as the current entry. spine.animation.Listeners.end(TrackEntry) will occur when this entry will no
* longer be applied. */ * longer be applied. */
public function invoke(entry:TrackEntry) { public function invoke(entry:TrackEntry) {
for (listener in _listeners) { for (listener in _listeners) {
@ -75,14 +70,9 @@ class Listeners {
} }
} }
/** The interface to implement for receiving TrackEntry events. It is always safe to call AnimationState methods when receiving /**
* events. * Manages a collection of event listeners for TrackEntry events.
* <p> */
* TrackEntry events are collected during {@link AnimationState#update(float)} and {@link AnimationState#apply(Skeleton)} and
* fired only after those methods are finished.
* <p>
* See TrackEntry {@link TrackEntry#setListener(AnimationStateListener)} and AnimationState
* {@link AnimationState#addListener(AnimationStateListener)}. */
class EventListeners { class EventListeners {
private var _listeners:Array<TrackEntry->Event->Void>; private var _listeners:Array<TrackEntry->Event->Void>;
@ -97,9 +87,9 @@ class EventListeners {
} }
/** Invoked when this entry's animation triggers an event. This may occur during mixing (after /** Invoked when this entry's animation triggers an event. This may occur during mixing (after
* {@link #interrupt(TrackEntry)}), see {@link TrackEntry#eventThreshold}. * interrupt(TrackEntry)), see spine.animation.TrackEntry.eventThreshold.
* <p> * <p>
* Because this event is triggered at the end of {@link AnimationState#apply(Skeleton)}, any animations set in response to * Because this event is triggered at the end of spine.animation.AnimationState.apply(Skeleton), any animations set in response to
* the event won't be applied until the next time the AnimationState is applied. */ * the event won't be applied until the next time the AnimationState is applied. */
public function invoke(entry:TrackEntry, event:Event) { public function invoke(entry:TrackEntry, event:Event) {
for (listener in _listeners) { for (listener in _listeners) {

View File

@ -32,7 +32,7 @@ package spine.animation;
/** Controls how timeline values are mixed with setup pose values or current pose values when a timeline is applied with /** Controls how timeline values are mixed with setup pose values or current pose values when a timeline is applied with
* <code>alpha</code> < 1. * <code>alpha</code> < 1.
* *
* See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}. */ * @see spine.animation.Timeline.apply() */
class MixBlend { class MixBlend {
public var ordinal:Int = 0; public var ordinal:Int = 0;
@ -44,8 +44,8 @@ class MixBlend {
* setup value is set. */ * setup value is set. */
public static var setup(default, never):MixBlend = new MixBlend(0); public static var setup(default, never):MixBlend = new MixBlend(0);
/** Transitions from the current value to the timeline value. Before the first frame, transitions from the current value to /** Transitions from the current value to the timeline value. Before the first frame, transitions from the current value to
* the setup value. Timelines which perform instant transitions, such as {@link DrawOrderTimeline} or * the setup value. Timelines which perform instant transitions, such as spine.animation.DrawOrderTimeline or
* {@link AttachmentTimeline}, use the setup value before the first frame. * spine.animation.AttachmentTimeline, use the setup value before the first frame.
* *
* <code>first</code> is intended for the first animations applied, not for animations layered on top of those. */ * <code>first</code> is intended for the first animations applied, not for animations layered on top of those. */
public static var first(default, never):MixBlend = new MixBlend(1); public static var first(default, never):MixBlend = new MixBlend(1);

View File

@ -32,7 +32,8 @@ package spine.animation;
/** Indicates whether a timeline's alpha is mixing out over time toward 0 (the setup or current pose value) or /** Indicates whether a timeline's alpha is mixing out over time toward 0 (the setup or current pose value) or
* mixing in toward 1 (the timeline's value). Some timelines use this to decide how values are applied. * mixing in toward 1 (the timeline's value). Some timelines use this to decide how values are applied.
* *
* See Timeline apply(Skeleton, float, float, Array, float, MixBlend, MixDirection). */ * @see spine.animation.Timeline.apply()
*/
class MixDirection { class MixDirection {
public var ordinal:Int = 0; public var ordinal:Int = 0;

View File

@ -33,15 +33,15 @@ import spine.Event;
import spine.PathConstraint; import spine.PathConstraint;
import spine.Skeleton; import spine.Skeleton;
/** Changes a path constraint's {@link PathConstraint#getMixRotate()}, {@link PathConstraint#getMixX()}, and /** Changes a path constraint's PathConstraint.mixRotate, PathConstraint.mixX, and
* {@link PathConstraint#getMixY()}. */ * PathConstraint.mixY. */
class PathConstraintMixTimeline extends CurveTimeline { class PathConstraintMixTimeline extends CurveTimeline {
private static inline var ENTRIES:Int = 4; private static inline var ENTRIES:Int = 4;
private static inline var ROTATE:Int = 1; private static inline var ROTATE:Int = 1;
private static inline var X:Int = 2; private static inline var X:Int = 2;
private static inline var Y:Int = 3; private static inline var Y:Int = 3;
/** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is /** The index of the path constraint in spine.Skeleton.pathConstraints that will be changed when this timeline is
* applied. */ * applied. */
public var constraintIndex:Int = 0; public var constraintIndex:Int = 0;
@ -54,7 +54,7 @@ class PathConstraintMixTimeline extends CurveTimeline {
return ENTRIES; return ENTRIES;
} }
/** Sets the time and mix values for the specified frame. /** Sets the time and color for the specified frame.
* @param frame Between 0 and <code>frameCount</code>, inclusive. * @param frame Between 0 and <code>frameCount</code>, inclusive.
* @param time The frame time in seconds. */ * @param time The frame time in seconds. */
public function setFrame(frame:Int, time:Float, mixRotate:Float, mixX:Float, mixY:Float):Void { public function setFrame(frame:Int, time:Float, mixRotate:Float, mixX:Float, mixY:Float):Void {

View File

@ -33,9 +33,9 @@ import spine.Event;
import spine.PathConstraint; import spine.PathConstraint;
import spine.Skeleton; import spine.Skeleton;
/** Changes a path constraint's {@link PathConstraint#position}. */ /** Changes a path constraint's spine.PathConstraint.position. */
class PathConstraintPositionTimeline extends CurveTimeline1 { class PathConstraintPositionTimeline extends CurveTimeline1 {
/** The index of the path constraint in {@link Skeleton#pathConstraints} that will be changed when this timeline is /** The index of the path constraint in spine.Skeleton.pathConstraints that will be changed when this timeline is
* applied. */ * applied. */
public var constraintIndex:Int = 0; public var constraintIndex:Int = 0;

View File

@ -29,7 +29,7 @@
package spine.animation; package spine.animation;
/** Changes a physics constraint's {@link PhysicsConstraint#getDamping()}. */ /** Changes a physics constraint's spine.PhysicsConstraint.damping. */
class PhysicsConstraintDampingTimeline extends PhysicsConstraintTimeline { class PhysicsConstraintDampingTimeline extends PhysicsConstraintTimeline {
public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int) { public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int) {
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintDamping); super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintDamping);

View File

@ -29,7 +29,7 @@
package spine.animation; package spine.animation;
/** Changes a physics constraint's {@link PhysicsConstraint#getGravity()}. */ /** Changes a physics constraint's spine.PhysicsConstraint.gravity. */
class PhysicsConstraintGravityTimeline extends PhysicsConstraintTimeline { class PhysicsConstraintGravityTimeline extends PhysicsConstraintTimeline {
public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int) { public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int) {
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintGravity); super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintGravity);

View File

@ -29,7 +29,7 @@
package spine.animation; package spine.animation;
/** Changes a physics constraint's {@link PhysicsConstraint#getInertia()}. */ /** Changes a physics constraint's spine.PhysicsConstraint.inertia. */
class PhysicsConstraintInertiaTimeline extends PhysicsConstraintTimeline { class PhysicsConstraintInertiaTimeline extends PhysicsConstraintTimeline {
public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int) { public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int) {
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintInertia); super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintInertia);

View File

@ -29,7 +29,7 @@
package spine.animation; package spine.animation;
/** Changes a physics constraint's {@link PhysicsConstraint#getMassInverse()}. The timeline values are not inverted. */ /** Changes a physics constraint's spine.PhysicsConstraint.massInverse. The timeline values are not inverted. */
class PhysicsConstraintMassTimeline extends PhysicsConstraintTimeline { class PhysicsConstraintMassTimeline extends PhysicsConstraintTimeline {
public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int) { public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int) {
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMass); super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMass);

View File

@ -29,7 +29,7 @@
package spine.animation; package spine.animation;
/** Changes a physics constraint's {@link PhysicsConstraint#getMix()}. */ /** Changes a physics constraint's spine.PhysicsConstraint.mix. */
class PhysicsConstraintMixTimeline extends PhysicsConstraintTimeline { class PhysicsConstraintMixTimeline extends PhysicsConstraintTimeline {
public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int) { public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int) {
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMix); super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMix);

View File

@ -29,7 +29,7 @@
package spine.animation; package spine.animation;
/** Changes a physics constraint's {@link PhysicsConstraint#getStrength()}. */ /** Changes a physics constraint's spine.PhysicsConstraint.strength. */
class PhysicsConstraintStrengthTimeline extends PhysicsConstraintTimeline { class PhysicsConstraintStrengthTimeline extends PhysicsConstraintTimeline {
public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int) { public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int) {
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintStrength); super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintStrength);

View File

@ -33,13 +33,15 @@ import spine.Event;
import spine.PathConstraint; import spine.PathConstraint;
import spine.Skeleton; import spine.Skeleton;
/** The base class for most {@link PhysicsConstraint} timelines. */ /** The base class for most spine.PhysicsConstraint timelines. */
abstract class PhysicsConstraintTimeline extends CurveTimeline1 { abstract class PhysicsConstraintTimeline extends CurveTimeline1 {
/** The index of the physics constraint in {@link Skeleton#getPhysicsConstraints()} that will be changed when this timeline /** The index of the physics constraint in Skeleton.physicsConstraints that will be changed when this timeline
* is applied, or -1 if all physics constraints in the skeleton will be changed. */ * is applied, or -1 if all physics constraints in the skeleton will be changed. */
public var constraintIndex:Int = 0; public var constraintIndex:Int = 0;
/** @param physicsConstraintIndex -1 for all physics constraints in the skeleton. */ /**
* @param physicsConstraintIndex -1 for all physics constraints in the skeleton.
*/
public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int, property:Int) { public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int, property:Int) {
super(frameCount, bezierCount, [property + "|" + physicsConstraintIndex]); super(frameCount, bezierCount, [property + "|" + physicsConstraintIndex]);
constraintIndex = physicsConstraintIndex; constraintIndex = physicsConstraintIndex;

View File

@ -29,7 +29,7 @@
package spine.animation; package spine.animation;
/** Changes a physics constraint's {@link PhysicsConstraint#getWind()}. */ /** Changes a physics constraint's spine.PhysicsConstraint.wind. */
class PhysicsConstraintWindTimeline extends PhysicsConstraintTimeline { class PhysicsConstraintWindTimeline extends PhysicsConstraintTimeline {
public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int) { public function new(frameCount:Int, bezierCount:Int, physicsConstraintIndex:Int) {
super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintWind); super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintWind);

View File

@ -29,7 +29,7 @@
package spine.animation; package spine.animation;
/** Changes the RGB for a slot's {@link Slot#getColor()} and {@link Slot#getDarkColor()} for two color tinting. */ /** Changes the RGB for a slot's spine.Slot.color and spine.Slot.darkColor for two color tinting. */
class RGB2Timeline extends CurveTimeline implements SlotTimeline { class RGB2Timeline extends CurveTimeline implements SlotTimeline {
private static inline var ENTRIES:Int = 7; private static inline var ENTRIES:Int = 7;
private static inline var R:Int = 1; private static inline var R:Int = 1;
@ -50,21 +50,15 @@ class RGB2Timeline extends CurveTimeline implements SlotTimeline {
return ENTRIES; return ENTRIES;
} }
/** The index of the slot in {@link Skeleton#getSlots()} that will be changed when this timeline is applied. The /** The index of the slot in spine.Skeleton.slots that will be changed when this timeline is applied. The
* {@link Slot#getDarkColor()} must not be null. */ * spine.Slot.darkColor must not be null. */
public function getSlotIndex():Int { public function getSlotIndex():Int {
return slotIndex; return slotIndex;
} }
/** Sets the time, light color, and dark color for the specified frame. /** Sets the time, light color, and dark color for the specified frame.
* @param frame Between 0 and <code>frameCount</code>, inclusive. * @param frame Between 0 and <code>frameCount</code>, inclusive.
* @param time The frame time in seconds. * @param time The frame time in seconds. */
* @param r Red component for the light color (0-1).
* @param g Green component for the light color (0-1).
* @param b Blue component for the light color (0-1).
* @param r2 Red component for the dark color (0-1).
* @param g2 Green component for the dark color (0-1).
* @param b2 Blue component for the dark color (0-1). */
public function setFrame(frame:Int, time:Float, r:Float, g:Float, b:Float, r2:Float, g2:Float, b2:Float):Void { public function setFrame(frame:Int, time:Float, r:Float, g:Float, b:Float, r2:Float, g2:Float, b2:Float):Void {
frame *= ENTRIES; frame *= ENTRIES;
frames[frame] = time; frames[frame] = time;

View File

@ -29,7 +29,7 @@
package spine.animation; package spine.animation;
/** Changes a slot's {@link Slot#getColor()} and {@link Slot#getDarkColor()} for two color tinting. */ /** Changes a slot's spine.Slot.getColor() and spine.Slot.getDarkColor() for two color tinting. */
class RGBA2Timeline extends CurveTimeline implements SlotTimeline { class RGBA2Timeline extends CurveTimeline implements SlotTimeline {
private static inline var ENTRIES:Int = 8; private static inline var ENTRIES:Int = 8;
private static inline var R:Int = 1; private static inline var R:Int = 1;
@ -55,8 +55,8 @@ class RGBA2Timeline extends CurveTimeline implements SlotTimeline {
return ENTRIES; return ENTRIES;
} }
/** The index of the slot in {@link Skeleton#getSlots()} that will be changed when this timeline is applied. The /** The index of the slot in spine.Skeleton.getSlots() that will be changed when this timeline is applied. The
* {@link Slot#getDarkColor()} must not be null. */ * spine.Slot.getDarkColor() must not be null. */
public function getSlotIndex():Int { public function getSlotIndex():Int {
return slotIndex; return slotIndex;
} }

View File

@ -29,7 +29,7 @@
package spine.animation; package spine.animation;
/** Changes a slot's {@link Slot#getColor()}. */ /** Changes a slot's spine.Slot.color. */
class RGBATimeline extends CurveTimeline implements SlotTimeline { class RGBATimeline extends CurveTimeline implements SlotTimeline {
private static inline var ENTRIES:Int = 5; private static inline var ENTRIES:Int = 5;
private static inline var R:Int = 1; private static inline var R:Int = 1;
@ -53,12 +53,8 @@ class RGBATimeline extends CurveTimeline implements SlotTimeline {
} }
/** Sets the time and color for the specified frame. /** Sets the time and color for the specified frame.
* @param frame Between 0 and <code>frameCount</code>, inclusive. * @param frame Between 0 and frameCount, inclusive.
* @param time The frame time in seconds. * @param time The frame time in seconds. */
* @param r The red component.
* @param g The green component.
* @param b The blue component.
* @param a The alpha component. */
public function setFrame(frame:Int, time:Float, r:Float, g:Float, b:Float, a:Float):Void { public function setFrame(frame:Int, time:Float, r:Float, g:Float, b:Float, a:Float):Void {
frame *= ENTRIES; frame *= ENTRIES;
frames[frame] = time; frames[frame] = time;

View File

@ -29,7 +29,7 @@
package spine.animation; package spine.animation;
/** Changes the RGB for a slot's {@link Slot#getColor()}. */ /** Changes the RGB for a slot's spine.Slot.color. */
class RGBTimeline extends CurveTimeline implements SlotTimeline { class RGBTimeline extends CurveTimeline implements SlotTimeline {
private static inline var ENTRIES:Int = 4; private static inline var ENTRIES:Int = 4;
private static inline var R:Int = 1; private static inline var R:Int = 1;

View File

@ -33,7 +33,7 @@ import spine.Bone;
import spine.Event; import spine.Event;
import spine.Skeleton; import spine.Skeleton;
/** Changes a bone's local {@link Bone#rotation}. */ /** Changes a bone's local rotation. */
class RotateTimeline extends CurveTimeline1 implements BoneTimeline { class RotateTimeline extends CurveTimeline1 implements BoneTimeline {
public var boneIndex:Int = 0; public var boneIndex:Int = 0;

View File

@ -34,7 +34,7 @@ import spine.Event;
import spine.MathUtils; import spine.MathUtils;
import spine.Skeleton; import spine.Skeleton;
/** Changes a bone's local {@link Bone#scaleX} and {@link Bone#scaleY}. */ /** Changes a bone's local spine.Bone.scaleX and spine.Bone.scaleY. */
class ScaleTimeline extends CurveTimeline2 implements BoneTimeline { class ScaleTimeline extends CurveTimeline2 implements BoneTimeline {
private var boneIndex:Int = 0; private var boneIndex:Int = 0;

View File

@ -34,7 +34,7 @@ import spine.Event;
import spine.MathUtils; import spine.MathUtils;
import spine.Skeleton; import spine.Skeleton;
/** Changes a bone's local {@link Bone#scaleX}. */ /** Changes a bone's local spine.Bone.scaleX. */
class ScaleXTimeline extends CurveTimeline1 implements BoneTimeline { class ScaleXTimeline extends CurveTimeline1 implements BoneTimeline {
private var boneIndex:Int = 0; private var boneIndex:Int = 0;

View File

@ -34,7 +34,7 @@ import spine.Event;
import spine.MathUtils; import spine.MathUtils;
import spine.Skeleton; import spine.Skeleton;
/** Changes a bone's local {@link Bone#scaleY}. */ /** Changes a bone's local spine.Bone.scaleY. */
class ScaleYTimeline extends CurveTimeline1 implements BoneTimeline { class ScaleYTimeline extends CurveTimeline1 implements BoneTimeline {
private var boneIndex:Int = 0; private var boneIndex:Int = 0;

View File

@ -63,10 +63,7 @@ class SequenceTimeline extends Timeline implements SlotTimeline {
/** Sets the time, mode, index, and frame time for the specified frame. /** Sets the time, mode, index, and frame time for the specified frame.
* @param frame Between 0 and <code>frameCount</code>, inclusive. * @param frame Between 0 and <code>frameCount</code>, inclusive.
* @param time Seconds between frames. * @param time Seconds between frames. */
* @param mode The sequence mode.
* @param index The sequence index.
* @param delay The delay between frames. */
public function setFrame(frame:Int, time:Float, mode:SequenceMode, index:Int, delay:Float) { public function setFrame(frame:Int, time:Float, mode:SequenceMode, index:Int, delay:Float) {
frame *= SequenceTimeline.ENTRIES; frame *= SequenceTimeline.ENTRIES;
frames[frame] = time; frames[frame] = time;

View File

@ -33,7 +33,7 @@ import spine.Bone;
import spine.Event; import spine.Event;
import spine.Skeleton; import spine.Skeleton;
/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */ /** Changes a bone's local spine.Bone.shearX and spine.Bone.shearY. */
class ShearTimeline extends CurveTimeline2 implements BoneTimeline { class ShearTimeline extends CurveTimeline2 implements BoneTimeline {
private var boneIndex:Int = 0; private var boneIndex:Int = 0;

View File

@ -33,7 +33,7 @@ import spine.Bone;
import spine.Event; import spine.Event;
import spine.Skeleton; import spine.Skeleton;
/** Changes a bone's local {@link Bone#shearX}. */ /** Changes a bone's local spine.Bone.shearX. */
class ShearXTimeline extends CurveTimeline1 implements BoneTimeline { class ShearXTimeline extends CurveTimeline1 implements BoneTimeline {
private var boneIndex:Int = 0; private var boneIndex:Int = 0;

View File

@ -33,7 +33,7 @@ import spine.Bone;
import spine.Event; import spine.Event;
import spine.Skeleton; import spine.Skeleton;
/** Changes a bone's local {@link Bone#shearY}. */ /** Changes a bone's local Bone.shearY. */
class ShearYTimeline extends CurveTimeline1 implements BoneTimeline { class ShearYTimeline extends CurveTimeline1 implements BoneTimeline {
private var boneIndex:Int = 0; private var boneIndex:Int = 0;

View File

@ -31,6 +31,6 @@ package spine.animation;
/** An interface for timelines which change the property of a slot. */ /** An interface for timelines which change the property of a slot. */
interface SlotTimeline { interface SlotTimeline {
/** The index of the slot in {@link Skeleton#getSlots()} that will be changed when this timeline is applied. */ /** The index of the slot in spine.Skeleton.getSlots() that will be changed when this timeline is applied. */
function getSlotIndex():Int; function getSlotIndex():Int;
} }

View File

@ -41,7 +41,6 @@ class Timeline {
/** /**
* @param propertyIds Unique identifiers for the properties the timeline modifies. * @param propertyIds Unique identifiers for the properties the timeline modifies.
* @param frameCount The number of frames for this timeline.
*/ */
public function new(frameCount:Int, propertyIds:Array<String>) { public function new(frameCount:Int, propertyIds:Array<String>) {
this.propertyIds = propertyIds; this.propertyIds = propertyIds;
@ -67,7 +66,7 @@ class Timeline {
/** Applies this timeline to the skeleton. /** Applies this timeline to the skeleton.
* @param skeleton The skeleton to which the timeline is being applied. This provides access to the bones, slots, and other * @param skeleton The skeleton to which the timeline is being applied. This provides access to the bones, slots, and other
* skeleton components that the timeline may change. * skeleton components that the timeline may change.
* @param lastTime The last time in seconds this timeline was applied. Timelines such as {@link EventTimeline} trigger only * @param lastTime The last time in seconds this timeline was applied. Timelines such as spine.animation.EventTimeline trigger only
* at specific times rather than every frame. In that case, the timeline triggers everything between * at specific times rather than every frame. In that case, the timeline triggers everything between
* <code>lastTime</code> (exclusive) and <code>time</code> (inclusive). Pass -1 the first time an animation is * <code>lastTime</code> (exclusive) and <code>time</code> (inclusive). Pass -1 the first time an animation is
* applied to ensure frame 0 is triggered. * applied to ensure frame 0 is triggered.
@ -82,7 +81,7 @@ class Timeline {
* apply animations on top of each other (layering). * apply animations on top of each other (layering).
* @param blend Controls how mixing is applied when <code>alpha</code> < 1. * @param blend Controls how mixing is applied when <code>alpha</code> < 1.
* @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions, * @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions,
* such as {@link DrawOrderTimeline} or {@link AttachmentTimeline}, and others such as {@link ScaleTimeline}. * such as spine.animation.DrawOrderTimeline or spine.animation.AttachmentTimeline, and others such as spine.animation.ScaleTimeline.
*/ */
public function apply(skeleton:Skeleton, lastTime:Float, time:Float, events:Array<Event>, alpha:Float, blend:MixBlend, direction:MixDirection):Void { public function apply(skeleton:Skeleton, lastTime:Float, time:Float, events:Array<Event>, alpha:Float, blend:MixBlend, direction:MixDirection):Void {
throw new SpineException("Timeline implementations must override apply()"); throw new SpineException("Timeline implementations must override apply()");

View File

@ -32,24 +32,24 @@ package spine.animation;
import spine.animation.Listeners.EventListeners; import spine.animation.Listeners.EventListeners;
import spine.Poolable; import spine.Poolable;
/** Stores settings and other state for the playback of an animation on an {@link AnimationState} track. /** Stores settings and other state for the playback of an animation on an spine.animation.AnimationState track.
* <p> * <p>
* References to a track entry must not be kept after the {@link AnimationStateListener#dispose(TrackEntry)} event occurs. */ * References to a track entry must not be kept after the AnimationStateListener.dispose(TrackEntry) event occurs. */
class TrackEntry implements Poolable { class TrackEntry implements Poolable {
/** The animation to apply for this track entry. */ /** The animation to apply for this track entry. */
public var animation:Animation; public var animation:Animation;
/** The animation queued to start after this animation, or null if there is none. <code>next</code> makes up a doubly linked /** The animation queued to start after this animation, or null if there is none. next makes up a doubly linked
* list. * list.
* <p> * <p>
* See {@link AnimationState#clearNext(TrackEntry)} to truncate the list. */ * See spine.animation.AnimationState.clearNext(TrackEntry) to truncate the list. */
public var next:TrackEntry; public var next:TrackEntry;
/** The animation queued to play before this animation, or null. <code>previous</code> makes up a doubly linked list. */ /** The animation queued to play before this animation, or null. previous makes up a doubly linked list. */
public var previous:TrackEntry; public var previous:TrackEntry;
/** The track entry for the previous animation when mixing from the previous animation to this animation, or null if no /** The track entry for the previous animation when mixing from the previous animation to this animation, or null if no
* mixing is currently occurring. When mixing from multiple animations, <code>mixingFrom</code> makes up a linked list. */ * mixing is currently occurring. When mixing from multiple animations, mixingFrom makes up a linked list. */
public var mixingFrom:TrackEntry; public var mixingFrom:TrackEntry;
/** The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is /** The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is
* currently occurring. When mixing to multiple animations, <code>mixingTo</code> makes up a linked list. */ * currently occurring. When mixing to multiple animations, mixingTo makes up a linked list. */
public var mixingTo:TrackEntry; public var mixingTo:TrackEntry;
public var onStart:Listeners = new Listeners(); public var onStart:Listeners = new Listeners();
public var onInterrupt:Listeners = new Listeners(); public var onInterrupt:Listeners = new Listeners();
@ -59,7 +59,7 @@ class TrackEntry implements Poolable {
public var onEvent:EventListeners = new EventListeners(); public var onEvent:EventListeners = new EventListeners();
/** The index of the track where this track entry is either current or queued. /** The index of the track where this track entry is either current or queued.
* <p> * <p>
* See {@link AnimationState#getCurrent(int)}. */ * See spine.animation.AnimationState.getCurrent(int). */
public var trackIndex:Int = 0; public var trackIndex:Int = 0;
/** If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its /** If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its
* duration. */ * duration. */
@ -71,58 +71,58 @@ class TrackEntry implements Poolable {
* <p> * <p>
* When mixing between animations that key the same property, if a lower track also keys that property then the value will * When mixing between animations that key the same property, if a lower track also keys that property then the value will
* briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0% * briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0%
* while the second animation mixes from 0% to 100%. Setting <code>holdPrevious</code> to true applies the first animation * while the second animation mixes from 0% to 100%. Setting holdPrevious to true applies the first animation
* at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which * at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which
* keys the property, only when a higher track also keys the property. * keys the property, only when a higher track also keys the property.
* <p> * <p>
* Snapping will occur if <code>holdPrevious</code> is true and this animation does not key all the same properties as the * Snapping will occur if holdPrevious is true and this animation does not key all the same properties as the
* previous animation. */ * previous animation. */
public var holdPrevious:Bool = false; public var holdPrevious:Bool = false;
/** When the mix percentage ({@link #getMixTime()} / {@link #getMixDuration()}) is less than the /** When the mix percentage (TrackEntry.getMixTime() / TrackEntry.getMixDuration()) is less than the
* <code>eventThreshold</code>, event timelines are applied while this animation is being mixed out. Defaults to 0, so event * eventThreshold, event timelines are applied while this animation is being mixed out. Defaults to 0, so event
* timelines are not applied while this animation is being mixed out. */ * timelines are not applied while this animation is being mixed out. */
public var eventThreshold:Float = 0; public var eventThreshold:Float = 0;
/** When the mix percentage ({@link #getMixTime()} / {@link #getMixDuration()}) is less than the /** When the mix percentage (TrackEntry.getMixTime() / TrackEntry.getMixDuration()) is less than the
* <code>mixAttachmentThreshold</code>, attachment timelines are applied while this animation is being mixed out. Defaults * mixAttachmentThreshold, attachment timelines are applied while this animation is being mixed out. Defaults
* to 0, so attachment timelines are not applied while this animation is being mixed out. */ * to 0, so attachment timelines are not applied while this animation is being mixed out. */
public var mixAttachmentThreshold:Float = 0; public var mixAttachmentThreshold:Float = 0;
/** When {@link #getAlpha()} is greater than <code>alphaAttachmentThreshold</code>, attachment timelines are applied. /** When TrackEntry.getAlpha() is greater than alphaAttachmentThreshold, attachment timelines are applied.
* Defaults to 0, so attachment timelines are always applied. */ * Defaults to 0, so attachment timelines are always applied. */
public var alphaAttachmentThreshold:Float = 0; public var alphaAttachmentThreshold:Float = 0;
/** When the mix percentage ({@link #getMixTime()} / {@link #getMixDuration()}) is less than the /** When the mix percentage (TrackEntry.getMixTime() / TrackEntry.getMixDuration()) is less than the
* <code>mixDrawOrderThreshold</code>, draw order timelines are applied while this animation is being mixed out. Defaults to * mixDrawOrderThreshold, draw order timelines are applied while this animation is being mixed out. Defaults to
* 0, so draw order timelines are not applied while this animation is being mixed out. */ * 0, so draw order timelines are not applied while this animation is being mixed out. */
public var mixDrawOrderThreshold:Float = 0; public var mixDrawOrderThreshold:Float = 0;
/** Seconds when this animation starts, both initially and after looping. Defaults to 0. /** Seconds when this animation starts, both initially and after looping. Defaults to 0.
* <p> * <p>
* When changing the <code>animationStart</code> time, it often makes sense to set {@link #getAnimationLast()} to the same * When changing the animationStart time, it often makes sense to set TrackEntry.getAnimationLast() to the same
* value to prevent timeline keys before the start time from triggering. */ * value to prevent timeline keys before the start time from triggering. */
public var animationStart:Float = 0; public var animationStart:Float = 0;
/** Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will /** Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will
* loop back to {@link #getAnimationStart()} at this time. Defaults to the animation {@link Animation#duration}. */ * loop back to TrackEntry.getAnimationStart() at this time. Defaults to the animation spine.animation.Animation.duration. */
public var animationEnd:Float = 0; public var animationEnd:Float = 0;
/** The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this /** The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this
* animation is applied, event timelines will fire all events between the <code>animationLast</code> time (exclusive) and * animation is applied, event timelines will fire all events between the animationLast time (exclusive) and
* <code>animationTime</code> (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation * animationTime (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation
* is applied. */ * is applied. */
public var animationLast:Float = 0; public var animationLast:Float = 0;
public var nextAnimationLast:Float = 0; public var nextAnimationLast:Float = 0;
/** Seconds to postpone playing the animation. Must be >= 0. When this track entry is the current track entry, /** Seconds to postpone playing the animation. Must be >= 0. When this track entry is the current track entry,
* <code>delay</code> postpones incrementing the {@link #getTrackTime()}. When this track entry is queued, * delay postpones incrementing the TrackEntry.getTrackTime(). When this track entry is queued,
* <code>delay</code> is the time from the start of the previous animation to when this track entry will become the current * delay is the time from the start of the previous animation to when this track entry will become the current
* track entry (ie when the previous track entry {@link TrackEntry#getTrackTime()} >= this track entry's * track entry (ie when the previous track entry TrackEntry.getTrackTime() >= this track entry's
* <code>delay</code>). * delay).
* <p> * <p>
* {@link #getTimeScale()} affects the delay. * TrackEntry.getTimeScale() affects the delay.
* <p> * <p>
* When passing <code>delay</code> <= 0 to {@link AnimationState#addAnimation(int, Animation, boolean, float)} this * When passing delay <= 0 to spine.animation.AnimationState.addAnimation(int, Animation, boolean, float) this
* <code>delay</code> is set using a mix duration from {@link AnimationStateData}. To change the {@link #getMixDuration()} * delay is set using a mix duration from spine.animation.AnimationStateData. To change the TrackEntry.getMixDuration()
* afterward, use {@link #setMixDuration(float, float)} so this <code>delay</code> is adjusted. */ * afterward, use TrackEntry.setMixDuration(float, float) so this delay is adjusted. */
public var delay(default, set):Float = 0; public var delay(default, set):Float = 0;
/** Current time in seconds this track entry has been the current track entry. The track time determines /** Current time in seconds this track entry has been the current track entry. The track time determines
* {@link #getAnimationTime()}. The track time can be set to start the animation at a time other than 0, without affecting * TrackEntry.getAnimationTime(). The track time can be set to start the animation at a time other than 0, without affecting
* looping. */ * looping. */
public var trackTime:Float = 0; public var trackTime:Float = 0;
public var trackLast:Float = 0; public var trackLast:Float = 0;
@ -132,22 +132,22 @@ class TrackEntry implements Poolable {
* is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the * is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the
* properties keyed by the animation are set to the setup pose and the track is cleared. * properties keyed by the animation are set to the setup pose and the track is cleared.
* <p> * <p>
* It may be desired to use {@link AnimationState#addEmptyAnimation(int, float, float)} rather than have the animation * It may be desired to use spine.animation.AnimationState.addEmptyAnimation(int, float, float) rather than have the animation
* abruptly cease being applied. */ * abruptly cease being applied. */
public var trackEnd:Float = 0; public var trackEnd:Float = 0;
/** Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or /** Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or
* faster. Defaults to 1. * faster. Defaults to 1.
* <p> * <p>
* Values < 0 are not supported. To play an animation in reverse, use {@link #getReverse()}. * Values < 0 are not supported. To play an animation in reverse, use TrackEntry.getReverse().
* <p> * <p>
* {@link #getMixTime()} is not affected by track entry time scale, so {@link #getMixDuration()} may need to be adjusted to * TrackEntry.getMixTime() is not affected by track entry time scale, so TrackEntry.getMixDuration() may need to be adjusted to
* match the animation speed. * match the animation speed.
* <p> * <p>
* When using {@link AnimationState#addAnimation(int, Animation, boolean, float)} with a <code>delay</code> <= 0, the * When using spine.animation.AnimationState.addAnimation(int, Animation, boolean, float) with a delay <= 0, the
* {@link #getDelay()} is set using the mix duration from the {@link AnimationStateData}, assuming time scale to be 1. If * TrackEntry.getDelay() is set using the mix duration from the spine.animation.AnimationStateData, assuming time scale to be 1. If
* the time scale is not 1, the delay may need to be adjusted. * the time scale is not 1, the delay may need to be adjusted.
* <p> * <p>
* See AnimationState {@link AnimationState#getTimeScale()} for affecting all animations. */ * See AnimationState spine.animation.AnimationState.getTimeScale() for affecting all animations. */
public var timeScale:Float = 0; public var timeScale:Float = 0;
/** Values < 1 mix this animation with the skeleton's current pose (usually the pose resulting from lower tracks). Defaults /** Values < 1 mix this animation with the skeleton's current pose (usually the pose resulting from lower tracks). Defaults
* to 1, which overwrites the skeleton's current pose with this animation. * to 1, which overwrites the skeleton's current pose with this animation.
@ -155,34 +155,34 @@ class TrackEntry implements Poolable {
* Typically track 0 is used to completely pose the skeleton, then alpha is used on higher tracks. It doesn't make sense to * Typically track 0 is used to completely pose the skeleton, then alpha is used on higher tracks. It doesn't make sense to
* use alpha on track 0 if the skeleton pose is from the last frame render. */ * use alpha on track 0 if the skeleton pose is from the last frame render. */
public var alpha:Float = 0; public var alpha:Float = 0;
/** Seconds from 0 to the {@link #getMixDuration()} when mixing from the previous animation to this animation. May be /** Seconds from 0 to the TrackEntry.getMixDuration() when mixing from the previous animation to this animation. May be
* slightly more than <code>mixDuration</code> when the mix is complete. */ * slightly more than mixDuration when the mix is complete. */
public var mixTime:Float = 0; public var mixTime:Float = 0;
/** Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData /** Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData
* {@link AnimationStateData#getMix(Animation, Animation)} based on the animation before this animation (if any). * spine.animation.AnimationStateData.getMix(Animation, Animation) based on the animation before this animation (if any).
* <p> * <p>
* A mix duration of 0 still mixes out over one frame to provide the track entry being mixed out a chance to revert the * A mix duration of 0 still mixes out over one frame to provide the track entry being mixed out a chance to revert the
* properties it was animating. A mix duration of 0 can be set at any time to end the mix on the next * properties it was animating. A mix duration of 0 can be set at any time to end the mix on the next
* {@link AnimationState#update(float) update}. * spine.animation.AnimationState.update(float) update.
* <p> * <p>
* The <code>mixDuration</code> can be set manually rather than use the value from * The mixDuration can be set manually rather than use the value from
* {@link AnimationStateData#getMix(Animation, Animation)}. In that case, the <code>mixDuration</code> can be set for a new * spine.animation.AnimationStateData.getMix(Animation, Animation). In that case, the mixDuration can be set for a new
* track entry only before {@link AnimationState#update(float)} is first called. * track entry only before spine.animation.AnimationState.update(float) is first called.
* <p> * <p>
* When using {@link AnimationState#addAnimation(int, Animation, boolean, float)} with a <code>delay</code> <= 0, the * When using spine.animation.AnimationState.addAnimation(int, Animation, boolean, float) with a delay <= 0, the
* {@link #getDelay()} is set using the mix duration from the {@link AnimationStateData}. If <code>mixDuration</code> is set * TrackEntry.getDelay() is set using the mix duration from the spine.animation.AnimationStateData. If mixDuration is set
* afterward, the delay may need to be adjusted. For example:<br> * afterward, the delay may need to be adjusted. For example:<br>
* <code>entry.delay = entry.previous.getTrackComplete() - entry.mixDuration;</code><br> * entry.delay = entry.previous.getTrackComplete() - entry.mixDuration;<br>
* Alternatively, {@link #setMixDuration(float, float)} can be used to recompute the delay:<br> * Alternatively, TrackEntry.setMixDuration(float, float) can be used to recompute the delay:<br>
* <code>entry.setMixDuration(0.25f, 0);</code> */ * entry.setMixDuration(0.25f, 0); */
public var mixDuration:Float = 0; public var mixDuration:Float = 0;
public var interruptAlpha:Float = 0; public var interruptAlpha:Float = 0;
public var totalAlpha:Float = 0; public var totalAlpha:Float = 0;
/** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}. /** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to spine.animation.MixBlend.replace.
* <p> * <p>
* Track entries on track 0 ignore this setting and always use {@link MixBlend#first}. * Track entries on track 0 ignore this setting and always use spine.animation.MixBlend.first.
* <p> * <p>
* The <code>mixBlend</code> can be set for a new track entry only before {@link AnimationState#apply(Skeleton)} is first * The mixBlend can be set for a new track entry only before spine.animation.AnimationState.apply(Skeleton) is first
* called. */ * called. */
public var mixBlend:MixBlend = MixBlend.replace; public var mixBlend:MixBlend = MixBlend.replace;
public var timelineMode:Array<Int> = new Array<Int>(); public var timelineMode:Array<Int> = new Array<Int>();
@ -202,12 +202,12 @@ class TrackEntry implements Poolable {
public function new() {} public function new() {}
/** Uses {@link #getTrackTime()} to compute the <code>animationTime</code>. When the <code>trackTime</code> is 0, the /** Uses TrackEntry.getTrackTime() to compute the animationTime. When the trackTime is 0, the
* <code>animationTime</code> is equal to the <code>animationStart</code> time. * animationTime is equal to the animationStart time.
* <p> * <p>
* The <code>animationTime</code> is between {@link #getAnimationStart()} and {@link #getAnimationEnd()}, except if this * The animationTime is between TrackEntry.getAnimationStart() and TrackEntry.getAnimationEnd(), except if this
* track entry is non-looping and {@link #getAnimationEnd()} is >= to the animation {@link Animation#duration}, then * track entry is non-looping and TrackEntry.getAnimationEnd() is >= to the animation spine.animation.Animation.duration, then
* <code>animationTime</code> continues to increase past {@link #getAnimationEnd()}. */ * animationTime continues to increase past TrackEntry.getAnimationEnd(). */
public function getAnimationTime():Float { public function getAnimationTime():Float {
if (loop) { if (loop) {
var duration:Float = animationEnd - animationStart; var duration:Float = animationEnd - animationStart;
@ -218,9 +218,9 @@ class TrackEntry implements Poolable {
return Math.min(trackTime + animationStart, animationEnd); return Math.min(trackTime + animationStart, animationEnd);
} }
/** If this track entry is non-looping, the track time in seconds when {@link #getAnimationEnd()} is reached, or the current /** If this track entry is non-looping, the track time in seconds when TrackEntry.getAnimationEnd() is reached, or the current
* {@link #getTrackTime()} if it has already been reached. If this track entry is looping, the track time when this * TrackEntry.getTrackTime() if it has already been reached. If this track entry is looping, the track time when this
* animation will reach its next {@link #getAnimationEnd()} (the next loop completion). */ * animation will reach its next TrackEntry.getAnimationEnd() (the next loop completion). */
public function getTrackComplete():Float { public function getTrackComplete():Float {
var duration:Float = animationEnd - animationStart; var duration:Float = animationEnd - animationStart;
if (duration != 0) { if (duration != 0) {
@ -234,13 +234,13 @@ class TrackEntry implements Poolable {
/** Returns true if this track entry has been applied at least once. /** Returns true if this track entry has been applied at least once.
* <p> * <p>
* See {@link AnimationState#apply(Skeleton)}. */ * See spine.animation.AnimationState.apply(Skeleton). */
public function wasApplied() { public function wasApplied() {
return nextTrackLast != -1; return nextTrackLast != -1;
} }
/** Returns true if there is a {@link #getNext()} track entry and it will become the current track entry during the next /** Returns true if there is a TrackEntry.getNext() track entry and it will become the current track entry during the next
* {@link AnimationState#update(float)}. */ * spine.animation.AnimationState.update(float). */
public function isNextReady():Bool { public function isNextReady():Bool {
return next != null && nextTrackLast - next.delay >= 0; return next != null && nextTrackLast - next.delay >= 0;
} }
@ -263,9 +263,9 @@ class TrackEntry implements Poolable {
} }
/** Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the /** Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the
* long way around when using {@link #getAlpha()} and starting animations on other tracks. * long way around when using TrackEntry.getAlpha() and starting animations on other tracks.
* <p> * <p>
* Mixing with {@link MixBlend#replace} involves finding a rotation between two others, which has two possible solutions: * Mixing with spine.animation.MixBlend.replace involves finding a rotation between two others, which has two possible solutions:
* the short way or the long way around. The two rotations likely change over time, so which direction is the short or long * the short way or the long way around. The two rotations likely change over time, so which direction is the short or long
* way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the * way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the
* long way. TrackEntry chooses the short way the first time it is applied and remembers that direction. */ * long way. TrackEntry chooses the short way the first time it is applied and remembers that direction. */
@ -273,10 +273,10 @@ class TrackEntry implements Poolable {
timelinesRotation.resize(0); timelinesRotation.resize(0);
} }
/** Sets both {@link #getMixDuration()} and {@link #getDelay()}. /** Sets both TrackEntry.getMixDuration() and TrackEntry.getDelay().
* @param mixDuration If > 0, sets {@link TrackEntry#getDelay()}. If <= 0, the delay set is the duration of the previous track * @param mixDuration If > 0, sets TrackEntry.getDelay(). If <= 0, the delay set is the duration of the previous track
* entry minus the specified mix duration plus the specified <code>delay</code> (ie the mix ends at * entry minus the specified mix duration plus the specified delay (ie the mix ends at
* (<code>delay</code> = 0) or before (<code>delay</code> < 0) the previous track entry duration). If the previous * (delay = 0) or before (delay < 0) the previous track entry duration). If the previous
* entry is looping, its next loop completion is used instead of its duration. */ * entry is looping, its next loop completion is used instead of its duration. */
public function setMixDurationWithDelay(mixDuration:Float):Float { public function setMixDurationWithDelay(mixDuration:Float):Float {
this.mixDuration = mixDuration; this.mixDuration = mixDuration;

View File

@ -34,9 +34,9 @@ import spine.Skeleton;
import spine.TransformConstraint; import spine.TransformConstraint;
import spine.TransformConstraintData; import spine.TransformConstraintData;
/** Changes a transform constraint's {@link TransformConstraint#mixRotate}, {@link TransformConstraint#mixX}, /** Changes a transform constraint's spine.TransformConstraint.mixRotate, spine.TransformConstraint.mixX,
* {@link TransformConstraint#mixY}, {@link TransformConstraint#mixScaleX}, * spine.TransformConstraint.mixY, spine.TransformConstraint.mixScaleX,
* {@link TransformConstraint#mixScaleY}, and {@link TransformConstraint#mixShearY}. */ * spine.TransformConstraint.mixScaleY, and spine.TransformConstraint.mixShearY. */
class TransformConstraintTimeline extends CurveTimeline { class TransformConstraintTimeline extends CurveTimeline {
static public inline var ENTRIES:Int = 7; static public inline var ENTRIES:Int = 7;
private static inline var ROTATE:Int = 1; private static inline var ROTATE:Int = 1;
@ -46,7 +46,7 @@ class TransformConstraintTimeline extends CurveTimeline {
private static inline var SCALEY:Int = 5; private static inline var SCALEY:Int = 5;
private static inline var SHEARY:Int = 6; private static inline var SHEARY:Int = 6;
/** The index of the transform constraint in {@link Skeleton#transformConstraints} that will be changed when this /** The index of the transform constraint in spine.Skeleton.transformConstraints that will be changed when this
* timeline is applied. */ * timeline is applied. */
public var constraintIndex:Int = 0; public var constraintIndex:Int = 0;

View File

@ -33,7 +33,7 @@ import spine.Bone;
import spine.Event; import spine.Event;
import spine.Skeleton; import spine.Skeleton;
/** Changes a bone's local {@link Bone#x} and {@link Bone#y}. */ /** Changes a bone's local spine.Bone.x and spine.Bone.y. */
class TranslateTimeline extends CurveTimeline2 implements BoneTimeline { class TranslateTimeline extends CurveTimeline2 implements BoneTimeline {
public var boneIndex:Int = 0; public var boneIndex:Int = 0;

View File

@ -33,7 +33,7 @@ import spine.Bone;
import spine.Event; import spine.Event;
import spine.Skeleton; import spine.Skeleton;
/** Changes a bone's local x value. */ /** Changes a bone's local spine.Bone.x. */
class TranslateXTimeline extends CurveTimeline1 implements BoneTimeline { class TranslateXTimeline extends CurveTimeline1 implements BoneTimeline {
public var boneIndex:Int = 0; public var boneIndex:Int = 0;

View File

@ -33,7 +33,7 @@ import spine.Bone;
import spine.Event; import spine.Event;
import spine.Skeleton; import spine.Skeleton;
/** Changes a bone's local {@link Bone#y}. */ /** Changes a bone's local y translation. */
class TranslateYTimeline extends CurveTimeline1 implements BoneTimeline { class TranslateYTimeline extends CurveTimeline1 implements BoneTimeline {
public var boneIndex:Int = 0; public var boneIndex:Int = 0;

View File

@ -32,6 +32,12 @@ package spine.attachments;
import spine.atlas.TextureAtlas; import spine.atlas.TextureAtlas;
import spine.Skin; import spine.Skin;
/**
* The interface which can be implemented to customize creating and populating attachments.
* <p>
* See <a href='https://esotericsoftware.com/spine-loading-skeleton-data#AttachmentLoader'>Loading skeleton data</a> in the Spine
* Runtimes Guide.
*/
class AtlasAttachmentLoader implements AttachmentLoader { class AtlasAttachmentLoader implements AttachmentLoader {
private var atlas:TextureAtlas; private var atlas:TextureAtlas;
@ -53,6 +59,9 @@ class AtlasAttachmentLoader implements AttachmentLoader {
} }
} }
/**
* @return May be null to not load the attachment.
*/
public function newRegionAttachment(skin:Skin, name:String, path:String, sequence:Sequence):RegionAttachment { public function newRegionAttachment(skin:Skin, name:String, path:String, sequence:Sequence):RegionAttachment {
var attachment = new RegionAttachment(name, path); var attachment = new RegionAttachment(name, path);
if (sequence != null) { if (sequence != null) {
@ -66,6 +75,9 @@ class AtlasAttachmentLoader implements AttachmentLoader {
return attachment; return attachment;
} }
/**
* @return May be null to not load the attachment. In that case null should also be returned for child meshes.
*/
public function newMeshAttachment(skin:Skin, name:String, path:String, sequence:Sequence):MeshAttachment { public function newMeshAttachment(skin:Skin, name:String, path:String, sequence:Sequence):MeshAttachment {
var attachment = new MeshAttachment(name, path); var attachment = new MeshAttachment(name, path);
if (sequence != null) { if (sequence != null) {
@ -79,18 +91,30 @@ class AtlasAttachmentLoader implements AttachmentLoader {
return attachment; return attachment;
} }
/**
* @return May be null to not load the attachment.
*/
public function newBoundingBoxAttachment(skin:Skin, name:String):BoundingBoxAttachment { public function newBoundingBoxAttachment(skin:Skin, name:String):BoundingBoxAttachment {
return new BoundingBoxAttachment(name); return new BoundingBoxAttachment(name);
} }
/**
* @return May be null to not load the attachment.
*/
public function newPathAttachment(skin:Skin, name:String):PathAttachment { public function newPathAttachment(skin:Skin, name:String):PathAttachment {
return new PathAttachment(name); return new PathAttachment(name);
} }
/**
* @return May be null to not load the attachment.
*/
public function newPointAttachment(skin:Skin, name:String):PointAttachment { public function newPointAttachment(skin:Skin, name:String):PointAttachment {
return new PointAttachment(name); return new PointAttachment(name);
} }
/**
* @return May be null to not load the attachment.
*/
public function newClippingAttachment(skin:Skin, name:String):ClippingAttachment { public function newClippingAttachment(skin:Skin, name:String):ClippingAttachment {
return new ClippingAttachment(name); return new ClippingAttachment(name);
} }

View File

@ -54,7 +54,7 @@ class MeshAttachment extends VertexAttachment implements HasTextureRegion {
public var height:Float = 0; public var height:Float = 0;
/** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */ /** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */
public var hullLength:Int = 0; public var hullLength:Int = 0;
/** Vertex index pairs describing edges for controlling triangulation, or be null if nonessential data was not exported. Mesh /** Vertex index pairs describing edges for controlling triangulation, or null if nonessential data was not exported. Mesh
* triangles will never cross edges. Triangulation is not performed at runtime. */ * triangles will never cross edges. Triangulation is not performed at runtime. */
public var edges = new Array<Int>(); public var edges = new Array<Int>();
public var rendererObject:Dynamic; public var rendererObject:Dynamic;
@ -65,13 +65,14 @@ class MeshAttachment extends VertexAttachment implements HasTextureRegion {
* parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */ * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */
private var _parentMesh:MeshAttachment; private var _parentMesh:MeshAttachment;
/** Copy constructor. Use newLinkedMesh() if the other mesh is a linked mesh. */
public function new(name:String, path:String) { public function new(name:String, path:String) {
super(name); super(name);
this.path = path; this.path = path;
} }
/** Calculates {@link #uvs} using the {@link #regionUVs} and region. Must be called if the region, the region's properties, or /** Calculates uvs using the regionUVs and region. Must be called if the region, the region's properties, or
* the {@link #regionUVs} are changed. */ * the regionUVs are changed. */
public function updateRegion():Void { public function updateRegion():Void {
if (region == null) { if (region == null) {
throw new SpineException("Region not set."); throw new SpineException("Region not set.");
@ -192,14 +193,14 @@ class MeshAttachment extends VertexAttachment implements HasTextureRegion {
return copy; return copy;
} }
/** If the attachment has a {@link #sequence}, the region may be changed. */ /** If the attachment has a sequence, the region may be changed. */
public override function computeWorldVertices(slot:Slot, start:Int, count:Int, worldVertices:Array<Float>, offset:Int, stride:Int):Void { public override function computeWorldVertices(slot:Slot, start:Int, count:Int, worldVertices:Array<Float>, offset:Int, stride:Int):Void {
if (sequence != null) if (sequence != null)
sequence.apply(slot, this); sequence.apply(slot, this);
super.computeWorldVertices(slot, start, count, worldVertices, offset, stride); super.computeWorldVertices(slot, start, count, worldVertices, offset, stride);
} }
/** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. */ /** Returns a new mesh with the parentMesh set to this mesh's parent mesh, if any, else to this mesh. */
public function newLinkedMesh():MeshAttachment { public function newLinkedMesh():MeshAttachment {
var copy:MeshAttachment = new MeshAttachment(name, path); var copy:MeshAttachment = new MeshAttachment(name, path);
copy.rendererObject = rendererObject; copy.rendererObject = rendererObject;

View File

@ -46,6 +46,7 @@ class PointAttachment extends VertexAttachment {
* attachments are not usually rendered at runtime. */ * attachments are not usually rendered at runtime. */
public var color:Color = new Color(0.38, 0.94, 0, 1); public var color:Color = new Color(0.38, 0.94, 0, 1);
/** Copy constructor. */
public function new(name:String) { public function new(name:String) {
super(name); super(name);
} }

View File

@ -66,7 +66,7 @@ class RegionAttachment extends Attachment implements HasTextureRegion {
/** For each of the 4 vertices, a pair of <code>x,y</code> values that is the local position of the vertex. /** For each of the 4 vertices, a pair of <code>x,y</code> values that is the local position of the vertex.
* *
* See {@link #updateRegion()}. */ * See RegionAttachment.updateRegion(). */
private var offsets:Array<Float> = new Array<Float>(); private var offsets:Array<Float> = new Array<Float>();
public var uvs:Array<Float> = new Array<Float>(); public var uvs:Array<Float> = new Array<Float>();
@ -80,7 +80,7 @@ class RegionAttachment extends Attachment implements HasTextureRegion {
this.path = path; this.path = path;
} }
/** Calculates the {@link #offsets} and {@link #uvs} using the region and the attachment's transform. Must be called if the /** Calculates the RegionAttachment.offsets and RegionAttachment.uvs using the region and the attachment's transform. Must be called if the
* region, the region's properties, or the transform are changed. */ * region, the region's properties, or the transform are changed. */
public function updateRegion():Void { public function updateRegion():Void {
if (region == null) { if (region == null) {
@ -145,12 +145,11 @@ class RegionAttachment extends Attachment implements HasTextureRegion {
} }
} }
/** Transforms the attachment's four vertices to world coordinates. If the attachment has a {@link #sequence}, the region may /** Transforms the attachment's four vertices to world coordinates. If the attachment has a RegionAttachment.sequence, the region may
* be changed. * be changed.
* *
* See <a href="https://esotericsoftware.com/spine-runtime-skeletons#World-transforms">World transforms</a> in the Spine * See <a href="https://esotericsoftware.com/spine-runtime-skeletons#World-transforms">World transforms</a> in the Spine
* Runtimes Guide. * Runtimes Guide.
* @param slot The slot the attachment is bound to.
* @param worldVertices The output world vertices. Must have a length >= <code>offset</code> + 8. * @param worldVertices The output world vertices. Must have a length >= <code>offset</code> + 8.
* @param offset The <code>worldVertices</code> index to begin writing values. * @param offset The <code>worldVertices</code> index to begin writing values.
* @param stride The number of <code>worldVertices</code> entries between the value pairs written. */ * @param stride The number of <code>worldVertices</code> entries between the value pairs written. */

View File

@ -34,20 +34,20 @@ import spine.Skeleton;
import spine.Slot; import spine.Slot;
/** Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's /** Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's
* {@link Slot#deform}. */ * spine.Slot.deform. */
class VertexAttachment extends Attachment { class VertexAttachment extends Attachment {
private static var nextID:Int = 0; private static var nextID:Int = 0;
/** The bones which affect the {@link vertices}. The array entries are, for each vertex, the number of bones affecting /** The bones which affect the vertices. The array entries are, for each vertex, the number of bones affecting
* the vertex followed by that many bone indices, which is the index of the bone in {@link Skeleton#bones}. Will be null * the vertex followed by that many bone indices, which is the index of the bone in spine.Skeleton.bones. Will be null
* if this attachment has no weights. */ * if this attachment has no weights. */
public var bones:Array<Int>; public var bones:Array<Int>;
/** The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are <code>x,y</code> /** The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are `x,y`
* entries for each vertex. For a weighted attachment, the values are <code>x,y,weight</code> entries for each bone affecting * entries for each vertex. For a weighted attachment, the values are `x,y,weight` entries for each bone affecting
* each vertex. */ * each vertex. */
public var vertices = new Array<Float>(); public var vertices = new Array<Float>();
/** The maximum number of world vertex values that can be output by /** The maximum number of world vertex values that can be output by
* {@link computeWorldVertices} using the <code>count</code> parameter. */ * computeWorldVertices() using the `count` parameter. */
public var worldVerticesLength:Int = 0; public var worldVerticesLength:Int = 0;
/** Returns a unique ID for this attachment. */ /** Returns a unique ID for this attachment. */
public var id:Int = nextID++; public var id:Int = nextID++;
@ -60,17 +60,17 @@ class VertexAttachment extends Attachment {
timelineAttachment = this; timelineAttachment = this;
} }
/** Transforms the attachment's local {@link #vertices} to world coordinates. If the slot's {@link Slot#deform} is /** Transforms the attachment's local vertices to world coordinates. If the slot's spine.Slot.deform is
* not empty, it is used to deform the vertices. * not empty, it is used to deform the vertices.
* <p> * <p>
* See <a href="https://esotericsoftware.com/spine-runtime-skeletons#World-transforms">World transforms</a> in the Spine * See <a href="https://esotericsoftware.com/spine-runtime-skeletons#World-transforms">World transforms</a> in the Spine
* Runtimes Guide. * Runtimes Guide.
* @param start The index of the first {@link #vertices} value to transform. Each vertex has 2 values, x and y. * @param start The index of the first vertices value to transform. Each vertex has 2 values, x and y.
* @param count The number of world vertex values to output. Must be <= {@link #worldVerticesLength} - <code>start</code>. * @param count The number of world vertex values to output. Must be <= worldVerticesLength - `start`.
* @param worldVertices The output world vertices. Must have a length >= <code>offset</code> + <code>count</code> * * @param worldVertices The output world vertices. Must have a length >= `offset` + `count` *
* <code>stride</code> / 2. * `stride` / 2.
* @param offset The <code>worldVertices</code> index to begin writing values. * @param offset The `worldVertices` index to begin writing values.
* @param stride The number of <code>worldVertices</code> entries between the value pairs written. */ * @param stride The number of `worldVertices` entries between the value pairs written. */
public function computeWorldVertices(slot:Slot, start:Int, count:Int, worldVertices:Array<Float>, offset:Int, stride:Int):Void { public function computeWorldVertices(slot:Slot, start:Int, count:Int, worldVertices:Array<Float>, offset:Int, stride:Int):Void {
count = offset + (count >> 1) * stride; count = offset + (count >> 1) * stride;
var skeleton:Skeleton = slot.skeleton; var skeleton:Skeleton = slot.skeleton;

View File

@ -79,6 +79,7 @@ class SkeletonSprite extends DisplayObject implements IAnimatable {
public var beforeUpdateWorldTransforms: SkeletonSprite -> Void = function(_) {}; public var beforeUpdateWorldTransforms: SkeletonSprite -> Void = function(_) {};
public var afterUpdateWorldTransforms: SkeletonSprite -> Void = function(_) {}; public var afterUpdateWorldTransforms: SkeletonSprite -> Void = function(_) {};
/** Creates an uninitialized SkeletonSprite. The skeleton and animation state must be set before use. */
public function new(skeletonData:SkeletonData, animationStateData:AnimationStateData = null) { public function new(skeletonData:SkeletonData, animationStateData:AnimationStateData = null) {
super(); super();
Bone.yDown = true; Bone.yDown = true;

View File

@ -98,7 +98,7 @@ public class Event {
return time; return time;
} }
/** The events's setup pose data. */ /** The event's setup pose data. */
public EventData getData () { public EventData getData () {
return data; return data;
} }