Skip to content
pixi-silk
GitHub repository
Interface

BrushCursorOptions

import type { BrushCursorOptions } from 'pixi-silk/ui/brush';

Options of BrushCursor. Sizes are diameters in the cursor’s coordinates.

Properties#

PropertyTypeDescriptionDefined in
bracketKeys?boolean[ and ] step the size. Default true.ui/brush.ts:28
color?string | numberRing colour. Default white.ui/brush.ts:41
hardness?number0 (soft) to 1 (hard). Default 0.7.ui/brush.ts:16
hardnessRate?numberHardness change per unit of vertical drag while resizing. Default 1 / 200.ui/brush.ts:32
hideCursor?booleanHide the OS cursor over surface. Default true.ui/brush.ts:39
maxSize?numberLargest diameter that resizing and BrushCursor.setBrushSize allow. Default 500.ui/brush.ts:22
minSize?numberSmallest diameter that resizing and BrushCursor.setBrushSize allow. Default 1.ui/brush.ts:20
opacity?numberStarting brush opacity, 0 to 1. Only stored on state.opacity for your brush engine. Default 1.ui/brush.ts:18
outline?string | numberSecond ring for contrast on light backgrounds. Default black.ui/brush.ts:43
resizeKey?string | nullHold this key (a KeyboardEvent.code) and move to resize. Default KeyF. null turns it off.ui/brush.ts:24
rightDragResize?booleanRight-button drag resizes too. Default true.ui/brush.ts:26
size?numberStarting diameter. Default 32.ui/brush.ts:14
sizeRate?numberSize change per unit of horizontal drag while resizing. Default 1.ui/brush.ts:30
surface?Container<ContainerChild>Painting area. The OS cursor is hidden over it, and right-drags on it resize. Its eventMode becomes static if it was not interactive. Without a surface, state.inside stays true.ui/brush.ts:37
ticker?Ticker | nullTicker driving the animation. Default Ticker.shared. null for manual BrushCursor.tick.ui/brush.ts:45