pixi-viewport
    Preparing search index...

    Interface IWheelOptions

    Options for Wheel.

    interface IWheelOptions {
        axis?: "all" | "x" | "y";
        center?: Point | null;
        interrupt?: boolean;
        keyToPress?: string[] | null;
        lineHeight?: number;
        percent?: number;
        reverse?: boolean;
        smooth?: number | false;
        trackpadPinch?: boolean;
        trackpadPinchSpeed?: number;
        wheelZoom?: boolean;
    }
    Index
    axis?: "all" | "x" | "y"

    Axis to zoom

    'all'
    
    center?: Point | null

    Place this point at center during zoom instead of current mouse position

    null
    
    interrupt?: boolean

    Stop smoothing with any user input on the viewport

    true
    
    keyToPress?: string[] | null

    Array containing KeyboardEvent.code values of keys that can be pressed for the zoom to be triggered, e.g.: ['ShiftLeft', 'ShiftRight'}.

    null
    
    lineHeight?: number

    Scaling factor for non-DOM_DELTA_PIXEL scrolling events

    20
    
    percent?: number

    Adjusts the zoom speed. Despite its name, this is not the percent zoomed per spin.

    Each wheel event multiplies the scale by 2 ^ ((1 + percent) * -deltaY / 500) (or 2 ^ ((1 + percent) * trackpadPinchSpeed * -deltaY / 200) for a trackpad pinch with trackpadPinch on). For a typical mouse wheel notch (deltaY = 100) this zooms by about:

    • -0.5 → 7%
    • 0 → 15%
    • 0.1 (default) → 16.5%
    • 0.5 → 23%
    • 1 → 32%

    Use a negative value to zoom slower than the default. -1 stops zooming and values below -1 reverse it. deltaY varies by browser, OS, and device, so the actual amount per notch varies too.

    0.1
    
    reverse?: boolean

    Reverse the direction of the scroll

    false
    
    smooth?: number | false

    smooth the zooming by providing the number of frames to zoom between wheel spins

    false
    
    trackpadPinch?: boolean

    Pinch the trackpad to zoom. Browsers send a trackpad pinch as wheel events with ctrlKey set; with this on, those events zoom using trackpadPinchSpeed (and zoom even when wheelZoom is false).

    false
    
    trackpadPinchSpeed?: number

    Multiplies the zoom speed of a trackpad pinch (only used when trackpadPinch is on). Unlike percent, it doesn't change mouse wheel zooming.

    A pinch arrives as many wheel events with small deltas (deltaY around 2 to 10). At 1, an event with deltaY = 5 zooms by about 2%; at 2.5, about 5%, which is close to how map apps feel.

    1
    
    wheelZoom?: boolean

    zooms on wheel spin (use this as an alternative to drag.options.wheel)