|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.font.effects.GradientEffect
public class GradientEffect
Paints glyphs with a gradient fill.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.newdawn.slick.font.effects.ConfigurableEffect |
---|
ConfigurableEffect.Value |
Constructor Summary | |
---|---|
GradientEffect()
Default constructor for injection |
|
GradientEffect(java.awt.Color topColor,
java.awt.Color bottomColor,
float scale)
Create a new effect to apply a graident |
Method Summary | |
---|---|
void |
draw(java.awt.image.BufferedImage image,
java.awt.Graphics2D g,
UnicodeFont unicodeFont,
Glyph glyph)
Called to draw the effect. |
java.awt.Color |
getBottomColor()
Get the colour at the bottom of the graident |
int |
getOffset()
Get the offset the gradients starts at |
float |
getScale()
Get the percentage scaling being applied to the gradient across the surface |
java.awt.Color |
getTopColor()
Get the colour at the top of the graident |
java.util.List |
getValues()
Returns the list of ConfigurableEffect.Value s for this effect. |
boolean |
isCyclic()
Check if the graident is repeating |
void |
setBottomColor(java.awt.Color bottomColor)
Set the colour at the bottom of the graident |
void |
setCyclic(boolean cyclic)
If set to true, the gradient will repeat. |
void |
setOffset(int offset)
Sets the pixel offset to move the gradient up or down. |
void |
setScale(float scale)
Changes the height of the gradient by a percentage. |
void |
setTopColor(java.awt.Color topColor)
Set the colour at the top of the graident |
void |
setValues(java.util.List values)
Sets the list of ConfigurableEffect.Value s for this effect. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GradientEffect()
public GradientEffect(java.awt.Color topColor, java.awt.Color bottomColor, float scale)
topColor
- The colour at the top of the graidentbottomColor
- The colour at the bottom of the gradientscale
- The scale of the graidentMethod 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 getTopColor()
public void setTopColor(java.awt.Color topColor)
topColor
- The colour at the top of the graidentpublic java.awt.Color getBottomColor()
public void setBottomColor(java.awt.Color bottomColor)
bottomColor
- The colour at the bottom of the graidentpublic int getOffset()
public void setOffset(int offset)
offset
- The offset the gradient is moved bypublic float getScale()
public void setScale(float scale)
scale
- The scale to applypublic boolean isCyclic()
public void setCyclic(boolean cyclic)
cyclic
- True if the graident repeatspublic 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 |