public class ImageFlip extends AbstractTransform
An image flip instance holds a global state for all drawings. Several instances can be created at the same time.
However a default instance is created on MicroUI framework startup and is always available.
Modifier and Type | Class and Description |
---|---|
static class |
ImageFlip.Action
Specify the flip to apply when drawing an image.
|
Modifier and Type | Field and Description |
---|---|
static ImageFlip |
Singleton
Default instance created on MicroUI framework startup.
|
Constructor and Description |
---|
ImageFlip() |
Modifier and Type | Method and Description |
---|---|
void |
draw(GraphicsContext gc,
Image image,
int x,
int y,
int anchor)
Draw the
Image in the GraphicsContext at given anchor position and using the current
ImageFlip.Action . |
ImageFlip.Action |
getAction()
Returns the current
ImageFlip.Action . |
void |
setAction(ImageFlip.Action action)
Set the new
ImageFlip.Action . |
getAlpha, getTranslateX, getTranslateY, isMirrored, resetAlpha, resetTranslate, setAlpha, setMirror, translate
public static final ImageFlip Singleton
public ImageFlip.Action getAction()
ImageFlip.Action
.ImageFlip.Action
.public void setAction(ImageFlip.Action action)
ImageFlip.Action
.action
- the action to set.public void draw(GraphicsContext gc, Image image, int x, int y, int anchor)
Image
in the GraphicsContext
at given anchor position and using the current
ImageFlip.Action
.gc
- the GraphicsContext
where to render the drawing.image
- the Image
to drawx
- the x coordinate of the image reference anchor pointy
- the y coordinate of the image reference anchor pointanchor
- position of the image reference point around the anchor pointjava.lang.NullPointerException
- if @{code image} or @{code gc} is @{code null}java.lang.IllegalArgumentException
- if anchor
is not a valid value (BASELINE
is illegal).