Interface: PaintCanvasOptions
Defined in: src/lib/classes/PaintCanvas/index.ts:259
Properties
createCanvas?
optionalcreateCanvas?:CanvasFactory
Defined in: src/lib/classes/PaintCanvas/index.ts:279
Creates the canvases the engine draws in: layers, stroke buffers, masks and copies. Chosen by rendering unless
given (replaceable for tests).
height?
optionalheight?:number
Defined in: src/lib/classes/PaintCanvas/index.ts:263
Canvas height in pixels
layerStore?
optionallayerStore?:LayerStoreLike
Defined in: src/lib/classes/PaintCanvas/index.ts:287
Where to keep the user's layers so the drawing survives reloading the page (see useLayerStore)
maxCanvasSize?
optionalmaxCanvasSize?:number
Defined in: src/lib/classes/PaintCanvas/index.ts:265
Largest canvas width or height allowed (default MAX_CANVAS_SIZE)
maxLayers?
optionalmaxLayers?:number
Defined in: src/lib/classes/PaintCanvas/index.ts:267
Most layers the user can have (default DEFAULT_MAX_LAYERS)
names?
optionalnames?:Partial<PaintCanvasNames>
Defined in: src/lib/classes/PaintCanvas/index.ts:285
Names to use instead of PaintCanvas's own (see DEFAULT_NAMES)
presetAuthor?
optionalpresetAuthor?: () =>AssetAuthor
Defined in: src/lib/classes/PaintCanvas/index.ts:283
Gives the author of presets made with newPreset (asked each time, so it can follow name changes)
Returns
remoteDocumentStore?
optionalremoteDocumentStore?:DocumentStoreLike
Defined in: src/lib/classes/PaintCanvas/index.ts:289
Where to keep the whole drawing away from the browser, saved less often (see useRemoteDocumentStore)
rendering?
optionalrendering?:"cpu"|"gpu"
Defined in: src/lib/classes/PaintCanvas/index.ts:274
Where the canvases draw (cpu by default): cpu keeps their pixels in regular memory (createMemoryCanvas) so
saving and copying don't stall phones; gpu asks the browser to keep them on the GPU (createOffscreenCanvas).
Browsers fix this when a canvas is made, so it can't change while the canvas runs: to follow the user's choice
(ui.data.rendering), pass the one they made last time (<paint-canvas> does this with its settings-store).
stores?
optionalstores?:AssetStores
Defined in: src/lib/classes/PaintCanvas/index.ts:281
Where the user's assets (brush presets, colour palettes, profile graphs) are kept (see useAssetStores)
systemClipboard?
optionalsystemClipboard?:SystemClipboardLike|null
Defined in: src/lib/classes/PaintCanvas/index.ts:294
The system clipboard, which copying and cutting also put a PNG of the copied image data on so other apps (and brush
shapes) can use it (the browser's by default; null for none)
width?
optionalwidth?:number
Defined in: src/lib/classes/PaintCanvas/index.ts:261
Canvas width in pixels