Modifier and Type | Method and Description |
---|---|
Pattern |
build()
Builds and returns a pattern instance.
|
static Pattern |
build(NativeObject nativeObject)
Creates a pattern, previously stored in the a native java script object
|
static PatternBuilder |
create(CanvasPatternItem canvasPattern)
Creates the object using an already created canvas pattern.
The dimension of canvas pattern image will be the default TilesFactoryDefaults.DEFAULT_SIZE . |
static PatternBuilder |
create(CanvasPatternItem canvasPattern,
int squareSize)
Creates the object using an already created canvas pattern.
The dimension of canvas pattern image is unique then the image of pattern is a square. |
static PatternBuilder |
create(CanvasPatternItem canvasPattern,
int width,
int height)
Creates the object using an already created canvas pattern.
This is mainly used by tiles. |
static PatternBuilder |
create(Img image)
Creates the object using an image to use in the pattern.
The repetition used is repeat. |
static PatternBuilder |
create(Img image,
Repetition repetition)
Creates the object using an image to use in the pattern and repetition to apply to pattern.
|
static Pattern |
retrieve(CanvasPatternItem canvasPattern)
Retrieves a cached pattern by a
CanvasPatternItem instance.If the pattern doesn't exist, returns null . |
public static PatternBuilder create(Img image)
image
- image to use as patternpublic static PatternBuilder create(Img image, Repetition repetition)
image
- image to use as patternrepetition
- repetition value to apply to patternpublic static PatternBuilder create(CanvasPatternItem canvasPattern)
TilesFactoryDefaults.DEFAULT_SIZE
. This is mainly used by tiles.canvasPattern
- canvas pattern instancepublic static PatternBuilder create(CanvasPatternItem canvasPattern, int squareSize)
canvasPattern
- canvas pattern instancesquareSize
- size of image applied to canvasPattern to be a squarepublic static PatternBuilder create(CanvasPatternItem canvasPattern, int width, int height)
canvasPattern
- canvas pattern instancewidth
- width of image applied to canvasPatternheight
- height of image applied to canvasPatternpublic Pattern build()
public static Pattern build(NativeObject nativeObject)
nativeObject
- native java script object wrapped by pattern.public static Pattern retrieve(CanvasPatternItem canvasPattern)
CanvasPatternItem
instance.null
.canvasPattern
- the canvas pattern to use for searchingCanvasPatternItem
instance.null