Class TransparencyImageEffect
java.lang.Object
de.gurkenlabs.litiengine.graphics.ImageEffect
de.gurkenlabs.litiengine.graphics.TransparencyImageEffect
- All Implemented Interfaces:
ITimeToLive, Comparable<ImageEffect>
Applies a constant alpha multiplier to every pixel of an image for the effect's lifetime.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTransparencyImageEffect(int ttl, float alpha) Initializes a new instance of theTransparencyImageEffect. -
Method Summary
Modifier and TypeMethodDescriptionapply(BufferedImage image) Applies this image effect to the specified BufferedImage.Methods inherited from class ImageEffect
compareTo, equals, getAliveTime, getName, getPriority, getTimeToLive, hashCode, setName, setPriority, timeToLiveReached
-
Constructor Details
-
TransparencyImageEffect
public TransparencyImageEffect(int ttl, float alpha) Initializes a new instance of theTransparencyImageEffect.- Parameters:
ttl- The time to live of this effect.alpha- the constant alpha to be multiplied with the alpha of the source. alpha must be a floating point number in the inclusive range [0.0, 1.0].
-
-
Method Details
-
apply
Description copied from class:ImageEffectApplies this image effect to the specified BufferedImage.- Specified by:
applyin classImageEffect- Parameters:
image- the BufferedImage to apply the effect to- Returns:
- the BufferedImage with the effect applied
-