pronotron-tech-art-suite
    Preparing search index...

    Class PronotronAnimator

    PronotronAnimator - Controls scheduling, updating, and lifecycle management of animations.

    const clock = new PronotronClock();
    const animator = new PronotronAnimator( clock, 50 );
    animator.add({
    id: `unique_animation_id`,
    duration: 3.0, // in seconds
    delay: 0.5, // in seconds
    autoPause: true, // Animation pauses when screen is unfocused
    onBegin: ( currentTime, startTime, duration ) => {
    console.log( "Animation begin" );
    },
    onRender: ( currentTime, startTime, duration ) => {
    const timeline = ( currentTime - startTime ) / duration;
    console.log( Math.min( timeline, 1.0 ) );
    },
    onEnd: ( forced ) => {
    if ( ! forced ){
    console.log( "Animation finished naturally" );
    }
    }
    });
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Removes an animation by its external ID.

      Parameters

      • animationID: string

        The ID used when adding the animation.

      • forced: boolean = false

        If true, calls onEnd(forced = true) before removal.

      Returns void