public class TiledImageBackground extends java.lang.Object implements Background
Constructor and Description |
---|
TiledImageBackground(ej.microui.display.Image image)
Creates a tiled image background aligned on the top-left corner and repeated horizontally and vertically.
|
TiledImageBackground(ej.microui.display.Image image,
int horizontalAlignment,
int verticalAlignment,
boolean horizontalRepeat,
boolean verticalRepeat)
Creates a tiled image background specifying its attributes.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(ej.microui.display.GraphicsContext g,
int width,
int height)
Applies the background on a graphics context.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isTransparent(int width,
int height)
Tells whether or not this background is transparent.
|
public TiledImageBackground(ej.microui.display.Image image)
image
- the background image.public TiledImageBackground(ej.microui.display.Image image, int horizontalAlignment, int verticalAlignment, boolean horizontalRepeat, boolean verticalRepeat)
image
- the background image.horizontalAlignment
- the horizontal alignment.verticalAlignment
- the vertical alignment.horizontalRepeat
- true
if the image is repeated horizontally, false
otherwise.verticalRepeat
- true
if the image is repeated vertically, false
otherwise.java.lang.IllegalArgumentException
- if the horizontal or vertical alignment is not valid.Alignment.validateHorizontalAlignment(int)
,
Alignment.validateVerticalAlignment(int)
public boolean isTransparent(int width, int height)
Background
A background is considered as transparent if it does not draw every pixel with maximal opacity when it is applied. If a widget has a transparent background, its parent has to be rendered before the widget.
isTransparent
in interface Background
width
- the width of the background.height
- the height of the background.true
if the background is transparent, false
otherwise.public void apply(ej.microui.display.GraphicsContext g, int width, int height)
Background
apply
in interface Background
g
- the graphics context.width
- the width of the background.height
- the height of the background.public boolean equals(@Nullable java.lang.Object obj)
equals
in interface Background
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface Background
hashCode
in class java.lang.Object