public class ColorSpaceLayer extends java.lang.Object implements SpaceLayer
A ColorSpaceLayer is a type of SpaceLayer that fills the rendering region with a single Color. It is useful for creating solid-color backgrounds and, when displaying a semi-transparent Color, for creating fog effects.
Color
Constructor and Description |
---|
ColorSpaceLayer(Color color)
Constructs a ColorSpaceLayer that displays the specified Color.
|
Modifier and Type | Method and Description |
---|---|
Color |
getColor()
Returns the Color that this ColorSpaceLayer displays.
|
void |
renderActions(Graphics g,
long cx,
long cy,
int x,
int y,
int x1,
int y1,
int x2,
int y2)
Actions for this SpaceLayer to take to render its visuals through a
Viewport's camera.
|
void |
setColor(Color color)
Sets the Color that this ColorSpaceLayer displays to the specified Color.
|
public ColorSpaceLayer(Color color)
color
- This ColorSpaceLayer's displayed Colorpublic final Color getColor()
public final void setColor(Color color)
color
- This ColorSpaceLayer's new displayed Colorpublic void renderActions(Graphics g, long cx, long cy, int x, int y, int x1, int y1, int x2, int y2)
SpaceLayer
renderActions
in interface SpaceLayer
g
- The Graphics context to which this SpaceLayer is rendering its
visuals this framecx
- The camera's center x-coordinatecy
- The camera's center y-coordinatex
- The x-coordinate in pixels on the Graphics context that
corresponds to the camera's center x-coordinatey
- The y-coordinate in pixels on the Graphics context that
corresponds to the camera's center y-coordinatex1
- The x-coordinate in pixels of the Viewport's left edge on the
Graphics contexty1
- The y-coordinate in pixels of the Viewport's top edge on the
Graphics contextx2
- The x-coordinate in pixels of the Viewport's right edge on the
Graphics contexty2
- The y-coordinate in pixels of the Viewport's bottom edge on the
Graphics context