new Pattern()
Pattern class
- Source:
- See:
-
- Pattern demo
- DynamicPattern demo
- fabric.Pattern#initialize for constructor definition
Members
crossOrigin :String
crossOrigin value (one of "", "anonymous", "use-credentials")
Type:
- String
- Source:
- See:
offsetX :Number
Pattern horizontal offset from object's left/top corner
Type:
- Number
offsetY :Number
Pattern vertical offset from object's left/top corner
Type:
- Number
patternTransform :Array
transform matrix to change the pattern, imported from svgs.
Type:
- Array
repeat :String
Repeat property of a pattern (one of repeat, repeat-x, repeat-y or no-repeat)
Type:
- String
Methods
initialize(optionsopt, callbackopt) → {fabric.Pattern}
Constructor
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
Object |
<optional> |
Options object |
callback |
function |
<optional> |
function to invoke after callback init. |
Returns:
thisArg
- Type
- fabric.Pattern
toLive(ctx) → {CanvasPattern}
Returns an instance of CanvasPattern
Parameters:
Name | Type | Description |
---|---|---|
ctx |
CanvasRenderingContext2D | Context to create pattern |
Returns:
- Type
- CanvasPattern
toObject(propertiesToIncludeopt) → {Object}
Returns object representation of a pattern
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
propertiesToInclude |
Array |
<optional> |
Any properties that you might want to additionally include in the output |
Returns:
Object representation of a pattern instance
- Type
- Object
toSVG(object) → {String}
Returns SVG representation of a pattern
Parameters:
Name | Type | Description |
---|---|---|
object |
fabric.Object |
Returns:
SVG representation of a pattern
- Type
- String