Package com.csse3200.game.rendering
Class TextureRenderWithRotationComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.rendering.TextureRenderComponent
com.csse3200.game.rendering.TextureRenderWithRotationComponent
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
An extension of the TextureRenderComponent, which allows rotation of your textures.
Just need to specify the angle of rotation in terms of degrees.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
draw
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draw the renderable.float
void
setRotation
(float value) Set the rotation value this rendering component will use to rotate the texture.void
setRotationWithRepeat
(float value) Methods inherited from class com.csse3200.game.rendering.TextureRenderComponent
getAlpha, getTexture, scaleEntity, setAlpha
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, create, disableComponent, dispose, enableComponent, getLayer, getZIndex, isDisabled, render
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
TextureRenderWithRotationComponent
-
-
Method Details
-
setRotation
public void setRotation(float value) Set the rotation value this rendering component will use to rotate the texture.- Parameters:
value
- The rotation value, in degrees.
-
setRotationWithRepeat
public void setRotationWithRepeat(float value) -
getRotation
public float getRotation() -
draw
protected void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Description copied from class:RenderComponent
Draw the renderable. Should be called only by the renderer, not manually.- Overrides:
draw
in classTextureRenderComponent
- Parameters:
batch
- Batch to render to.
-