APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.tools.hiero.unicodefont.effects

public Class GradientEffect

extends Object
implements ConfigurableEffect
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.tools.hiero.unicodefont.effects.ConfigurableEffect, com.badlogic.gdx.tools.hiero.unicodefont.effects.Effect
Imports
java.awt.Color, .GradientPaint, .Graphics2D, java.awt.image.BufferedImage, java.util.ArrayList, .Iterator, .List, com.badlogic.gdx.tools.hiero.unicodefont.Glyph, .UnicodeFont

Paints glyphs with a gradient fill.
Author
Nathan Sweet

Field Summary

Modifier and TypeField and Description
private Color
private boolean
private int
private float
private Color

Constructor Summary

AccessConstructor and Description
public
public
GradientEffect(Color topColor, Color bottomColor, float scale)

Method Summary

Modifier and TypeMethod and Description
public void
draw(BufferedImage image, Graphics2D g, UnicodeFont unicodeFont, Glyph glyph)

Implements com.badlogic.gdx.tools.hiero.unicodefont.effects.Effect.draw.

Called to draw the effect.

public Color
public int
public float
public Color
public List<E>
public boolean
public void
setBottomColor(Color bottomColor)

public void
setCyclic(boolean cyclic)

If set to true, the gradient will repeat.

public void
setOffset(int offset)

Sets the pixel offset to move the gradient up or down.

public void
setScale(float scale)

Changes the height of the gradient by a percentage.

public void
setTopColor(Color topColor)

public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bottomColorback to summary
private Color bottomColor
cyclicback to summary
private boolean cyclic
offsetback to summary
private int offset
scaleback to summary
private float scale
topColorback to summary
private Color topColor

Constructor Detail

GradientEffectback to summary
public GradientEffect()
GradientEffectback to summary
public GradientEffect(Color topColor, Color bottomColor, float scale)

Method Detail

drawback to summary
public void draw(BufferedImage image, Graphics2D g, UnicodeFont unicodeFont, Glyph glyph)

Implements com.badlogic.gdx.tools.hiero.unicodefont.effects.Effect.draw.

Doc from com.badlogic.gdx.tools.hiero.unicodefont.effects.Effect.draw.

Called to draw the effect.

getBottomColorback to summary
public Color getBottomColor()
getOffsetback to summary
public int getOffset()
getScaleback to summary
public float getScale()
getTopColorback to summary
public Color getTopColor()
getValuesback to summary
public List<E> getValues()

Implements com.badlogic.gdx.tools.hiero.unicodefont.effects.ConfigurableEffect.getValues.

Doc from com.badlogic.gdx.tools.hiero.unicodefont.effects.ConfigurableEffect.getValues.

Returns the list of Values for this effect. This list is not typically backed by the effect, so changes to the values will not take affect until setValues(List) is called.

isCyclicback to summary
public boolean isCyclic()
setBottomColorback to summary
public void setBottomColor(Color bottomColor)
setCyclicback to summary
public void setCyclic(boolean cyclic)

If set to true, the gradient will repeat.

setOffsetback to summary
public void setOffset(int offset)

Sets the pixel offset to move the gradient up or down. The gradient is normally centered on the glyph.

setScaleback to summary
public void setScale(float scale)

Changes the height of the gradient by a percentage. The gradient is normally the height of most glyphs in the font.

setTopColorback to summary
public void setTopColor(Color topColor)
setValuesback to summary
public void setValues(List<E> values)

Implements com.badlogic.gdx.tools.hiero.unicodefont.effects.ConfigurableEffect.setValues.

Doc from com.badlogic.gdx.tools.hiero.unicodefont.effects.ConfigurableEffect.setValues.

Sets the list of Values for this effect.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.