|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.fills.GradientFill
public class GradientFill
A fill effect used to define gradients when filling and drawing shapes. A gradient is defined by two control points. Each point that is rendered is coloured based on it's proximity to the points. Note that the points are defined relative to the center of the shape being drawn. This is with the intention that the gradient fills can be used and do not need to be updated when the geometry is moved
Constructor Summary | |
---|---|
GradientFill(float sx,
float sy,
Color startCol,
float ex,
float ey,
Color endCol)
Create a gradient fill |
|
GradientFill(float sx,
float sy,
Color startCol,
float ex,
float ey,
Color endCol,
boolean local)
Create a gradient fill |
|
GradientFill(Vector2f start,
Color startCol,
Vector2f end,
Color endCol,
boolean local)
Create a gradient fill |
Method Summary | |
---|---|
Color |
colorAt(float x,
float y)
Get the colour that should be applied at the specified location |
Color |
colorAt(Shape shape,
float x,
float y)
Get the colour that should be applied at the specified location |
Vector2f |
getEnd()
Get the position of the end control point |
Color |
getEndColor()
Get the colour at the end control point |
GradientFill |
getInvertedCopy()
Get an inverted copy of the gradient |
Vector2f |
getOffsetAt(Shape shape,
float x,
float y)
Get the offset for a vertex at a given location based on it's shape |
Vector2f |
getStart()
Get the position of the start control point |
Color |
getStartColor()
Get the colour at the start control point |
void |
setEnd(float x,
float y)
Set the end control point's position |
void |
setEnd(Vector2f end)
Set the end control point's position |
void |
setEndColor(Color color)
Set the colour to apply at the end control's position |
void |
setLocal(boolean local)
Indicate if the gradient is defined in shape local coordinates |
void |
setStart(float x,
float y)
Set the start point's position |
void |
setStart(Vector2f start)
Set the start control point's position |
void |
setStartColor(Color color)
Set the colour to apply at the start control's position |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GradientFill(float sx, float sy, Color startCol, float ex, float ey, Color endCol)
sx
- The x coordinate of the starting control pointsy
- The y coordinate of the starting control pointstartCol
- The colour to apply at the starting control pointex
- The x coordinate of the ending control pointey
- The y coordinate of the ending control pointendCol
- The colour to apply at the ending control pointpublic GradientFill(float sx, float sy, Color startCol, float ex, float ey, Color endCol, boolean local)
sx
- The x coordinate of the starting control pointsy
- The y coordinate of the starting control pointstartCol
- The colour to apply at the starting control pointex
- The x coordinate of the ending control pointey
- The y coordinate of the ending control pointendCol
- The colour to apply at the ending control pointlocal
- True if the gradient is defined in local shape coordinatespublic GradientFill(Vector2f start, Color startCol, Vector2f end, Color endCol, boolean local)
start
- The position of the starting control pointstartCol
- The colour to apply at the starting control pointend
- The position of the ending control pointendCol
- The colour to apply at the ending control pointlocal
- True if the gradient is defined in local shape coordinatesMethod Detail |
---|
public GradientFill getInvertedCopy()
public void setLocal(boolean local)
local
- True if the gradient is defined in shape local coordinatespublic Vector2f getStart()
public Vector2f getEnd()
public Color getStartColor()
public Color getEndColor()
public void setStart(float x, float y)
x
- The x coordinate of the start control pointy
- The y coordinate of the start control pointpublic void setStart(Vector2f start)
start
- The new poisition for the start pointpublic void setEnd(float x, float y)
x
- The x coordinate of the end control pointy
- The y coordinate of the end control pointpublic void setEnd(Vector2f end)
end
- The new position for the end pointpublic void setStartColor(Color color)
color
- The colour to apply at the start control pointpublic void setEndColor(Color color)
color
- The colour to apply at the end control pointpublic Color colorAt(Shape shape, float x, float y)
colorAt
in interface ShapeFill
shape
- The shape being filledx
- The x coordinate of the point being colouredy
- The y coordinate of the point being coloured
public Color colorAt(float x, float y)
x
- The x coordinate of the point being colouredy
- The y coordinate of the point being coloured
public Vector2f getOffsetAt(Shape shape, float x, float y)
ShapeFill
getOffsetAt
in interface ShapeFill
shape
- The shape being filledx
- The x coordinate of the point being drawny
- The y coordinate of the point being drawn
ShapeFill.getOffsetAt(org.newdawn.slick.geom.Shape, float, float)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |