pixi-viewport
    Preparing search index...

    Class Decelerate

    Plugin to decelerate viewport velocity smoothly after panning ends.

    Hierarchy (View Summary)

    Index

    Options used to initialize this plugin.

    parent: Viewport

    The viewport to which this plugin is attached.

    paused: boolean

    Flags whether this plugin has been "paused".

    • Plugin#pause
    • Plugin#resume
    percentChangeX: number

    The decay factor for the x-component of the viewport.

    The viewport's velocity decreased by this amount each 16 milliseconds.

    percentChangeY: number

    The decay factor for the y-component of the viewport.

    The viewport's velocity decreased by this amount each 16 milliseconds.

    Saved list of recent viewport position snapshots, to estimate velocity.

    timeSinceRelease: number

    The time since the user released panning of the viewport.

    x: number | null

    x-component of the velocity of viewport provided by this plugin, at the current time.

    This is measured in px/frame, where a frame is normalized to 16 milliseconds.

    y: number | null

    y-component of the velocity of the viewport provided by this plugin, at the current time.

    This is measured in px/frame, where a frame is normalized to 16 milliseconds.

    • Manually activate deceleration, starting from the (x, y) velocity components passed in the options.

      Parameters

      • options: { x?: number; y?: number }
        • Optionalx?: number

          Specify x-component of initial velocity.

        • Optionaly?: number

          Specify y-component of initial velocity.

      Returns void