phaser - v4.0.0-rc.4
    Preparing search index...

    Provides methods used for managing a Game Object following a Path. Should be applied as a mixin and not used directly.

    interface PathFollower {
        path: Path;
        rotateToPath: boolean;
        isFollowing(): boolean;
        pathUpdate(): void;
        pauseFollow(): this;
        resumeFollow(): this;
        setPath(
            path: Path,
            config?: number | PathConfig | NumberTweenBuilderConfig,
        ): this;
        setRotateToPath(value: boolean, offset?: number): this;
        startFollow(
            config?: number | PathConfig | NumberTweenBuilderConfig,
            startAt?: number,
        ): this;
        stopFollow(): this;
    }

    Implemented by

    Index

    Properties

    path: Path

    The Path this PathFollower is following. It can only follow one Path at a time.

    rotateToPath: boolean

    Should the PathFollower automatically rotate to point in the direction of the Path?

    Methods

    • Is this PathFollower actively following a Path or not?

      To be considered as isFollowing it must be currently moving on a Path, and not paused.

      Returns boolean

    • Internal update handler that advances this PathFollower along the path.

      Called automatically by the Scene step, should not typically be called directly.

      Returns void

    • Pauses this PathFollower. It will still continue to render, but it will remain motionless at the point on the Path at which you paused it.

      Returns this

    • Resumes a previously paused PathFollower.

      If the PathFollower was not paused this has no effect.

      Returns this

    • Set whether the PathFollower should automatically rotate to point in the direction of the Path.

      Parameters

      • value: boolean

        Whether the PathFollower should automatically rotate to point in the direction of the Path.

      • Optionaloffset: number

        Rotation offset in degrees. Default 0.

      Returns this

    • Stops this PathFollower from following the path any longer.

      This will invoke any 'stop' conditions that may exist on the Path, or for the follower.

      Returns this