|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.font.effects.ShadowEffect
public class ShadowEffect
An effect to generate soft shadows beneath text
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.newdawn.slick.font.effects.ConfigurableEffect |
---|
ConfigurableEffect.Value |
Field Summary | |
---|---|
static float[][] |
GAUSSIAN_BLUR_KERNELS
The blur kernels applied across the effect |
static int |
NUM_KERNELS
The number of kernels to apply |
Constructor Summary | |
---|---|
ShadowEffect()
Default constructor for injection |
|
ShadowEffect(java.awt.Color color,
int xDistance,
int yDistance,
float opacity)
Create a new effect to apply a drop shadow to text |
Method Summary | |
---|---|
void |
draw(java.awt.image.BufferedImage image,
java.awt.Graphics2D g,
UnicodeFont unicodeFont,
Glyph glyph)
Called to draw the effect. |
int |
getBlurKernelSize()
Get the size of the kernel used to apply the blur |
int |
getBlurPasses()
Get the number of passes to apply the kernel for blurring |
java.awt.Color |
getColor()
Get the colour of the shadow generated |
float |
getOpacity()
Get the opacity of the shadow, i.e. |
java.util.List |
getValues()
Returns the list of ConfigurableEffect.Value s for this effect. |
float |
getXDistance()
Get the distance on the X axis from the text the shadow should be generated at |
float |
getYDistance()
Get the distance on the Y axis from the text the shadow should be generated at |
void |
setBlurKernelSize(int blurKernelSize)
Sets how many neighboring pixels are used to blur the shadow. |
void |
setBlurPasses(int blurPasses)
Sets the number of times to apply a blur to the shadow. |
void |
setColor(java.awt.Color color)
Set the colour of the shadow to be generated |
void |
setOpacity(float opacity)
Set the opacity of the shadow, i.e. |
void |
setValues(java.util.List values)
Sets the list of ConfigurableEffect.Value s for this effect. |
void |
setXDistance(float distance)
Sets the pixels to offset the shadow on the x axis. |
void |
setYDistance(float distance)
Sets the pixels to offset the shadow on the y axis. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NUM_KERNELS
public static final float[][] GAUSSIAN_BLUR_KERNELS
Constructor Detail |
---|
public ShadowEffect()
public ShadowEffect(java.awt.Color color, int xDistance, int yDistance, float opacity)
color
- The colour of the shadow to generatexDistance
- The distance from the text on the x axis the shadow should be renderedyDistance
- The distance from the text on the y axis the shadow should be renderedopacity
- The transparency factor of the shadowMethod Detail |
---|
public void draw(java.awt.image.BufferedImage image, java.awt.Graphics2D g, UnicodeFont unicodeFont, Glyph glyph)
Effect
draw
in interface Effect
image
- The image to draw intog
- The graphics context to use for applying the effectunicodeFont
- The font being renderedglyph
- The particular glyph being renderedEffect.draw(java.awt.image.BufferedImage, java.awt.Graphics2D, org.newdawn.slick.UnicodeFont, org.newdawn.slick.font.Glyph)
public java.awt.Color getColor()
public void setColor(java.awt.Color color)
color
- The colour ofthe shadow to be generatedpublic float getXDistance()
public void setXDistance(float distance)
distance
- The offset on the x axispublic float getYDistance()
public void setYDistance(float distance)
distance
- The offset on the y axispublic int getBlurKernelSize()
public void setBlurKernelSize(int blurKernelSize)
blurKernelSize
- The size of the kernel to apply the blur withpublic int getBlurPasses()
public void setBlurPasses(int blurPasses)
blurPasses
- The number of passes to apply when blurringpublic float getOpacity()
public void setOpacity(float opacity)
opacity
- The opacity of the shadowpublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.util.List getValues()
ConfigurableEffect
ConfigurableEffect.Value
s for this effect. This list is not typically backed by the effect, so changes to the
values will not take affect until ConfigurableEffect.setValues(List)
is called.
getValues
in interface ConfigurableEffect
ConfigurableEffect.getValues()
public void setValues(java.util.List values)
ConfigurableEffect
ConfigurableEffect.Value
s for this effect.
setValues
in interface ConfigurableEffect
ConfigurableEffect.setValues(java.util.List)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |