Package tripleplay.ui
Class Background
java.lang.Object
tripleplay.ui.Background
- Direct Known Subclasses:
BlankBackground
,CompositeBackground
,RoundRectBackground
,Scale9Background
A background is responsible for rendering a border and a fill. It is used in conjunction with
groups and buttons and any other elements that need a background.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
An instantiation of a particular background template. -
Field Summary
Modifier and TypeFieldDescriptionThe alpha transparency of this background (or null if no alpha has been configured).static final float
The (highest) depth at which background layers are rendered.The insets of this background, added to get the overall Element size. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionalpha
(float alpha) Configures the alpha transparency of this background.static Background
beveled
(int bgColor, int ulColor, int brColor) Creates a beveled background with the specified colors.static Background
blank()
Creates a null background (transparent).static Background
bordered
(int bgColor, int color, float thickness) Creates a bordered background with the specified colors and thickness.static Background
Creates a centered background with the specified texture tile.static Background
composite
(Background... constituents) Creates a composite background with the specified backgrounds.static Background
Creates a cropped centered background with the specified texture tile.static Background
image
(TileSource source) Creates a background with the specified source.inset
(float uniformInset) Configures uniform insets on this background.inset
(float horiz, float vert) Configures horizontal and vertical insets on this background.inset
(float top, float right, float bottom, float left) Configures non-uniform insets on this background.insetBottom
(float bottom) Sets the bottom inset for this background.insetLeft
(float left) Sets the left inset for this background.insetRight
(float right) Sets the right inset for this background.Configures insets on this background.insetTop
(float top) Sets the top inset for this background.static Background.Instance
instantiate
(Background delegate, pythagoras.f.IDimension size) Instantiates a background at the supplied size.static Background
Creates a round rect background with the specified color and corner radius.static Background
Creates a round rect background with the specified parameters.static Scale9Background
Creates a scale9 background with the specified texture tile.static Background
solid
(int color) Creates a solid background of the specified color.static Background
Creates a tiled background with the specified texture.
-
Field Details
-
BACKGROUND_DEPTH
public static final float BACKGROUND_DEPTHThe (highest) depth at which background layers are rendered. May range from (-11, 10].- See Also:
-
insets
The insets of this background, added to get the overall Element size. -
alpha
The alpha transparency of this background (or null if no alpha has been configured).
-
-
Constructor Details
-
Background
public Background()
-
-
Method Details
-
blank
Creates a null background (transparent). -
solid
Creates a solid background of the specified color. -
beveled
Creates a beveled background with the specified colors. -
bordered
Creates a bordered background with the specified colors and thickness. -
roundRect
Creates a round rect background with the specified color and corner radius. -
roundRect
public static Background roundRect(Graphics gfx, int bgColor, float cornerRadius, int borderColor, float borderWidth) Creates a round rect background with the specified parameters. -
image
Creates a background with the specified source. -
centered
Creates a centered background with the specified texture tile. -
cropped
Creates a cropped centered background with the specified texture tile. -
tiled
Creates a tiled background with the specified texture. -
scale9
Creates a scale9 background with the specified texture tile. SeeScale9Background
. -
composite
Creates a composite background with the specified backgrounds. SeeCompositeBackground
. -
instantiate
Instantiates a background at the supplied size. -
insets
Configures insets on this background. -
inset
Configures uniform insets on this background. -
inset
Configures horizontal and vertical insets on this background. -
inset
Configures non-uniform insets on this background. -
insetLeft
Sets the left inset for this background. -
insetRight
Sets the right inset for this background. -
insetTop
Sets the top inset for this background. -
insetBottom
Sets the bottom inset for this background. -
alpha
Configures the alpha transparency of this background.
-