Class ImageEffect
java.lang.Object
de.gurkenlabs.litiengine.graphics.ImageEffect
- All Implemented Interfaces:
ITimeToLive
,java.lang.Comparable<ImageEffect>
- Direct Known Subclasses:
CreatureShadowImageEffect
,OverlayPixelsImageEffect
,RotationImageEffect
public abstract class ImageEffect
extends java.lang.Object
implements ITimeToLive, java.lang.Comparable<ImageEffect>
Constructor Summary
Constructors Modifier Constructor Description protected
ImageEffect(int ttl, java.lang.String name)
protected
ImageEffect(java.lang.String name)
Method Summary
Modifier and Type Method Description abstract java.awt.image.BufferedImage
apply(java.awt.image.BufferedImage image)
int
compareTo(ImageEffect other)
long
getAliveTime()
Gets the time this instance is alive.java.lang.String
getName()
int
getPriority()
int
getTimeToLive()
Gets the total time to live of this instance.void
setName(java.lang.String name)
void
setPriority(int priority)
boolean
timeToLiveReached()
Determines whether this instance has exceeded its time to live.
Constructor Details
ImageEffect
protected ImageEffect(java.lang.String name)ImageEffect
protected ImageEffect(int ttl, java.lang.String name)
Method Details
getAliveTime
public long getAliveTime()Description copied from interface:ITimeToLive
Gets the time this instance is alive.- Specified by:
getAliveTime
in interfaceITimeToLive
- Returns:
- Returns how long this instance is alive.
getName
public java.lang.String getName()getTimeToLive
public int getTimeToLive()Description copied from interface:ITimeToLive
Gets the total time to live of this instance.- Specified by:
getTimeToLive
in interfaceITimeToLive
- Returns:
- The total time to live.
timeToLiveReached
public boolean timeToLiveReached()Description copied from interface:ITimeToLive
Determines whether this instance has exceeded its time to live.- Specified by:
timeToLiveReached
in interfaceITimeToLive
- Returns:
- True if the time to live was reached; otherwise false.
getPriority
public int getPriority()setPriority
public void setPriority(int priority)setName
public void setName(java.lang.String name)compareTo
- Specified by:
compareTo
in interfacejava.lang.Comparable<ImageEffect>
apply
public abstract java.awt.image.BufferedImage apply(java.awt.image.BufferedImage image)