Skip to content
pixi-silk
GitHub repository
Entry point

pixi-silk/ui/marquee

Marquee: drag a box to select.

import { Marquee, combineSelection, quadInside, quadIntersects } from 'pixi-silk/ui/marquee';

Classes#

ClassDescription
MarqueeRubber-band selection: drag on empty canvas to pick every object the rectangle touches (or fully contains). Shift adds to the selection, Alt takes away, Escape cancels.

Interfaces#

InterfaceDescription
MarqueeOptionsOptions of Marquee.
MarqueeStateThe reactive state of a Marquee.

Type Aliases#

Type AliasDescription
MarqueeModeintersect picks what the rectangle touches, contain only what is fully inside.
MarqueeOpHow a drag combines with the selection: replace it, add to it (Shift) or take away from it (Alt).

Functions#

FunctionDescription
combineSelectionCombines a selection with what a marquee covers. add appends hits not in base, keeping order. subtract removes them. Always returns a new array.
quadInsideTrue when all four corners of a quad are inside an axis-aligned rectangle, edges included.
quadIntersectsTrue when a parallelogram quad (corners in order, as boundsQuad returns) touches an axis-aligned rectangle. Edges that only touch count. Uses separating axes, so other quads may be wrong.