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 long
getDuration()
Get'sduration
String
getTextureHandle()
Get the handle of the texture for this drawable.long
getTickEnd()
Get'stickEnd
long
getTickStart()
Get'stickStart
double
getX()
Get the x coordinate of the drawable.double
getxEnd()
Get'sxEnd
double
getxStart()
Get'sxStart
double
getY()
Get the y coordinate of the drawable.double
getyEnd()
Get'syEnd
double
getyStart()
Get'syStart
int
getZ()
Get the z value of the drawable.boolean
isAnimated()
Return wether the Drawable is animated.boolean
isTilable()
Return wether this Drawable can be drawn tiled if multiple are present in the same cell.void
setCurrentTick(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:Drawable
Set the current render tick for animated drawables.- Specified by:
setCurrentTick
in interfaceDrawable
- Parameters:
renderTick
- The current render tick
-
getX
public double getX()
Description copied from interface:Drawable
Get 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:Drawable
Get 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:Drawable
Get 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:Drawable
Get the handle of the texture for this drawable. The texture must be registered in the TextureRegistry.- Specified by:
getTextureHandle
in interfaceDrawable
- Returns:
- returns the texture handle as a String
-
isTilable
public boolean isTilable()
Description copied from interface:Drawable
Return wether this Drawable can be drawn tiled if multiple are present in the same cell.
-
isAnimated
public boolean isAnimated()
Description copied from interface:Drawable
Return wether the Drawable is animated.- Specified by:
isAnimated
in 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
-
-