Creates a new editor instance
The editor settings
Optional
registerShapes: RegisterShapesFn<Shapes>const editor = new Pikaso({
container: document.getElementById('myDiv') as HTMLDivElement
})
Represents the [[Board]]
Represents [[Cropper]] component
Represents the [[Events | event manager]]
This is also possible to Subscribe and Unsubscribe events with [[on | on method]] and [[off | off method]] of the main class
Represents the [[Export]]
Represents the [[Filter]]
Represents [[Flip]] component
Represents the [[History | actions history]]
Represents the [[Import]]
Represents the [[Rotation]] component
Represents the [[Selection]] component
Represents the [[ShapeModel | Shapes]] creators
Represents the [[SnapGrid]]
Loads the background image from url This method is a shortcut to [[Background.setImageFromFile]]
The image file
Optional
options: Partial<BackgroundOptions>The background options
Loads the background image from url This method is a shortcut to [[Background.setImageFromUrl]]
The image url
Optional
options: Partial<BackgroundOptions>The background options
UnSubscribes from one or multiple events
This method is a shortcut to [[Events.off]]
Subscribes to one or multiple events
This method is a shortcut to [[Events.on]]
Resizes the board based on the new container size
This method is a shortcut to [[Board.rescale]]
This method can be used with resize event of window to rescale the board
const editor = new Pikaso({
container: document.getElementById('myDiv') as HTMLDivElement
})
window.addEventListener('resize', () => {
editor.board.rescale()
})
This is the main class and entry point that creates a new editor instance
See
[[constructor]]