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 TypeFieldDescriptionbooleandoublebooleanint -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the position of an object's bounding box.intGetter for the fieldzIndex.voidRotates an object to point at aVector2voidExecuted in the draw loop, before the actual drawing begins.voidupdateBoundingBox(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- aAffineTransformobject
-
getBoundingBoxPosition
Returns the position of an object's bounding box.- Returns:
- a
Vector2object
-
lookAt
Rotates an object to point at a
Vector2- Parameters:
lookpos- aVector2object
-
onBeforeDraw
public void onBeforeDraw()Executed in the draw loop, before the actual drawing begins. Designed to be overridden.
-