The 2D layer · function

routeScrollWheel

Give a wheel to the innermost container under the pointer that can use it, then outwards.

Explained in Sprites and tilemaps.

function routeScrollWheel(root: UiNode, x: number, y: number, dx: number, dy: number): UiNode | null
import { routeScrollWheel } from '@driftengine/ui2d';

Parameters

ParameterTypeDescription
rootUiNode
xnumber
ynumber
dxnumber
dynumber

In depth

Innermost first is the order a person expects and the opposite of the order the tree makes convenient, so the chain is collected on the way down and walked back up. Returns the node that consumed it, or null when nothing did — which is a caller's signal to let the page have it.