How to use the framesync.onFrameUpdate function in framesync

To help you get started, we’ve selected a few framesync examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Popmotion / popmotion / packages / popmotion / src / animations / tween / index.ts View on Github external
seek(newProgress: number) {
      elapsed = getValueFromProgress(0, duration, newProgress);
      onFrameUpdate(updateTween, true);
      return this;
    },
    reverse() {
github Popmotion / popmotion / src / actions / composite.js View on Github external
const onUpdate = (v) => {
        this.current[key] = v;
        onFrameUpdate(this.scheduledUpdate);
      };
github Popmotion / popmotion / src / actions / parallel.js View on Github external
const onUpdate = (v) => {
      this.current[i] = v;
      onFrameUpdate(this.scheduledUpdate);
    };
github Popmotion / popmotion / src / actions / value.js View on Github external
set(v) {
    this.toUpdate = v;
    onFrameUpdate(this.scheduledUpdate);
    return v;
  }
github Popmotion / popmotion / packages / popmotion / src / animations / tween / index.ts View on Github external
tweenTimer = onFrame().start((i) => {
      elapsed += timeSinceLastFrame() * playDirection;
      updateTween();
      if (isTweenComplete() && complete) {
        tweenTimer.stop();
        onFrameUpdate(complete, true);
      }
    });
  };
github Popmotion / popmotion / src / actions / index.js View on Github external
this.prev = this.current;

    const { onUpdate, passive } = this.props;

    if (this.update) {
      this.current = this.update(this.current);
    }

    if (onUpdate) {
      onUpdate(this.get(), this);
    }

    this.fireListeners();

    if (!passive && this._isActive) {
      onFrameUpdate(this.scheduledUpdate);
    }

    if (this.isActionComplete && this.isActionComplete()) {
      this.complete();
    }

    return this;
  };
github Popmotion / popmotion / src / actions / index.js View on Github external
start() {
    const { onStart, _onStart, passive } = this.props;

    if (!passive) {
      this._isActive = true;
      onFrameUpdate(this.scheduledUpdate);
    }

    if (this.onStart) this.onStart();
    if (onStart) onStart(this);
    if (_onStart) _onStart(this);

    return this;
  }
github Popmotion / popmotion / src / actions / rx.js View on Github external
const clock = () => action(({ update }) => {
  const nextFrame = () => {
    update();
    onFrameUpdate(nextFrame);
  };

  onFrameUpdate(nextFrame);

  return {
    stop: () => cancelOnFrameUpdate(nextFrame)
  };
});