Package com.deco2800.game.rendering
Class TextureRenderComponent
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.rendering.RenderComponent
com.deco2800.game.rendering.TextureRenderComponent
- All Implemented Interfaces:
 Disposable,Renderable,java.lang.Comparable<Renderable>
public class TextureRenderComponent extends RenderComponent
Render a static texture.
- 
Field Summary
 - 
Constructor Summary
Constructors Constructor Description TextureRenderComponent(Texture texture)TextureRenderComponent(java.lang.String texturePath) - 
Method Summary
Modifier and Type Method Description voiddraw(SpriteBatch batch)Draw the renderable.voidscaleEntity()Scale the entity to a width of 1 and a height matching the texture's ratioMethods inherited from class com.deco2800.game.rendering.RenderComponent
compareTo, create, dispose, getLayer, getZIndex, renderMethods inherited from class com.deco2800.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update 
- 
Constructor Details
- 
TextureRenderComponent
public TextureRenderComponent(java.lang.String texturePath)- Parameters:
 texturePath- internal path of static teture to render. Will be scaled to the entity's scale.
 - 
TextureRenderComponent
- Parameters:
 texture- Static texture to render. Will be scaled to the entity's scale.
 
 - 
 - 
Method Details
- 
scaleEntity
public void scaleEntity()Scale the entity to a width of 1 and a height matching the texture's ratio - 
draw
Description copied from class:RenderComponentDraw the renderable. Should be called only by the renderer, not manually.- Specified by:
 drawin classRenderComponent- Parameters:
 batch- Batch to render to.
 
 -