Class SpriteRenderer
java.lang.Object
dev.prozilla.pine.core.component.Component
dev.prozilla.pine.core.component.sprite.SpriteRenderer
- All Implemented Interfaces:
Lifecycle
,Printable
,ApplicationContext
,ApplicationProvider
,ComponentsContext
,ComponentsProvider
,EntityContext
,EntityProvider
,SceneContext
,SceneProvider
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
(TextureBase texture) SpriteRenderer
(TextureBase texture, Color color) -
Method Summary
Methods inherited from class dev.prozilla.pine.core.component.Component
equals, getApplication, getEntity, getScene, hashCode, setActive, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface dev.prozilla.pine.core.ApplicationProvider
getConfig, getInput, getLogger, getModManager, getRenderer, getTimer, getTracker, getWindow
Methods inherited from interface dev.prozilla.pine.core.component.ComponentsProvider
getComponent, getComponentInParent, getComponentInParent, getComponents, getComponentsInChildren
Methods inherited from interface dev.prozilla.pine.core.entity.EntityContext
isDescendantOf
Methods inherited from interface dev.prozilla.pine.core.entity.EntityProvider
getChildWithTag, getFirstChild, getLastChild, getParentWithTag, getTransform, isDescendantOf
Methods inherited from interface dev.prozilla.pine.common.Lifecycle
destroy, init, init, input, input, render, render, start, update, update
Methods inherited from interface dev.prozilla.pine.core.scene.SceneProvider
getCameraData, getWorld
-
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() -
getX
public float getX() -
getY
public float getY()
-