# Class AnimationFrameLoop

- Defined in lib/five/utils/animationFrameLoop.ts:58

##### Index

### Constructors

constructor

### Accessors

shared

### Methods

add
clear
getContext
getLoopType
setContext
setLoopType
start
stop
getFrameTime

## Constructors

### constructor

- new AnimationFrameLoop(): AnimationFrameLoop

  #### Returns AnimationFrameLoop

  - Defined in lib/five/utils/animationFrameLoop.ts:79

## Accessors

### `Static` shared

- get shared(): AnimationFrameLoop

  #### Returns AnimationFrameLoop

  - Defined in lib/five/utils/animationFrameLoop.ts:68

## Methods

### add

- add(
  callback: (
  time: number,
  deltaTime: number,
  ...requestAnimationFrameArgs: [
  domHighResTimeStamp: number,
  ...args: any[],
  ],
  ) => void,
  once?: boolean,
  delay?: number,
  order?: number,
  ): () => void

  添加到动画循环

  #### Parameters

  - callback: (
    time: number,
    deltaTime: number,
    ...requestAnimationFrameArgs: [domHighResTimeStamp: number, ...args: any[]],
    ) => void

    动画循环回调

  - once: boolean = false

    是否只回调一次

  - delay: number = 0

    延迟多少个动画循环回调

  - order: number = DEFAULT_ORDER

    优先级，数字越小越早被调用

  #### Returns () => void

  移除动画循环函数

  - Defined in lib/five/utils/animationFrameLoop.ts:206

### clear

- clear(): void

  #### Returns void

  - Defined in lib/five/utils/animationFrameLoop.ts:226

### getContext

- getContext<
  T extends
  AnimationFrameContext<any[], any> = AnimationFrameContext<any[], any>,
  >(): T
  | null

  #### Type Parameters

  - T extends AnimationFrameContext<any[], any> = AnimationFrameContext<any[], any>

  #### Returns T | null

  - Defined in lib/five/utils/animationFrameLoop.ts:147

### getLoopType

- getLoopType(): AnimationFrameLoopType

  #### Returns AnimationFrameLoopType

  - Defined in lib/five/utils/animationFrameLoop.ts:159

### setContext

- setContext(context: AnimationFrameContext<any[], any> | null): void

  #### Parameters

  - context: AnimationFrameContext<any[], any> | null

  #### Returns void

  - Defined in lib/five/utils/animationFrameLoop.ts:139

### setLoopType

- setLoopType(type: AnimationFrameLoopType): void

  #### Parameters

  - type: AnimationFrameLoopType

  #### Returns void

  - Defined in lib/five/utils/animationFrameLoop.ts:151

### start

- start(): void

  #### Returns void

  - Defined in lib/five/utils/animationFrameLoop.ts:126

### stop

- stop(): void

  #### Returns void

  - Defined in lib/five/utils/animationFrameLoop.ts:134

### `Static` getFrameTime

- getFrameTime(): number

  #### Returns number

  - Defined in lib/five/utils/animationFrameLoop.ts:75