Class Rect
java.lang.Object
dev.prozilla.pine.core.rendering.shape.Shape
dev.prozilla.pine.core.rendering.shape.Rect
- All Implemented Interfaces:
Cloneable<Shape>,ColoredDrawable,Drawable,TexturedDrawable
- Direct Known Subclasses:
RoundedRect
Generates a rectangular shape.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a new object that is equal to this object.booleanbooleanChecks if the given object is equal to this object.booleanprotected float[]Generates the UV array for this shape.protected float[]Generates the vertex array for this shape.floatReturns the height of this rectangle.floatgetWidth()Returns the width of this rectangle.floatgetX()floatgetY()voidsetAnchor(GridAlignment anchor) Sets the anchor point of this rectangle.voidsetHeight(float height) Sets the height of this rectangle.voidsetPosition(Vector2f position) voidSets the size of this rectangle.voidsetWidth(float width) Sets the width of this rectangle.voidsetX(float x) voidsetY(float y) Methods inherited from class dev.prozilla.pine.core.rendering.shape.Shape
addModifier, cloneWithModifiers, draw, generate, getModifier, removeModifierMethods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.prozilla.pine.core.rendering.shape.ColoredDrawable
drawMethods inherited from interface dev.prozilla.pine.core.rendering.shape.TexturedDrawable
draw, draw
-
Field Details
-
position
-
size
-
anchor
-
-
Constructor Details
-
Rect
public Rect() -
Rect
-
Rect
-
-
Method Details
-
generateVertices
protected float[] generateVertices()Description copied from class:ShapeGenerates the vertex array for this shape.Odd elements define the x-component of the vertex and even elements define the y-component.
Every three vertices (or six elements) define a triangle.
- Specified by:
generateVerticesin classShape- Returns:
- The array of vertices.
-
generateUVs
protected float[] generateUVs()Description copied from class:ShapeGenerates the UV array for this shape.Odd elements define the x-component of the texture coordinate and even elements define the y-component.
- Specified by:
generateUVsin classShape- Returns:
- The array of texture coordinates.
-
getX
public float getX() -
getY
public float getY() -
setX
public void setX(float x) -
setY
public void setY(float y) -
setPosition
-
getWidth
public float getWidth()Returns the width of this rectangle.- Returns:
- The width of this rectangle.
-
getHeight
public float getHeight()Returns the height of this rectangle.- Returns:
- The height of this rectangle.
-
setWidth
public void setWidth(float width) Sets the width of this rectangle.- Parameters:
width- The new width
-
setHeight
public void setHeight(float height) Sets the height of this rectangle.- Parameters:
height- The new height
-
setSize
Sets the size of this rectangle.- Parameters:
size- The new size
-
setAnchor
Sets the anchor point of this rectangle.- Parameters:
anchor- The new anchor point
-
equals
-
equals
Description copied from interface:CloneableChecks if the given object is equal to this object.- Parameters:
shape- Other object- Returns:
trueif both objects are equal.
-
equals
-
clone
Description copied from interface:CloneableReturns a new object that is equal to this object.
-