loop is
+ /// true then the animation will repeat, else the last frame will be applied.
+ /// If true, the animation repeats after the blend). 1 applies the timeline values. Between
+ /// 0 and 1 applies values between the current or setup values and the timeline values. By adjusting
+ /// 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).
+ /// Controls how mixing is applied when alpha < 1.
+ /// Indicates whether the timelines are mixing in or out. Used by timelines which perform instant transitions,
+ /// such as alpha < 1.First is intended for the first animations applied, not for animations layered on top of those.Replace is intended for animations layered on top of others, not for the first animations applied.Add is intended for animations layered on top of others, not for the first animations applied. Properties
+ /// set by additive animations must be set manually or by another animation before applying the additive animations, else the
+ /// property values will increase each time the additive animations are applied.
+ /// 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.lastTime (exclusive) and time (inclusive). Pass -1 the first time an animation is
+ /// applied to ensure frame 0 is triggered.
+ /// The time in seconds that 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 last frame, the last frame will be
+ /// applied.
+ /// If any events are fired, they are added to this list. Can be null to ignore fired events or if the timeline
+ /// does not fire events.
+ /// 0 applies the current or setup value (depending on blend). 1 applies the timeline value.
+ /// Between 0 and 1 applies a value between the current or setup value and the timeline value.By adjusting
+ /// 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).
+ /// Controls how mixing is applied when alpha < 1.
+ /// Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions,
+ /// such as frames.
+ /// time.frames.
+ /// time.frameCount - 1, inclusive.
+ public void SetLinear (int frame) {
+ curves[frame] = LINEAR;
+ }
+
+ /// frameCount - 1, inclusive.
+ public void SetStepped (int frame) {
+ curves[frame] = STEPPED;
+ }
+
+ /// frameCount - 1, inclusive.
+ /// bezierCount (specified in the constructor) was larger
+ /// than the actual number of Bezier curves.bezierCount - 1 (specified
+ /// in the constructor), inclusive.
+ /// Between 0 and frameCount - 1, inclusive.
+ /// The index of the value for the frame this curve is used for.
+ /// The time for the first key.
+ /// The value for the first key.
+ /// The time for the first Bezier handle.
+ /// The value for the first Bezier handle.
+ /// The time of the second Bezier handle.
+ /// The value for the second Bezier handle.
+ /// The time for the second key.
+ /// The value for the second key.
+ public void SetBezier (int bezier, int frame, int value, float time1, float value1, float cx1, float cy1, float cx2,
+ float cy2, float time2, float value2) {
+
+ float[] curves = this.curves;
+ int i = FrameCount + bezier * BEZIER_SIZE;
+ if (value == 0) curves[frame] = BEZIER + i;
+ float tmpx = (time1 - cx1 * 2 + cx2) * 0.03f, tmpy = (value1 - cy1 * 2 + cy2) * 0.03f;
+ float dddx = ((cx1 - cx2) * 3 - time1 + time2) * 0.006f, dddy = ((cy1 - cy2) * 3 - value1 + value2) * 0.006f;
+ float ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy;
+ float dx = (cx1 - time1) * 0.3f + tmpx + dddx * 0.16666667f, dy = (cy1 - value1) * 0.3f + tmpy + dddy * 0.16666667f;
+ float x = time1 + dx, y = value1 + dy;
+ for (int n = i + BEZIER_SIZE; i < n; i += 2) {
+ curves[i] = x;
+ curves[i + 1] = y;
+ dx += ddx;
+ dy += ddy;
+ ddx += dddx;
+ ddy += dddy;
+ x += dx;
+ y += dy;
+ }
+ }
+
+ /// time.
+ /// The offset from frameIndex to the value this curve is used for.
+ /// The index of the Bezier segments. See frameCount, inclusive.
+ /// The frame time in seconds
+ public void SetFrame (int frame, float time, float value) {
+ frame <<= 1;
+ frames[frame] = time;
+ frames[frame + VALUE] = value;
+ }
+
+ /// frameCount, inclusive.
+ /// The frame time in seconds.
+ public void SetFrame (int frame, float time, float value1, float value2) {
+ frame *= ENTRIES;
+ frames[frame] = time;
+ frames[frame + VALUE1] = value1;
+ frames[frame + VALUE2] = value2;
+ }
+ }
+
+ /// frameCount, inclusive.
+ /// The frame time in seconds.
+ public void SetFrame (int frame, float time, float r, float g, float b, float a) {
+ frame *= ENTRIES;
+ frames[frame] = time;
+ frames[frame + R] = r;
+ frames[frame + G] = g;
+ frames[frame + B] = b;
+ frames[frame + A] = a;
+ }
+
+ override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedListframeCount, inclusive.
+ /// The frame time in seconds.
+ public void SetFrame (int frame, float time, float r, float g, float b) {
+ frame <<= 2;
+ frames[frame] = time;
+ frames[frame + R] = r;
+ frames[frame + G] = g;
+ frames[frame + B] = b;
+ }
+
+ override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedListframeCount, inclusive.
+ /// The frame time in seconds.
+ public void SetFrame (int frame, float time, float r, float g, float b, float a, float r2, float g2, float b2) {
+ frame <<= 3;
+ frames[frame] = time;
+ frames[frame + R] = r;
+ frames[frame + G] = g;
+ frames[frame + B] = b;
+ frames[frame + A] = a;
+ frames[frame + R2] = r2;
+ frames[frame + G2] = g2;
+ frames[frame + B2] = b2;
+ }
+
+ override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedListframeCount, inclusive.
+ /// The frame time in seconds.
+ public void SetFrame (int frame, float time, float r, float g, float b, float r2, float g2, float b2) {
+ frame *= ENTRIES;
+ frames[frame] = time;
+ frames[frame + R] = r;
+ frames[frame + G] = g;
+ frames[frame + B] = b;
+ frames[frame + R2] = r2;
+ frames[frame + G2] = g2;
+ frames[frame + B2] = b2;
+ }
+
+ override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedListframeCount, inclusive.
+ /// The frame time in seconds.
+ public void SetFrame (int frame, float time, String attachmentName) {
+ frames[frame] = time;
+ attachmentNames[frame] = attachmentName;
+ }
+
+ public override void Apply (Skeleton skeleton, float lastTime, float time, ExposedListframeCount, inclusive.
+ /// The frame time in seconds.
+ /// Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights.
+ public void SetFrame (int frame, float time, float[] vertices) {
+ frames[frame] = time;
+ this.vertices[frame] = vertices;
+ }
+
+ /// Ignored (0 is used for a deform timeline).
+ /// Ignored (1 is used for a deform timeline).
+ public void setBezier (int bezier, int frame, int value, float time1, float value1, float cx1, float cy1, float cx2,
+ float cy2, float time2, float value2) {
+ float[] curves = this.curves;
+ int i = FrameCount + bezier * BEZIER_SIZE;
+ if (value == 0) curves[frame] = BEZIER + i;
+ float tmpx = (time1 - cx1 * 2 + cx2) * 0.03f, tmpy = cy2 * 0.03f - cy1 * 0.06f;
+ float dddx = ((cx1 - cx2) * 3 - time1 + time2) * 0.006f, dddy = (cy1 - cy2 + 0.33333333f) * 0.018f;
+ float ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy;
+ float dx = (cx1 - time1) * 0.3f + tmpx + dddx * 0.16666667f, dy = cy1 * 0.3f + tmpy + dddy * 0.16666667f;
+ float x = time1 + dx, y = dy;
+ for (int n = i + BEZIER_SIZE; i < n; i += 2) {
+ curves[i] = x;
+ curves[i + 1] = y;
+ dx += ddx;
+ dy += ddy;
+ ddx += dddx;
+ ddy += dddy;
+ x += dx;
+ y += dy;
+ }
+ }
+
+ /// time.
+ private float GetCurvePercent (float time, int frame) {
+ float[] curves = this.curves;
+ int i = (int)curves[frame];
+ switch (i) {
+ case LINEAR:
+ float x = frames[frame];
+ return (time - x) / (frames[frame + FrameEntries] - x);
+ case STEPPED:
+ return 0;
+ }
+ i -= BEZIER;
+ if (curves[i] > time) {
+ float x = frames[frame];
+ return curves[i + 1] * (time - x) / (curves[i] - x);
+ }
+ int n = i + BEZIER_SIZE;
+ for (i += 2; i < n; i += 2) {
+ if (curves[i] >= time) {
+ float x = curves[i - 2], y = curves[i - 1];
+ return y + (time - x) / (curves[i] - x) * (curves[i + 1] - y);
+ }
+ }
+ { // scope added to prevent compile error "float x and y declared in enclosing scope"
+ float x = curves[n - 2], y = curves[n - 1];
+ return y + (1 - y) * (time - x) / (frames[frame + FrameEntries] - x);
+ }
+ }
+
+ override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedListframeCount, inclusive.
+ public void SetFrame (int frame, Event e) {
+ frames[frame] = e.time;
+ events[frame] = e;
+ }
+
+ /// lastTime and <= time.frameCount, inclusive.
+ /// The frame time in seconds.
+ /// For each slot in frameCount, inclusive.
+ /// The frame time in seconds.
+ /// 1 or -1.
+ public void SetFrame (int frame, float time, float mix, float softness, int bendDirection, bool compress,
+ bool stretch) {
+ frame *= ENTRIES;
+ frames[frame] = time;
+ frames[frame + MIX] = mix;
+ frames[frame + SOFTNESS] = softness;
+ frames[frame + BEND_DIRECTION] = bendDirection;
+ frames[frame + COMPRESS] = compress ? 1 : 0;
+ frames[frame + STRETCH] = stretch ? 1 : 0;
+ }
+
+ override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedListframeCount, inclusive.
+ /// The frame time in seconds.
+ public void SetFrame (int frame, float time, float mixRotate, float mixX, float mixY, float mixScaleX, float mixScaleY,
+ float mixShearY) {
+ frame *= ENTRIES;
+ frames[frame] = time;
+ frames[frame + ROTATE] = mixRotate;
+ frames[frame + X] = mixX;
+ frames[frame + Y] = mixY;
+ frames[frame + SCALEX] = mixScaleX;
+ frames[frame + SCALEY] = mixScaleY;
+ frames[frame + SHEARY] = mixShearY;
+ }
+
+ override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedListframeCount, inclusive.
+ /// The frame time in seconds.
+ public void SetFrame (int frame, float time, float mixRotate, float mixX, float mixY) {
+ frame <<= 2;
+ frames[frame] = time;
+ frames[frame + ROTATE] = mixRotate;
+ frames[frame + X] = mixX;
+ frames[frame + Y] = mixY;
+ }
+
+ override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedListframeCount, inclusive.
+ /// Seconds between frames.
+ public void SetFrame (int frame, float time, SequenceMode mode, int index, float delay) {
+ frame *= ENTRIES;
+ frames[frame] = time;
+ frames[frame + MODE] = (int)mode | (index << 4);
+ frames[frame + DELAY] = delay;
+ }
+
+ override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedListDelay (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.
+ ///
+ /// 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.
+ /// Delay
+ /// postpones incrementing the 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 Delay).delay <= 0, the delay
+ /// is set using the mix duration from the AnimationStart time, it often makes sense to set AnimationLast time (exclusive) and
+ /// AnimationTime (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation
+ /// is applied.AnimationTime. When the TrackTime is 0, the
+ /// AnimationTime is equal to the AnimationStart time.
+ /// animationTime is between animationTime continues to increase past Delay <= 0, the
+ /// 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.
+ /// AttachmentThreshold, 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.
+ ///DrawOrderThreshold, 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.
+ /// next makes up a doubly linked
+ /// list.
+ /// previous makes up a doubly linked list.MixDuration when the mix is complete.MixDuration can be set manually rather than use the value from
+ /// MixDuration can be set for a new
+ /// track entry only before Delay <= 0, the
+ /// mixDuration is set
+ /// afterward, the delay may need to be adjusted. For example:
+ /// entry.Delay = entry.previous.TrackComplete - entry.MixDuration;
+ /// MixBlend can be set for a new track entry only before MixingFrom makes up a linked list.MixingTo makes up a linked list.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
+ /// keys the property, only when a higher track also keys the property.HoldPrevious is true and this animation does not key all the same properties as the
+ /// previous animation.+ /// See Point Attachments in the Spine User Guide. + ///
x,y values that is the local position of the vertex.