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