Constructor
new module:Pattern(source, options)
Pattern constructor
Parameters:
Name | Type | Description |
---|---|---|
source | HTMLImageElement | | Source of the pattern |
options | PatternOptions | Some options |
Members
(static) defaultOptions
(static) repetition
height
source
source
width
Methods
toString(ctx) → {CanvasPattern}
Return the pattern object
Parameters:
Name | Type | Description |
---|---|---|
ctx | CanvasRenderingContext2D | Drawing context |
Returns:
- Type:
- CanvasPattern
Type Definitions
PatternOptions
Type:
Properties- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
repeat | String | <optional> | Pattern.repetition.repeat | Repetition rule |
origin | PositionDefinition | <optional> | new Position() | Relative offset |
scale | Number | | <optional> | 1 | Scaling ratio or a pair of value for horizontal and vertical scaling |
PatternRepetitions
Type:
Properties- Object
Name | Type | Description |
---|---|---|
repeat | String | |
x | String | |
y | String | |
none | String |