Class CreatureShadowImageEffect
java.lang.Object
de.gurkenlabs.litiengine.graphics.ImageEffect
de.gurkenlabs.litiengine.graphics.CreatureShadowImageEffect
- All Implemented Interfaces:
ITimeToLive
,java.lang.Comparable<ImageEffect>
public class CreatureShadowImageEffect
extends ImageEffect
Constructor Summary
Constructors Constructor Description CreatureShadowImageEffect(Creature creature)
Initializes a new instance of theCreatureShadowImageEffect
.CreatureShadowImageEffect(Creature creature, java.awt.Color shadowColor)
Initializes a new instance of theCreatureShadowImageEffect
.Method Summary
Modifier and Type Method Description java.awt.image.BufferedImage
apply(java.awt.image.BufferedImage image)
protected void
drawShadow(java.awt.Graphics2D graphics, float spriteWidth, float spriteHeight, float offsetX, float offsetY)
Creature
getCreature()
float
getOffsetX()
float
getOffsetY()
protected java.awt.geom.Ellipse2D
getShadowEllipse(float spriteWidth, float spriteHeight, float offsetX, float offsetY)
CreatureShadowImageEffect
setOffsetX(float offsetX)
CreatureShadowImageEffect
setOffsetY(float offsetY)
Methods inherited from class de.gurkenlabs.litiengine.graphics.ImageEffect
compareTo, getAliveTime, getName, getPriority, getTimeToLive, setName, setPriority, timeToLiveReached
Constructor Details
CreatureShadowImageEffect
Initializes a new instance of theCreatureShadowImageEffect
.- Parameters:
creature
- The creature to which this affect will be applied to.
CreatureShadowImageEffect
Initializes a new instance of theCreatureShadowImageEffect
.- Parameters:
creature
- The creature to which this affect will be applied to.shadowColor
- The color of the shadow.
Method Details
getCreature
getOffsetX
public float getOffsetX()setOffsetX
getOffsetY
public float getOffsetY()setOffsetY
apply
public java.awt.image.BufferedImage apply(java.awt.image.BufferedImage image)- Specified by:
apply
in classImageEffect
getShadowEllipse
protected java.awt.geom.Ellipse2D getShadowEllipse(float spriteWidth, float spriteHeight, float offsetX, float offsetY)drawShadow
protected void drawShadow(java.awt.Graphics2D graphics, float spriteWidth, float spriteHeight, float offsetX, float offsetY)