public class Bar extends Object implements Renderable
Constructor and Description |
---|
Bar(int width,
int height)
Create a bar.
|
Modifier and Type | Method and Description |
---|---|
int |
getHeight()
Get the current height.
|
int |
getHeightMax()
Get the maximum height.
|
int |
getHeightPercent()
Get the current height percent.
|
int |
getWidth()
Get the current width.
|
int |
getWidthMax()
Get the maximum width.
|
int |
getWidthPercent()
Get the current width percent.
|
void |
render(Graphic g) |
void |
setBorderSize(int hBorder,
int vBorder)
Set the bar border size.
|
void |
setColor(ColorRgba background,
ColorRgba foreground)
Set the background color.
|
void |
setColorBackground(ColorRgba color)
Set the background color.
|
void |
setColorForeground(ColorRgba color)
Set the foreground color.
|
void |
setColorGradient(ColorRgba color1,
ColorRgba color2)
Set a gradient color from point 1 with color 1 to point2 with color 2.
|
void |
setColorGradient(int x1,
int y1,
ColorRgba color1,
int x2,
int y2,
ColorRgba color2)
Set a gradient color from point 1 with color 1 to point2 with color 2.
|
void |
setHeightPercent(int heightPercent)
Set the height percent.
|
void |
setHorizontalReferential(boolean leftRight)
Set the horizontal rendering referential.
|
void |
setLocation(int x,
int y)
Set the bar location.
|
void |
setMaximumSize(int width,
int height)
Set the maximum size.
|
void |
setVerticalReferential(boolean upDown)
Set the vertical rendering referential.
|
void |
setWidthPercent(int widthPercent)
Set the width percent.
|
public Bar(int width, int height)
width
- The maximum width.height
- The maximum height.public void render(Graphic g)
render
in interface Renderable
public void setHorizontalReferential(boolean leftRight)
leftRight
- true
if bar is from left to right, false
else.public void setVerticalReferential(boolean upDown)
upDown
- true
will start from top to down, false
else.public void setBorderSize(int hBorder, int vBorder)
hBorder
- The horizontal border size.vBorder
- The vertical border size.public void setColor(ColorRgba background, ColorRgba foreground)
background
- The background color.foreground
- The foreground color.public void setColorBackground(ColorRgba color)
color
- The background color.public void setColorForeground(ColorRgba color)
color
- The foreground color.public void setColorGradient(ColorRgba color1, ColorRgba color2)
color1
- The first color.color2
- The last color.public void setColorGradient(int x1, int y1, ColorRgba color1, int x2, int y2, ColorRgba color2)
x1
- The first horizontal location.y1
- The first vertical location.color1
- The first color.x2
- The last horizontal location.y2
- The last vertical location.color2
- The last color.public void setLocation(int x, int y)
x
- The horizontal location.y
- The vertical location.public void setMaximumSize(int width, int height)
width
- The maximum width.height
- The maximum height.public void setWidthPercent(int widthPercent)
widthPercent
- The width percent [0-100].public void setHeightPercent(int heightPercent)
heightPercent
- The height percent [0-100].public int getWidth()
public int getHeight()
public int getWidthPercent()
public int getHeightPercent()
public int getWidthMax()
public int getHeightMax()
Copyright © 2017 Byron 3D Games Studio. All rights reserved.