Class AnimatedDrawable
- java.lang.Object
-
- de.unistuttgart.informatik.fius.icge.ui.AnimatedDrawable
-
- All Implemented Interfaces:
Drawable,Comparable<Drawable>
public class AnimatedDrawable extends Object implements Drawable
A class containing all information needed to draw a moving object onto the playfield by aPlayfieldDrawer.- Author:
- Fabian Bühler
-
-
Constructor Summary
Constructors Constructor Description AnimatedDrawable(long tickStart, double xStart, double yStart, long duration, double xEnd, double yEnd, int z, String textureHandle)Create a new animated Drawable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetDuration()Get'sdurationStringgetTextureHandle()Get the handle of the texture for this drawable.longgetTickEnd()Get'stickEndlonggetTickStart()Get'stickStartdoublegetX()Get the x coordinate of the drawable.doublegetxEnd()Get'sxEnddoublegetxStart()Get'sxStartdoublegetY()Get the y coordinate of the drawable.doublegetyEnd()Get'syEnddoublegetyStart()Get'syStartintgetZ()Get the z value of the drawable.booleanisAnimated()Return wether the Drawable is animated.booleanisTilable()Return wether this Drawable can be drawn tiled if multiple are present in the same cell.voidsetCurrentTick(long renderTick)Set the current render tick for animated drawables.
-
-
-
Constructor Detail
-
AnimatedDrawable
public AnimatedDrawable(long tickStart, double xStart, double yStart, long duration, double xEnd, double yEnd, int z, String textureHandle)Create a new animated Drawable.- Parameters:
tickStart- start tickxStart- start x coordinateyStart- start y coordinateduration- duration in ticksxEnd- end x coordinateyEnd- end y coordinatez- valuetextureHandle- the handle of the texture used for this drawable
-
-
Method Detail
-
setCurrentTick
public void setCurrentTick(long renderTick)
Description copied from interface:DrawableSet the current render tick for animated drawables.- Specified by:
setCurrentTickin interfaceDrawable- Parameters:
renderTick- The current render tick
-
getX
public double getX()
Description copied from interface:DrawableGet the x coordinate of the drawable. The coordinate system is based on cells where fractionals denote positions between cells.
-
getY
public double getY()
Description copied from interface:DrawableGet the y coordinate of the drawable. The coordinate system is based on cells where fractionals denote positions between cells.
-
getZ
public int getZ()
Description copied from interface:DrawableGet the z value of the drawable. The z value is used to decide the drawing order of Drawables in the same cell.
-
getTextureHandle
public String getTextureHandle()
Description copied from interface:DrawableGet the handle of the texture for this drawable. The texture must be registered in the TextureRegistry.- Specified by:
getTextureHandlein interfaceDrawable- Returns:
- returns the texture handle as a String
-
isTilable
public boolean isTilable()
Description copied from interface:DrawableReturn wether this Drawable can be drawn tiled if multiple are present in the same cell.
-
isAnimated
public boolean isAnimated()
Description copied from interface:DrawableReturn wether the Drawable is animated.- Specified by:
isAnimatedin interfaceDrawable- Returns:
- true iff any property (x, y, z) is animated
-
getxStart
public double getxStart()
Get'sxStart- Returns:
- xStart
-
getyStart
public double getyStart()
Get'syStart- Returns:
- yStart
-
getxEnd
public double getxEnd()
Get'sxEnd- Returns:
- xEnd
-
getyEnd
public double getyEnd()
Get'syEnd- Returns:
- yEnd
-
getTickStart
public long getTickStart()
Get'stickStart- Returns:
- tickStart
-
getTickEnd
public long getTickEnd()
Get'stickEnd- Returns:
- tickEnd
-
getDuration
public long getDuration()
Get'sduration- Returns:
- duration
-
-