Class SpriteRenderer
java.lang.Object
dev.prozilla.pine.core.component.Component
dev.prozilla.pine.core.component.sprite.SpriteRenderer
- All Implemented Interfaces:
Lifecycle
,Printable
,ComponentFinder
,EntityFinder
A component for rendering 2D sprites in the world.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Color
boolean
Determines whether the texture will be cropped to a given region.boolean
boolean
float
float
-
Constructor Summary
ConstructorsConstructorDescriptionSpriteRenderer
(Texture texture) SpriteRenderer
(Texture texture, Color color) -
Method Summary
Methods inherited from class dev.prozilla.pine.core.component.Component
equals, getCamera, getChildWithTag, getComponent, getComponentInParent, getComponentInParent, getComponents, getComponentsInChildren, getEntity, getInput, getLogger, getParentWithTag, getRenderer, getTimer, getTracker, getTransform, getWindow, getWorld, hashCode, setActive, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
texture
-
color
-
scale
public float scale -
rotation
public float rotation -
offset
-
mirrorHorizontally
public boolean mirrorHorizontally -
mirrorVertically
public boolean mirrorVertically -
cropToRegion
public boolean cropToRegionDetermines whether the texture will be cropped to a given region. -
regionOffset
-
regionSize
-
-
Constructor Details
-
SpriteRenderer
-
SpriteRenderer
-
-
Method Details
-
getName
-
setRegion
-
setRegion
public void setRegion(float regX, float regY, float regWidth, float regHeight) Crops this sprite to a given region. -
unsetRegion
public void unsetRegion()Disables cropping for this sprite. -
getWidth
public float getWidth() -
getHeight
public float getHeight()
-