Class SpriteRenderer
java.lang.Object
dev.prozilla.pine.core.component.Component
dev.prozilla.pine.core.component.sprite.SpriteRenderer
- All Implemented Interfaces:
Destructible,Printable,ApplicationContext,ApplicationProvider,ComponentsContext,ComponentsProvider,EntityContext,EntityProvider,SceneContext,SceneProvider
A component for rendering 2D sprites in the world.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal ColorbooleanDetermines whether the texture will be cropped to a given region.booleanbooleanfloat -
Constructor Summary
ConstructorsConstructorDescriptionSpriteRenderer(TextureBase texture) SpriteRenderer(TextureBase texture, Color color) -
Method Summary
Methods inherited from class dev.prozilla.pine.core.component.Component
destroy, equals, getApplication, getEntity, getScene, hashCode, setActive, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.prozilla.pine.core.ApplicationProvider
getAudioDevice, getConfig, getInput, getLogger, getModManager, getRenderer, getTimer, getTracker, getWindowMethods inherited from interface dev.prozilla.pine.core.component.ComponentsProvider
getComponent, getComponentInParent, getComponentInParent, getComponents, getComponentsInChildrenMethods inherited from interface dev.prozilla.pine.core.entity.EntityContext
isDescendantOfMethods inherited from interface dev.prozilla.pine.core.entity.EntityProvider
getChildWithTag, getFirstChild, getLastChild, getParentWithTag, getTransform, isDescendantOfMethods inherited from interface dev.prozilla.pine.core.scene.SceneProvider
getCameraData, getWorld
-
Field Details
-
texture
-
color
-
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()
-