CanvasGridOptions
import type { CanvasGridOptions } from 'pixi-silk/ui/grid';
Options of CanvasGrid. In dots style, alpha defaults to 0.32 and fade to
[12, 160], so dots read as strong as lines.
Extends#
Properties#
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
alpha? | number | Opacity of a line at full strength, 0..1. Default 0.1. | GridLevelOptions.alpha | ui/grid.ts:29 |
axes? | boolean | Draws the x = 0 and y = 0 axes in axisColor, 1 pixel wide. Default false. Change it later through state.axes. | - | ui/grid.ts:50 |
axisAlpha? | number | Opacity of the axes, 0..1. Default 0.5. | - | ui/grid.ts:54 |
axisColor? | ColorSource | Colour of the axes. Default 0x64a8ff. | - | ui/grid.ts:52 |
camera | Camera | The camera the grid follows. The grid redraws whenever the camera’s signals change. | - | ui/grid.ts:40 |
color? | ColorSource | Line and dot colour. Default white. | - | ui/grid.ts:44 |
dotSize? | number | Dot diameter in CSS pixels. Default 2. A level is skipped when its spacing is below twice this. | - | ui/grid.ts:48 |
fade? | [number, number] | Screen spacing in CSS pixels where a level starts to show and where it reaches full strength. Default [6, 120]. | GridLevelOptions.fade | ui/grid.ts:31 |
lineWidth? | number | Line width in CSS pixels. Default 1. A level is skipped when its spacing is below twice this. | - | ui/grid.ts:46 |
ratio? | number | Each level is this many times the one below. Default 10, at least 2. | GridLevelOptions.ratio | ui/grid.ts:27 |
style? | GridStyle | Lines or dots. Default lines. Change it later through state.style, and the grid crossfades. | - | ui/grid.ts:42 |
ticker? | Ticker | null | Ticker that runs fades and redraws. Default Ticker.shared. With null, call CanvasGrid.tick yourself. | - | ui/grid.ts:56 |
unit? | number | Finest step, in world units. Default 1, a pixel grid at 100%. Must be above 0. | GridLevelOptions.unit | ui/grid.ts:25 |