animationEvent.ts 931 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * Composed of a frame, and an action function
  3. */
  4. export class AnimationEvent {
  5. /**
  6. * Specifies if the animation event is done
  7. */
  8. public isDone: boolean = false;
  9. /**
  10. * Initializes the animation event
  11. * @param frame The frame for which the event is triggered
  12. * @param action The event to perform when triggered
  13. * @param onlyOnce Specifies if the event should be triggered only once
  14. */
  15. constructor(
  16. /** The frame for which the event is triggered **/
  17. public frame: number,
  18. /** The event to perform when triggered **/
  19. public action: (currentFrame: number) => void,
  20. /** Specifies if the event should be triggered only once**/
  21. public onlyOnce?: boolean) {
  22. }
  23. /** @hidden */
  24. public _clone(): AnimationEvent {
  25. return new AnimationEvent(this.frame, this.action, this.onlyOnce);
  26. }
  27. }