public final class Pattern extends CanvasObject
Modifier and Type | Class and Description |
---|---|
static class |
Pattern.PatternFactory
Inner class to create pattern by a native object.
|
Constructor and Description |
---|
Pattern(CanvasPattern canvasPattern)
Creates the object using an already created canvas pattern.
The dimension of canvas pattern image will be the default TilesFactoryDefaults.DEFAULT_SIZE . |
Pattern(CanvasPattern 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. |
Pattern(CanvasPattern canvasPattern,
int width,
int height)
Creates the object using an already created canvas pattern.
This is mainly used by tiles. |
Pattern(Image image)
Creates the object using an image to use in the pattern.
The repetition used is repeat. |
Pattern(Image image,
Context2d.Repetition repetition)
Creates the object using an image to use in the pattern and repetition to apply to pattern.
|
Pattern(ImageElement image)
Creates the object using an image to use in the pattern.
The repetition used is repeat. |
Pattern(ImageElement image,
Context2d.Repetition repetition)
Creates the object using an image to use in the pattern and repetition to apply to pattern.
|
Pattern(ImageResource image)
Creates the object using an image to use in the pattern.
The repetition used is repeat. |
Pattern(ImageResource image,
Context2d.Repetition repetition)
Creates the object using an image to use in the pattern and repetition to apply to pattern.
|
Modifier and Type | Method and Description |
---|---|
CanvasPattern |
getCanvasPattern()
Returns the canvas pattern if exists.
|
int |
getHeight()
Returns the image height used into pattern.
|
ImageElement |
getImage()
Returns the image used into pattern if exists.
|
Context2d.Repetition |
getRepetition()
Returns the repetition to use into pattern.
|
int |
getWidth()
Returns the image width used into pattern.
|
getId
checkValue, empty, getArrayValue, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, keys, remove, remove, removeIfExists, setArrayValue, setArrayValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
public Pattern(ImageResource image)
image
- image to use as patternpublic Pattern(Image image)
image
- image to use as patternpublic Pattern(ImageElement image)
image
- image to use as patternpublic Pattern(ImageResource image, Context2d.Repetition repetition)
image
- image to use as patternrepetition
- repetition value to apply to patternpublic Pattern(Image image, Context2d.Repetition repetition)
image
- image to use as patternrepetition
- repetition value to apply to patternpublic Pattern(ImageElement image, Context2d.Repetition repetition)
image
- image to use as patternrepetition
- repetition value to apply to patternpublic Pattern(CanvasPattern canvasPattern)
TilesFactoryDefaults.DEFAULT_SIZE
. This is mainly used
by tiles.canvasPattern
- canvas pattern instancepublic Pattern(CanvasPattern canvasPattern, int squareSize)
canvasPattern
- canvas pattern instancesquareSize
- size of image applied to canvasPattern to be a squarepublic Pattern(CanvasPattern canvasPattern, int width, int height)
canvasPattern
- canvas pattern instancewidth
- width of image applied to canvasPatternheight
- height of image applied to canvasPatternpublic ImageElement getImage()
null
.public int getWidth()
public int getHeight()
public Context2d.Repetition getRepetition()
public CanvasPattern getCanvasPattern()
null
.