Package io.github.espressoengine.object
Class Object
java.lang.Object
io.github.espressoengine.object.Object
Base class for all drawable objects.
- Version:
- $Id: $Id
- Author:
- pastthepixels
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
double
boolean
int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the position of an object's bounding box.int
Getter for the fieldzIndex
.void
Rotates an object to point at aVector2
void
Executed in the draw loop, before the actual drawing begins.void
updateBoundingBox
(AffineTransform transform) Recreates a bounding box from anjava.awt.geom.AffineTransform
.
-
Field Details
-
position
-
_enginePosition
-
rotation
public double rotation -
dbg
public boolean dbg -
visible
public boolean visible -
zIndex
public int zIndex -
boundingBox
-
-
Constructor Details
-
Object
public Object()
-
-
Method Details
-
getZIndex
public int getZIndex()Getter for the fieldzIndex
. Note: Just forComparator.comparing
. We don't need this because zIndex is public.- Returns:
- a int
-
updateBoundingBox
Recreates a bounding box from anjava.awt.geom.AffineTransform
. This function called every time a scene is drawn and is yet another empty function designed to be overridden.- Parameters:
transform
- aAffineTransform
object
-
getBoundingBoxPosition
Returns the position of an object's bounding box.- Returns:
- a
Vector2
object
-
lookAt
Rotates an object to point at a
Vector2
- Parameters:
lookpos
- aVector2
object
-
onBeforeDraw
public void onBeforeDraw()Executed in the draw loop, before the actual drawing begins. Designed to be overridden.
-