Class AnimationFrame<StaticProps, ChangeableProps, CallbacksTypes>

Launch an animation frame with a certain FPS

Type Parameters

Hierarchy

  • Component<StaticProps, ChangeableProps, CallbacksTypes>
    • AnimationFrame

Constructors

Properties

_computedFPS: number

Computed fps

_firstFrameTime: null | number

First frame time

_frame: null | number

The animation frame

_frameDurations: number[]

Array of frame time durations

_frameIndex: number

Last frame time

_isPlaying: boolean

If the frame is launched

_lastFrameTime: null | number

Last frame time

Accessors

  • get isDestroyed(): boolean
  • The module is destroyed

    Returns boolean

  • get isInitialized(): boolean
  • The module is initialized

    Returns boolean

  • get props(): TRequiredModuleProp<StaticProps & ChangeableProps>
  • Current properties

    Returns TRequiredModuleProp<StaticProps & ChangeableProps>

Methods

  • Get Default properties (should be extended)

    Returns DeepRequired<StaticProps & ChangeableProps> & {
        autoFpsFrames: number;
        fps: string;
        isEnabled: boolean;
    }

  • Add a DOM event listener

    Type Parameters

    • El extends ListenerElement

    • Target extends keyof HTMLElementEventMap

    • Callback extends ((evt) => void)

    Parameters

    • el: El
    • target: Target
    • callback: Callback
    • Optional options: IAddEventListenerOptions

    Returns IAddEventListener