T
- The type of colors@Beta public interface ISquidPanel<T>
SquidPanel
s, to abstract from the UI
implementation (i.e. whether it's awt or libgdx doesn't matter here).The combination of two panels, one for the background,
one for the foreground; a frequent use case in roguelikes.
Modifier and Type | Method and Description |
---|---|
int |
cellHeight() |
int |
cellWidth() |
void |
clear(int x,
int y)
Removes the contents of this cell, leaving a transparent space.
|
ISquidPanel<?> |
getBacker() |
T |
getDefaultForegroundColor() |
int |
gridHeight() |
int |
gridWidth() |
boolean |
hasActiveAnimations() |
void |
put(char[][] foregrounds,
T[][] colors) |
void |
put(int x,
int y,
char c)
Puts the character
c at (x, y) . |
void |
put(int x,
int y,
char c,
T color)
Puts the character
c at (x, y) with some color . |
void |
put(int xOffset,
int yOffset,
IColoredString<? extends T> cs)
Puts the given string horizontally with the first character at the given
offset, using the colors that
cs provides. |
void |
put(int xOffset,
int yOffset,
String string,
T foreground)
Puts the given string horizontally with the first character at the given
offset.
|
void |
put(int x,
int y,
T color)
Puts
color at (x, y) (in the cell's entirety, i.e. |
ISquidPanel<T> |
setColorCenter(IColorCenter<T> icc)
Method to change the backing
IColorCenter . |
void |
setDefaultForeground(T color)
Sets the default foreground color.
|
void put(int x, int y, char c)
c
at (x, y)
.x
- y
- c
- void put(int x, int y, T color)
color
at (x, y)
(in the cell's entirety, i.e. in the
background).x
- y
- color
- void put(int xOffset, int yOffset, String string, T foreground)
xOffset
- the x coordinate of the first characteryOffset
- the y coordinate of the first characterstring
- the characters to be displayedforeground
- the color to draw the charactersvoid put(int xOffset, int yOffset, IColoredString<? extends T> cs)
cs
provides.
Does not word wrap. Characters that are not renderable (due to being at
negative offsets or offsets greater than the grid size) will not be shown
but will not cause any malfunctions.xOffset
- the x coordinate of the first characteryOffset
- the y coordinate of the first charactercs
- The string to display, with its colors.void put(int x, int y, char c, T color)
c
at (x, y)
with some color
.x
- y
- c
- color
- void put(char[][] foregrounds, T[][] colors)
foregrounds
- Can be null
, indicating that only colors must be put.colors
- void clear(int x, int y)
x
- y
- int gridWidth()
int gridHeight()
int cellWidth()
int cellHeight()
boolean hasActiveAnimations()
void setDefaultForeground(T color)
color
- T getDefaultForegroundColor()
setDefaultForeground(Object)
), or the last color set
with setDefaultForeground(Object)
. Cannot be
null
.ISquidPanel<T> setColorCenter(IColorCenter<T> icc)
IColorCenter
.icc
- this
ISquidPanel<?> getBacker()
SquidPanel
. The type of colors is unspecified, as some
clients have forwarding instances of this class that hides that
the type of color of the backer differs from the type of color in
this
.
Can be this
itself.
Copyright © 2012–2016. All rights reserved.