pixi-viewport
    Preparing search index...

    Class Drag

    Plugin to enable panning/dragging of the viewport to move around.

    Hierarchy (View Summary)

    Index
    current?: number

    The ID of the pointer currently panning the viewport.

    keyIsPressed: boolean

    Flags whether the keys required to drag are pressed currently.

    last?: PointData | null

    Last pointer position while panning.

    mouse: [boolean, boolean, boolean]

    Holds whether the left, center, and right buttons are required to pan.

    moved: boolean

    Flags when viewport is moving.

    Options used to initialize this plugin, cannot be modified later.

    parent: Viewport

    The viewport to which this plugin is attached.

    paused: boolean

    Flags whether this plugin has been "paused".

    • Plugin#pause
    • Plugin#resume
    reverse: -1 | 1

    Factor to apply from IDecelerateOptions's reverse.

    underflowX: -1 | 0 | 1

    Underflow factor along x-axis

    underflowY: -1 | 0 | 1

    Underflow factor along y-axis

    xDirection: boolean

    Holds whether dragging is enabled along the x-axis.

    yDirection: boolean

    Holds whether dragging is enabled along the y-axis.

    • Handles keypress events and set the keyIsPressed boolean accordingly

      Parameters

      • codes: string[]

        key codes that can be used to trigger drag event

      Returns void

    • initialize mousebuttons array

      Parameters

      • buttons: string

      Returns void

    • Called on each tick

      Parameters

      • _elapsed: number

        time in milliseconds since last update

      Returns void