public class Rectangle extends Entity<T>
world
enclosed by the Rectangle's upper-left point (x,y), its width, and its height.
The coordinates, width and height are in world units.
Modifier and Type | Method and Description |
---|---|
double |
getFillAlpha()
Returns the alpha of the fill of this
Shape as a percentage. |
java.lang.Integer |
getFillColor()
Returns the color of the fill of this
Shape as an RGB integer. |
int |
getHeight()
Returns the height of this
Rectangle in world units. |
double |
getLineAlpha()
Returns the alpha of the border of this
Shape as a percentage. |
int |
getLineColor()
Returns the color of the border of this
Shape as an RGB integer. |
int |
getLineWidth()
Returns the width of the border of this
Shape in world units. |
int |
getWidth()
Returns the width of this
Rectangle in world units. |
T |
setFillAlpha(double alpha)
Sets the alpha of the fill of this
Shape as a percentage. |
T |
setFillAlpha(double alpha,
Curve curve)
Sets the alpha of the fill of this
Shape as a percentage. |
T |
setFillColor(int color)
Sets the color of the fill of this
Shape as an RGB integer or null if the fill should not be drawn. |
T |
setFillColor(int color,
Curve curve)
Sets the color of the fill of this
Shape as an RGB integer or null if the fill should not be drawn. |
Rectangle |
setHeight(int height)
Sets the height of this
Rectangle in world units. |
Rectangle |
setHeight(int height,
Curve curve)
Sets the height of this
Rectangle in world units. |
T |
setLineAlpha(double alpha)
Sets the alpha of the border of this
Shape as a percentage. |
T |
setLineAlpha(double alpha,
Curve curve)
Sets the alpha of the border of this
Shape as a percentage. |
T |
setLineColor(int lineColor)
Sets the color of the border of this
Shape as an RGB integer. |
T |
setLineColor(int lineColor,
Curve curve)
Sets the color of the border of this
Shape as an RGB integer. |
T |
setLineWidth(int lineWidth)
Sets the width of the border of this
Shape in world units. |
T |
setLineWidth(int lineWidth,
Curve curve)
Sets the width of the border of this
Shape in world units. |
Rectangle |
setWidth(int width)
Sets the width of this
Rectangle in world units. |
Rectangle |
setWidth(int width,
Curve curve)
Sets the width of this
Rectangle in world units. |
getAlpha, getId, getRotation, getScaleX, getScaleY, getX, getY, getZIndex, isVisible, setAlpha, setAlpha, setRotation, setRotation, setScale, setScale, setScaleX, setScaleX, setScaleY, setScaleY, setVisible, setX, setX, setY, setY, setZIndex
public Rectangle setWidth(int width)
Rectangle
in world units.width
- the width for this Rectangle
.Rectangle
public Rectangle setWidth(int width, Curve curve)
Rectangle
in world units.width
- the width for this Rectangle
.curve
- the transition to animate between values of this property.Rectangle
public int getWidth()
Rectangle
in world units.
Default is 100.
Rectangle
.public Rectangle setHeight(int height)
Rectangle
in world units.height
- the height for this Rectangle
.Rectangle
public Rectangle setHeight(int height, Curve curve)
Rectangle
in world units.height
- the height for this Rectangle
.curve
- the transition to animate between values of this property.Rectangle
public int getHeight()
Rectangle
in world units.
Default is 100.
Rectangle
.public T setFillColor(int color)
Shape
as an RGB integer or null if the fill should not be drawn.color
- the color of the fill of this Shape
.Shape
.java.lang.IllegalArgumentException
- if color isn't a valid RGB integerpublic T setFillColor(int color, Curve curve)
Shape
as an RGB integer or null if the fill should not be drawn.color
- the color of the fill of this Shape
.curve
- the transition to animate between values of this property.Shape
.java.lang.IllegalArgumentException
- if color isn't a valid RGB integerpublic java.lang.Integer getFillColor()
Shape
as an RGB integer.
Can be null if no fill should be drawn.
Shape
.public T setFillAlpha(double alpha)
Shape
as a percentage.alpha
- the alpha of the fill of this Shape
.Shape
.java.lang.IllegalArgumentException
- if alpha < 0 or alpha > 1public T setFillAlpha(double alpha, Curve curve)
Shape
as a percentage.alpha
- the alpha of the fill of this Shape
.curve
- the transition to animate between values of this property.Shape
.java.lang.IllegalArgumentException
- if alpha < 0 or alpha > 1public double getFillAlpha()
Shape
as a percentage.
Default is 1.
Shape
.public T setLineAlpha(double alpha)
Shape
as a percentage.alpha
- the alpha for the border of this Shape
.Shape
.java.lang.IllegalArgumentException
- if alpha < 0 or alpha > 1public T setLineAlpha(double alpha, Curve curve)
Shape
as a percentage.alpha
- the alpha for the border of this Shape
.curve
- the transition to animate between values of this property.Shape
.java.lang.IllegalArgumentException
- if alpha < 0 or alpha > 1public double getLineAlpha()
Shape
as a percentage.
Default is 1.
Shape
.public T setLineWidth(int lineWidth)
Shape
in world units.lineWidth
- the width for the border of this Shape
.Shape
.public T setLineWidth(int lineWidth, Curve curve)
Shape
in world units.lineWidth
- the width for the border of this Shape
.curve
- the transition to animate between values of this property.Shape
.public int getLineWidth()
Shape
in world units.
Default is 1.
Shape
.public T setLineColor(int lineColor)
Shape
as an RGB integer.lineColor
- the color for the border of this Shape
.Shape
.java.lang.IllegalArgumentException
- if lineColor isn't a valid RGB integerpublic T setLineColor(int lineColor, Curve curve)
Shape
as an RGB integer.lineColor
- the color for the border of this Shape
.curve
- the transition to animate between values of this property.Shape
.java.lang.IllegalArgumentException
- if lineColor isn't a valid RGB integerpublic int getLineColor()
Shape
as an RGB integer.
Default is 0xFFFFFF (white).
Shape
.