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.
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.
|
ImageElement |
getImage()
Returns the image to use into pattern if exists.
|
Context2d.Repetition |
getRepetition()
Returns the repetition to use into pattern.
|
getId
checkValue, getArrayValue, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, 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)
canvasPattern
- canvas pattern instancepublic ImageElement getImage()
null
.public Context2d.Repetition getRepetition()
public CanvasPattern getCanvasPattern()
null
.