MCPcopy
hub / github.com/spritejs/spritejs / Animation

Interface Animation

typings/spritejs.d.ts:144–203  ·  view source on GitHub ↗

* Web animation for sprite nodes.

Source from the content-addressed store, hash-verified

142 * Web animation for sprite nodes.
143 */
144 interface Animation {
145 readonly effects: Record<string, any>;
146 /**
147 * The finished promise resolved when the animation's playstate is finished.
148 */
149 readonly finished: Promise<void>;
150 /**
151 * The current frame props of the animation.
152 */
153 readonly frame: Partial<Attrs>;
154 /**
155 * The playState of the animation.
156 * Valid values are 'idel' or 'running' or 'pending' or 'paused' or 'finished'.
157 */
158 readonly playState: playState;
159 /**
160 * The progress of the animation.
161 * The value is between [0, 1].
162 */
163 readonly progress: number;
164 /**
165 * The ready promise resolved when the animation's playstate is ready.
166 */
167 readonly ready: Promise<void>;
168 /**
169 * Timing properties of an animation.
170 */
171 readonly timing: Timing;
172 /**
173 * Custom timeline. https://github.com/spritejs/sprite-timeline
174 */
175 baseTimeline: Timeline;
176 /**
177 * Sets the rate at which the animation is being played back.
178 */
179 playbackRate: number;
180 /**
181 * Apply animation effects to the animation.
182 * @param effects The effect function maps.
183 * @returns All effect function maps.
184 */
185 applyEffects(effects: Record<string, Function>): Record<string, Function>;
186 /**
187 * Cancel the animation.
188 * @param preserveState Whether the frame state is preserved when the animation is canceled.
189 */
190 cancel(preserveState?: boolean): void;
191 /**
192 * Finish the animation.
193 */
194 finish(): void;
195 /**
196 * Pause the animation. Set the timeline's playbackRate to 0.
197 */
198 pause(): void;
199 /**
200 * Play the animation.
201 */

Callers 39

animateMethod · 0.95
node.jsFile · 0.80
spritejs.min.jsFile · 0.80
animateMethod · 0.80
animateMethod · 0.80
animateMethod · 0.80
animateMethod · 0.80
spritejs.worker.jsFile · 0.80
index.jsFile · 0.65
node.jsFile · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected