Canvas
Functions
- addElement(elements, [callback]) ⇐
fabric.Canvas
Adds a set of elements into the view.
- addElement(type, source, title, [parameters]) ⇐
fabric.Canvas
Adds a new element to the view.
- resetSize(discardActiveObject) ⇐
fabric.Canvas
Deselects the current selected element.
- resetSize() ⇐
fabric.Canvas
Resets the canvas size considering the available space on the device.
- setResZoom(value) ⇐
fabric.Canvas
Sets the zoom of the stage. 1 is equal to no zoom.
- resetZoom() ⇐
fabric.Canvas
Resets the the zoom.
- getElements() ⇒
Array
Returns an array with fabricjs objects.
- getElementsJSON(title) ⇒
Object
Returns an fabric object by title.
- getElementByTitle(title) ⇒
Object
Returns an fabric object by title.
- getElementByID(id) ⇒
Object
Returns an fabric object by ID.
- reset() ⇐
fabric.Canvas
Removes the canvas and resets all relevant view properties.
- removeElement(element) ⇐
fabric.Canvas
Removes an element using the fabric object or the title of an element.
- getElementByReplace() ⇐
fabric.Canvas
Gets an elment by replace property.
- setElementOptions(parameters, [element]) ⇐
fabric.Canvas
Sets the parameters for a specified element.
- duplicateElement(element) ⇐
fabric.Canvas
Duplicates an element in the canvas.
- getUploadZone(title) ⇒
fabric.Object
Gets an upload zone by title.
- setMask(maskOptions, [callback]) ⇐
fabric.Canvas
Use a SVG image as mask for the whole view. The image needs to be a SVG file with only one path. The method toSVG() does not include the mask.
addElement(elements, [callback]) ⇐ fabric.Canvas
Adds a set of elements into the view.
Kind: global function
Extends: fabric.Canvas
Param | Type | Description |
---|---|---|
elements | Array | An array containing elements. |
[callback] | function | A function that will be called when all elements have beed added. |
addElement(type, source, title, [parameters]) ⇐ fabric.Canvas
Adds a new element to the view.
Kind: global function
Extends: fabric.Canvas
Param | Type | Default | Description |
---|---|---|---|
type | string | The type of an element you would like to add, 'image' or 'text'. | |
source | string | For image the URL to the image and for text elements the default text. | |
title | string | Only required for image elements. | |
[parameters] | object | {} | An object with the parameters, you would like to apply on the element. |
resetSize(discardActiveObject) ⇐ fabric.Canvas
Deselects the current selected element.
Kind: global function
Extends: fabric.Canvas
Param | Type | Description |
---|---|---|
discardActiveObject | Boolean | Discards currently active object and fire events |
resetSize() ⇐ fabric.Canvas
Resets the canvas size considering the available space on the device.
Kind: global function
Extends: fabric.Canvas
setResZoom(value) ⇐ fabric.Canvas
Sets the zoom of the stage. 1 is equal to no zoom.
Kind: global function
Extends: fabric.Canvas
Param | Type | Description |
---|---|---|
value | number | The zoom value. |
resetZoom() ⇐ fabric.Canvas
Resets the the zoom.
Kind: global function
Extends: fabric.Canvas
getElements() ⇒ Array
Returns an array with fabricjs objects.
Kind: global function
Extends: fabric.Canvas
Returns: Array
- An array with fabricjs objects.
getElementsJSON(title) ⇒ Object
Returns an fabric object by title.
Kind: global function
Extends: fabric.Canvas
Returns: Object
- FabricJS Object.
Param | Type | Description |
---|---|---|
title | string | The title of an element. |
getElementByTitle(title) ⇒ Object
Returns an fabric object by title.
Kind: global function
Extends: fabric.Canvas
Returns: Object
- FabricJS Object.
Param | Type | Description |
---|---|---|
title | string | The title of an element. |
getElementByID(id) ⇒ Object
Returns an fabric object by ID.
Kind: global function
Extends: fabric.Canvas
Returns: Object
- FabricJS Object.
Param | Type | Description |
---|---|---|
id | String | The ID of an element. |
reset() ⇐ fabric.Canvas
Removes the canvas and resets all relevant view properties.
Kind: global function
Extends: fabric.Canvas
removeElement(element) ⇐ fabric.Canvas
Removes an element using the fabric object or the title of an element.
Kind: global function
Extends: fabric.Canvas
Param | Type | Description |
---|---|---|
element | object | string | Needs to be a fabric object or the title of an element. |
getElementByReplace() ⇐ fabric.Canvas
Gets an elment by replace property.
Kind: global function
Extends: fabric.Canvas
setElementOptions(parameters, [element]) ⇐ fabric.Canvas
Sets the parameters for a specified element.
Kind: global function
Extends: fabric.Canvas
Param | Type | Description |
---|---|---|
parameters | object | An object with the parameters that should be applied to the element. |
[element] | fabric.Object | string | A fabric object or the title of an element. If no element is set, the parameters will be applied to the current selected element. |
duplicateElement(element) ⇐ fabric.Canvas
Duplicates an element in the canvas.
Kind: global function
Extends: fabric.Canvas
Param | Type | Description |
---|---|---|
element | fabric.Object | The target element. |
getUploadZone(title) ⇒ fabric.Object
Gets an upload zone by title.
Kind: global function
Extends: fabric.Canvas
Returns: fabric.Object
- A fabric object representing the upload zone.
Param | Type | Description |
---|---|---|
title | String | The target title of an element. |
setMask(maskOptions, [callback]) ⇐ fabric.Canvas
Use a SVG image as mask for the whole view. The image needs to be a SVG file with only one path. The method toSVG() does not include the mask.
Kind: global function
Extends: fabric.Canvas
Param | Type | Description |
---|---|---|
maskOptions | Object | Null | An object containing the URL to the svg. Optional: scaleX, scaleY, left and top. |
[callback] | function | A function when mask is loaded and set. Returns the mask or null, when mask could not be loaded. |