public class SquidLayers extends com.badlogic.gdx.scenes.scene2d.Group
Modifier and Type | Field and Description |
---|---|
protected float |
animationDuration |
protected SquidPanel |
backgroundPanel |
protected int |
cellHeight |
protected int |
cellWidth |
static char |
EMPTY_CELL |
protected ArrayList<SquidPanel> |
extraPanels |
protected SquidPanel |
foregroundPanel |
protected int |
height |
protected int[][] |
lightnesses |
protected ArrayList<com.badlogic.gdx.graphics.Color> |
palette |
protected TextCellFactory |
textFactory |
protected boolean[][] |
values |
protected int |
width |
Constructor and Description |
---|
SquidLayers()
Create a new SquidLayers widget with the default square font, 40 cells wide and high, with a size of
12x12 pixels for each cell.
|
SquidLayers(int gridWidth,
int gridHeight)
Create a new SquidLayers widget with the default square font, the given number of cells for gridWidth
and gridHeight, and 12x12 pixels for each cell.
|
SquidLayers(int gridWidth,
int gridHeight,
int cellWidth,
int cellHeight)
Create a new SquidLayers widget with a default font (it will be square if cellWidth and cellHeight are equal, or
narrow otherwise), the given number of cells for gridWidth
and gridHeight, and the size in pixels for each cell given by cellWidth and cellHeight.
|
SquidLayers(int gridWidth,
int gridHeight,
int cellWidth,
int cellHeight,
com.badlogic.gdx.graphics.g2d.BitmapFont bitmapFont)
Create a new SquidLayers widget with the given path to a BitmapFont file, the given number of cells for gridWidth
and gridHeight, and the size in pixels for each cell given by cellWidth and cellHeight.
|
SquidLayers(int gridWidth,
int gridHeight,
int cellWidth,
int cellHeight,
com.badlogic.gdx.graphics.g2d.BitmapFont bitmapFont,
SquidColorCenter bgColorCenter,
SquidColorCenter fgColorCenter)
Create a new SquidLayers widget with the given BitmapFont (already constructed), the given number of cells for
gridWidth and gridHeight, and the size in pixels for each cell given by cellWidth and cellHeight.
|
SquidLayers(int gridWidth,
int gridHeight,
int cellWidth,
int cellHeight,
SquidColorCenter bgColorCenter,
SquidColorCenter fgColorCenter)
Create a new SquidLayers widget with a default font (it will be square if cellWidth and cellHeight are equal, or
narrow otherwise), the given number of cells for gridWidth
and gridHeight, and the size in pixels for each cell given by cellWidth and cellHeight.
|
SquidLayers(int gridWidth,
int gridHeight,
int cellWidth,
int cellHeight,
String fontpath)
Create a new SquidLayers widget with the given path to a BitmapFont file, the given number of cells for gridWidth
and gridHeight, and the size in pixels for each cell given by cellWidth and cellHeight.
|
SquidLayers(int gridWidth,
int gridHeight,
int cellWidth,
int cellHeight,
String fontpath,
SquidColorCenter bgColorCenter,
SquidColorCenter fgColorCenter)
Create a new SquidLayers widget with the given path to a BitmapFont file, the given number of cells for gridWidth
and gridHeight, and the size in pixels for each cell given by cellWidth and cellHeight.
|
SquidLayers(int gridWidth,
int gridHeight,
int cellWidth,
int cellHeight,
TextCellFactory tcf)
Create a new SquidLayers widget with the given path pre-constructed TextCellFactory, the given number of cells
for gridWidth and gridHeight, and the size in pixels for each cell given by cellWidth and cellHeight.
|
SquidLayers(int gridWidth,
int gridHeight,
int cellWidth,
int cellHeight,
TextCellFactory tcf,
SquidColorCenter bgColorCenter,
SquidColorCenter fgColorCenter)
Create a new SquidLayers widget with the given TextCellFactory, the given number of cells for gridWidth
and gridHeight, the size in pixels for each cell given by cellWidth and cellHeight, and the given
SquidColorCenters for background and foreground.
|
Modifier and Type | Method and Description |
---|---|
SquidLayers |
addExtraLayer()
Add an extra layer on top of the foreground layer.
|
ArrayList<com.badlogic.gdx.graphics.Color> |
alterPalette(int index,
com.badlogic.gdx.graphics.Color color)
Changes a color at the specified index in the default palette, then returns that palette.
|
AnimatedEntity |
animateActor(int x,
int y,
char c,
Collection<com.badlogic.gdx.graphics.Color> colors,
boolean doubleWidth) |
AnimatedEntity |
animateActor(int x,
int y,
char c,
Collection<com.badlogic.gdx.graphics.Color> colors,
float loopTime,
boolean doubleWidth) |
AnimatedEntity |
animateActor(int x,
int y,
char c,
com.badlogic.gdx.graphics.Color color) |
AnimatedEntity |
animateActor(int x,
int y,
char c,
com.badlogic.gdx.graphics.Color color,
boolean doubleWidth) |
AnimatedEntity |
animateActor(int x,
int y,
char c,
com.badlogic.gdx.graphics.Color color,
int layer) |
AnimatedEntity |
animateActor(int x,
int y,
char c,
int index) |
AnimatedEntity |
animateActor(int x,
int y,
char c,
int index,
ArrayList<com.badlogic.gdx.graphics.Color> palette) |
AnimatedEntity |
animateActor(int x,
int y,
char c,
int index,
ArrayList<com.badlogic.gdx.graphics.Color> palette,
int layer) |
AnimatedEntity |
animateActor(int x,
int y,
char c,
int index,
boolean doubleWidth) |
AnimatedEntity |
animateActor(int x,
int y,
char c,
int index,
int layer) |
AnimatedEntity |
animateActor(int x,
int y,
String s,
com.badlogic.gdx.graphics.Color color) |
AnimatedEntity |
animateActor(int x,
int y,
String s,
com.badlogic.gdx.graphics.Color color,
boolean doubleWidth) |
AnimatedEntity |
animateActor(int x,
int y,
String s,
com.badlogic.gdx.graphics.Color color,
int layer) |
AnimatedEntity |
animateActor(int x,
int y,
String s,
com.badlogic.gdx.graphics.Color color,
int layer,
boolean doubleWidth) |
AnimatedEntity |
animateActor(int x,
int y,
String s,
int index) |
AnimatedEntity |
animateActor(int x,
int y,
String s,
int index,
ArrayList<com.badlogic.gdx.graphics.Color> palette) |
AnimatedEntity |
animateActor(int x,
int y,
String s,
int index,
ArrayList<com.badlogic.gdx.graphics.Color> palette,
int layer) |
AnimatedEntity |
animateActor(int x,
int y,
String s,
int index,
boolean doubleWidth) |
AnimatedEntity |
animateActor(int x,
int y,
String s,
int index,
int layer) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr,
boolean doubleWidth) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr,
boolean doubleWidth,
boolean stretch) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr,
com.badlogic.gdx.graphics.Color color) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr,
com.badlogic.gdx.graphics.Color color,
boolean doubleWidth) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr,
com.badlogic.gdx.graphics.Color color,
boolean doubleWidth,
boolean stretch) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr,
com.badlogic.gdx.graphics.Color color,
int layer) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr,
com.badlogic.gdx.graphics.Color color,
int layer,
boolean doubleWidth,
boolean stretch) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr,
int index) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr,
int index,
ArrayList<com.badlogic.gdx.graphics.Color> palette) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr,
int index,
ArrayList<com.badlogic.gdx.graphics.Color> palette,
int layer) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr,
int index,
ArrayList<com.badlogic.gdx.graphics.Color> palette,
int layer,
boolean doubleWidth) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr,
int index,
ArrayList<com.badlogic.gdx.graphics.Color> palette,
int layer,
boolean doubleWidth,
boolean stretch) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr,
int index,
boolean doubleWidth) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr,
int index,
boolean doubleWidth,
boolean stretch) |
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion tr,
int index,
int layer) |
SquidLayers |
bump(AnimatedEntity ae,
squidpony.squidgrid.Direction dir) |
SquidLayers |
bump(AnimatedEntity ae,
int layer,
squidpony.squidgrid.Direction dir,
float duration) |
SquidLayers |
bump(int x,
int y,
squidpony.squidgrid.Direction dir) |
SquidLayers |
bump(int x,
int y,
int layer,
squidpony.squidgrid.Direction dir,
float duration) |
SquidLayers |
clear(int x,
int y)
Clear one cell at position x, y of its foreground contents.
|
void |
draw(com.badlogic.gdx.graphics.g2d.Batch batch,
float parentAlpha) |
void |
drawActor(com.badlogic.gdx.graphics.g2d.Batch batch,
float parentAlpha,
AnimatedEntity ae) |
void |
drawActor(com.badlogic.gdx.graphics.g2d.Batch batch,
float parentAlpha,
AnimatedEntity ae,
int layer) |
SquidLayers |
erase()
Erase everything visible in all cells or all layers.
|
SquidLayers |
eraseLayer(int layer) |
ArrayList<com.badlogic.gdx.graphics.Color> |
extendPalette(com.badlogic.gdx.graphics.Color color)
Adds a color to the end of the default palette, then returns that palette.
|
LinkedHashSet<AnimatedEntity> |
getAnimatedEntities() |
LinkedHashSet<AnimatedEntity> |
getAnimatedEntities(int layer) |
AnimatedEntity |
getAnimatedEntityByCell(int x,
int y) |
AnimatedEntity |
getAnimatedEntityByCell(int x,
int y,
int layer) |
float |
getAnimationDuration() |
SquidPanel |
getBackgroundLayer() |
int |
getCellHeight()
Height of one cell in pixels.
|
int |
getCellWidth()
Width of one cell in pixels.
|
SquidPanel |
getForegroundLayer() |
int |
getGridHeight()
Height of the map in grid cells.
|
int |
getGridWidth()
Width of the map in grid cells.
|
float |
getHeight()
The pixel height of the entire map.
|
SquidPanel |
getLayer(int layer) |
com.badlogic.gdx.graphics.Color |
getLightingColor() |
int[][] |
getLightnesses()
Get the lightness modifiers used for background cells as an int[][], with elements between 0 and 511, 256 as the
unmodified lightness level, lower numbers meaning darker, and higher meaning lighter.
|
ArrayList<com.badlogic.gdx.graphics.Color> |
getPalette()
Gets the current palette used when no other is specified.
|
TextCellFactory |
getTextFactory() |
float |
getWidth()
The pixel width of the entire map.
|
boolean |
hasActiveAnimations() |
boolean |
hasValue(int x,
int y)
Very basic check to see if something was rendered at the x,y cell requested.
|
SquidLayers |
highlight(int x,
int y,
int lightness)
Change the lightness for the background of the cell at x, y (0 is no change, 100 is
very bright, -100 is very dark, anything past -150 or 150 will make the background almost fully black or white).
|
SquidLayers |
highlight(int x,
int y,
int[][] lightness)
Change the lightness for the background of the cell at x, y (0 is no change, 100 is
very bright, -100 is very dark, anything past -150 or 150 will make the background almost fully black or white).
|
SquidLayers |
put(int x,
int y,
char c)
Place a char c into the foreground at position x, y, with the default color.
|
SquidLayers |
put(int x,
int y,
char[][] c) |
SquidLayers |
put(int x,
int y,
char[][] c,
ArrayList<com.badlogic.gdx.graphics.Color> alternatePalette,
int[][] foregroundIndex,
int[][] backgroundIndex,
int[][] backgroundLightness)
Place a char c into the foreground, with a foreground color specified by an index into alternatePalette, a
background color specified in the same way, and a lightness variation for the background (0 is no change, 100 is
very bright, -100 is very dark, anything past -150 or 150 will make the background almost fully black or white).
|
SquidLayers |
put(int x,
int y,
char[][] c,
com.badlogic.gdx.graphics.Color[][] foregrounds,
com.badlogic.gdx.graphics.Color[][] backgrounds,
int[][] backgroundLightness)
Place a char c into the foreground, with a foreground color specified by an index into alternatePalette, a
background color specified in the same way, and a lightness variation for the background (0 is no change, 100 is
very bright, -100 is very dark, anything past -150 or 150 will make the background almost fully black or white).
|
SquidLayers |
put(int x,
int y,
char[][] c,
int[][] foregroundIndex) |
SquidLayers |
put(int x,
int y,
char[][] c,
int[][] foregroundIndex,
ArrayList<com.badlogic.gdx.graphics.Color> fgPalette,
int[][] backgroundIndex,
ArrayList<com.badlogic.gdx.graphics.Color> bgPalette,
int[][] backgroundLightness)
Place a char c into the foreground, with a foreground color specified by an index into alternatePalette, a
background color specified in the same way, and a lightness variation for the background (0 is no change, 100 is
very bright, -100 is very dark, anything past -150 or 150 will make the background almost fully black or white).
|
SquidLayers |
put(int x,
int y,
char[][] c,
int[][] foregroundIndex,
int[][] backgroundIndex) |
SquidLayers |
put(int x,
int y,
char[][] c,
int[][] foregroundIndex,
int[][] backgroundIndex,
int[][] backgroundLightness)
Place a char[][] c into the foreground, with a foreground color specified by an index into alternatePalette, a
background color specified in the same way, and a lightness variation for the background (0 is no change, 100 is
very bright, -100 is very dark, anything past -150 or 150 will make the background almost fully black or white).
|
SquidLayers |
put(int x,
int y,
char c,
ArrayList<com.badlogic.gdx.graphics.Color> alternatePalette,
int foregroundIndex,
int backgroundIndex,
int backgroundLightness)
Place a char c into the foreground, with a foreground color specified by an index into alternatePalette, a
background color specified in the same way, and a lightness variation for the background (0 is no change, 100 is
very bright, -100 is very dark, anything past -150 or 150 will make the background almost fully black or white).
|
SquidLayers |
put(int x,
int y,
char c,
com.badlogic.gdx.graphics.Color foreground)
Place a char c into the foreground, with a foreground color specified by an index into the default palette.
|
SquidLayers |
put(int x,
int y,
char c,
com.badlogic.gdx.graphics.Color foreground,
com.badlogic.gdx.graphics.Color background)
Place a char c into the foreground, with a foreground color specified by an index into the default palette, and a
background color specified in the same way.
|
SquidLayers |
put(int x,
int y,
char c,
com.badlogic.gdx.graphics.Color foreground,
com.badlogic.gdx.graphics.Color background,
int backgroundLightness)
Place a char c into the foreground, with a foreground and background libGDX Color and a lightness variation for
the background (0 is no change, 255 will nearly double the brightness (capping at white), -255 will reduce the
color to nearly black (for most colors, all the way to black), and values in between will be proportional..
|
SquidLayers |
put(int x,
int y,
char c,
int foregroundIndex)
Place a char c into the foreground, with a foreground color specified by an index into the default palette.
|
SquidLayers |
put(int x,
int y,
char c,
int foregroundIndex,
ArrayList<com.badlogic.gdx.graphics.Color> fgPalette,
int backgroundIndex,
ArrayList<com.badlogic.gdx.graphics.Color> bgPalette,
int backgroundLightness)
Place a char c into the foreground, with a foreground color specified by an index into alternatePalette, a
background color specified in the same way, and a lightness variation for the background (0 is no change, 100 is
very bright, -100 is very dark, anything past -150 or 150 will make the background almost fully black or white).
|
SquidLayers |
put(int x,
int y,
char c,
int foregroundIndex,
int backgroundIndex)
Place a char c into the foreground, with a foreground color specified by an index into the default palette, and a
background color specified in the same way.
|
SquidLayers |
put(int x,
int y,
char c,
int foregroundIndex,
int backgroundIndex,
int backgroundLightness)
Place a char c into the foreground, with a foreground color specified by an index into the default palette, a
background color specified in the same way, and a lightness variation for the background (0 is no change, 100 is
very bright, -100 is very dark, anything past -150 or 150 will make the background almost fully black or white).
|
SquidLayers |
putBoxedString(int x,
int y,
String s)
A utility method that draws a 1-cell-wide black box around the text you request (as s) and replaces the contents
of anything that was below or adjacent to the string's new position.
|
SquidLayers |
putInto(int layer,
int x,
int y,
char c)
Place a char c into the specified layer, with a color specified by an index into alternatePalette.
|
SquidLayers |
putInto(int layer,
int x,
int y,
char[][] c)
Place a char c[][] into the specified layer, with a color specified by an index into alternatePalette.
|
SquidLayers |
putInto(int layer,
int x,
int y,
char[][] c,
ArrayList<com.badlogic.gdx.graphics.Color> alternatePalette,
int[][] colorIndex)
Place a char c[][] into the specified layer, with a color specified by an index into alternatePalette.
|
SquidLayers |
putInto(int layer,
int x,
int y,
char[][] c,
com.badlogic.gdx.graphics.Color[][] colors)
Place a char c[][] into the specified layer, with a color specified by an index into alternatePalette.
|
SquidLayers |
putInto(int layer,
int x,
int y,
char[][] c,
int[][] colorIndex)
Place a char c[][] into the specified layer, with a color specified by an index into the default palette.
|
SquidLayers |
putInto(int layer,
int x,
int y,
char c,
ArrayList<com.badlogic.gdx.graphics.Color> alternatePalette,
int colorIndex)
Place a char c into the specified layer, with a color specified by an index into alternatePalette.
|
SquidLayers |
putInto(int layer,
int x,
int y,
char c,
com.badlogic.gdx.graphics.Color color)
Place a char c into the foreground, with a foreground color specified by an index into the default palette.
|
SquidLayers |
putInto(int layer,
int x,
int y,
char c,
int colorIndex)
Place a char c into the specified layer, with a color specified by an index into the default palette.
|
SquidLayers |
putString(int x,
int y,
String s)
Put a string at the given x, y position, using the default color.
|
SquidLayers |
putString(int x,
int y,
String s,
ArrayList<com.badlogic.gdx.graphics.Color> alternatePalette,
int foregroundIndex,
int backgroundIndex)
Put a string at the given x, y position, with the given indices for foreground and background color that look up
their index in alternatePalette.
|
SquidLayers |
putString(int x,
int y,
String s,
com.badlogic.gdx.graphics.Color foreground,
com.badlogic.gdx.graphics.Color background)
Put a string at the given x, y position, with the given indices for foreground and background color that look up
their index in alternatePalette.
|
SquidLayers |
putString(int x,
int y,
String s,
int foregroundIndex)
Put a string at the given x, y position, with the given index for foreground color that gets looked up in the
default palette.
|
SquidLayers |
putString(int x,
int y,
String s,
int foregroundIndex,
int backgroundIndex)
Put a string at the given x, y position, with the given indices for foreground and background color that look up
their index in the default palette.
|
void |
removeAnimatedEntity(AnimatedEntity ae) |
void |
removeAnimatedEntity(AnimatedEntity ae,
int layer) |
void |
removeAnimatedEntityByCell(int x,
int y) |
void |
removeAnimatedEntityByCell(int x,
int y,
int layer) |
void |
setAnimationDuration(float animationDuration) |
void |
setBGColorCenter(squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> scc)
Sets the IColorCenter used by the background layer.
|
void |
setFGColorCenter(squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> scc)
Sets the IColorCenter used by the foreground layer.
|
void |
setLightingColor(com.badlogic.gdx.graphics.Color lightingColor) |
void |
setLightnesses(int[][] lightnesses)
Sets the lightness modifiers used for background cells with the int[][] passed as lightnesses.
|
void |
setOffsets(float x,
float y) |
void |
setPosition(float x,
float y)
Sets the position of the actor's bottom left corner.
|
SquidLayers |
setTextSize(int wide,
int high)
Sets the size of the text in all layers (but not the size of the cells) to the given width and height in pixels
(which may be stretched by viewports later on, if your program uses them).
|
SquidLayers |
setTextSize(int layer,
int wide,
int high)
Sets the size of the text in the given layer (but not the size of the cells) to the given width and height in
pixels (which may be stretched by viewports later on, if your program uses them).
|
SquidLayers |
slide(AnimatedEntity ae,
int endX,
int endY) |
SquidLayers |
slide(AnimatedEntity ae,
int endX,
int endY,
int layer,
float duration) |
SquidLayers |
slide(int x,
int y,
int endX,
int endY) |
SquidLayers |
slide(int x,
int y,
int endX,
int endY,
int layer,
float duration) |
SquidLayers |
tint(AnimatedEntity ae,
com.badlogic.gdx.graphics.Color color) |
SquidLayers |
tint(AnimatedEntity ae,
com.badlogic.gdx.graphics.Color color,
int layer,
float duration) |
SquidLayers |
tint(int x,
int y,
com.badlogic.gdx.graphics.Color color) |
SquidLayers |
tint(int x,
int y,
com.badlogic.gdx.graphics.Color color,
int layer,
float duration) |
SquidLayers |
wiggle(AnimatedEntity ae) |
SquidLayers |
wiggle(AnimatedEntity ae,
int layer,
float duration) |
SquidLayers |
wiggle(int x,
int y) |
SquidLayers |
wiggle(int x,
int y,
int layer,
float duration) |
act, addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, applyTransform, childrenChanged, clear, clearChildren, computeTransform, debugAll, drawChildren, drawDebug, drawDebugChildren, findActor, getChildren, getCullingArea, hasChildren, hit, isTransform, localToDescendantCoordinates, removeActor, removeActor, resetTransform, resetTransform, setCullingArea, setDebug, setStage, setTransform, swapActor, swapActor, toString
addAction, addCaptureListener, addListener, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebugBounds, fire, getActions, getCaptureListeners, getColor, getDebug, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getX, getX, getY, getY, getZIndex, hasActions, hasParent, isAscendantOf, isDescendantOf, isTouchable, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setY, setZIndex, sizeBy, sizeBy, sizeChanged, stageToLocalCoordinates, toBack, toFront
protected int width
protected int height
protected int cellWidth
protected int cellHeight
protected SquidPanel backgroundPanel
protected SquidPanel foregroundPanel
protected int[][] lightnesses
protected ArrayList<SquidPanel> extraPanels
protected TextCellFactory textFactory
protected boolean[][] values
protected float animationDuration
public static final char EMPTY_CELL
public SquidLayers()
public SquidLayers(int gridWidth, int gridHeight)
gridWidth
- in grid cellsgridHeight
- in grid cellspublic SquidLayers(int gridWidth, int gridHeight, int cellWidth, int cellHeight)
gridWidth
- in grid cellsgridHeight
- in grid cellscellWidth
- in pixelscellHeight
- in pixelspublic SquidLayers(int gridWidth, int gridHeight, int cellWidth, int cellHeight, String fontpath)
gridWidth
- in grid cellsgridHeight
- in grid cellscellWidth
- in pixelscellHeight
- in pixelsfontpath
- A path to a BitmapFont that can be on the classpath (in SquidLib) or in the assets folderpublic SquidLayers(int gridWidth, int gridHeight, int cellWidth, int cellHeight, com.badlogic.gdx.graphics.g2d.BitmapFont bitmapFont)
gridWidth
- in grid cellsgridHeight
- in grid cellscellWidth
- in pixelscellHeight
- in pixelsbitmapFont
- A BitmapFont that you already constructedpublic SquidLayers(int gridWidth, int gridHeight, int cellWidth, int cellHeight, TextCellFactory tcf)
gridWidth
- in grid cellsgridHeight
- in grid cellscellWidth
- in pixelscellHeight
- in pixelstcf
- A TextCellFactory that you already constructedpublic SquidLayers(int gridWidth, int gridHeight, int cellWidth, int cellHeight, SquidColorCenter bgColorCenter, SquidColorCenter fgColorCenter)
gridWidth
- in grid cellsgridHeight
- in grid cellscellWidth
- in pixelscellHeight
- in pixelsbgColorCenter
- a SquidColorCenter (possibly with a filter) to use for the backgroundfgColorCenter
- a SquidColorCenter (possibly with a filter) to use for the foregroundpublic SquidLayers(int gridWidth, int gridHeight, int cellWidth, int cellHeight, String fontpath, SquidColorCenter bgColorCenter, SquidColorCenter fgColorCenter)
gridWidth
- in grid cellsgridHeight
- in grid cellscellWidth
- in pixelscellHeight
- in pixelsfontpath
- A path to a BitmapFont that can be on the classpath (in SquidLib) or in the assets folder.bgColorCenter
- a SquidColorCenter (possibly with a filter) to use for the backgroundfgColorCenter
- a SquidColorCenter (possibly with a filter) to use for the foregroundpublic SquidLayers(int gridWidth, int gridHeight, int cellWidth, int cellHeight, com.badlogic.gdx.graphics.g2d.BitmapFont bitmapFont, SquidColorCenter bgColorCenter, SquidColorCenter fgColorCenter)
gridWidth
- in grid cellsgridHeight
- in grid cellscellWidth
- in pixelscellHeight
- in pixelsbitmapFont
- A BitmapFont that you already constructedbgColorCenter
- a SquidColorCenter (possibly with a filter) to use for the backgroundfgColorCenter
- a SquidColorCenter (possibly with a filter) to use for the foregroundpublic SquidLayers(int gridWidth, int gridHeight, int cellWidth, int cellHeight, TextCellFactory tcf, SquidColorCenter bgColorCenter, SquidColorCenter fgColorCenter)
gridWidth
- in grid cellsgridHeight
- in grid cellscellWidth
- in pixelscellHeight
- in pixelstcf
- A TextCellFactory that will be (re-)initialized here with the given cellHeight and cellWidth.bgColorCenter
- a SquidColorCenter (possibly with a filter) to use for the backgroundfgColorCenter
- a SquidColorCenter (possibly with a filter) to use for the foregroundpublic float getWidth()
getWidth
in class com.badlogic.gdx.scenes.scene2d.Actor
public float getHeight()
getHeight
in class com.badlogic.gdx.scenes.scene2d.Actor
public int getGridWidth()
public int getGridHeight()
public int getCellWidth()
public int getCellHeight()
public float getAnimationDuration()
public void setAnimationDuration(float animationDuration)
public TextCellFactory getTextFactory()
public ArrayList<com.badlogic.gdx.graphics.Color> getPalette()
public int[][] getLightnesses()
public void setLightnesses(int[][] lightnesses)
lightnesses
- 2D array, width and height should match this class' gridWidth and gridHeight. elements must
be between 0 and 511.public SquidLayers addExtraLayer()
public ArrayList<com.badlogic.gdx.graphics.Color> extendPalette(com.badlogic.gdx.graphics.Color color)
color
- an Color to add to the palette at the endpublic ArrayList<com.badlogic.gdx.graphics.Color> alterPalette(int index, com.badlogic.gdx.graphics.Color color)
index
- must be at least 0 and less than the length of palette (starts at length 40).color
- the Color to put at the given indexpublic SquidLayers setTextSize(int layer, int wide, int high)
layer
- the layer to affect; 0 is background, 1 is unused, 2 is foreground, 3 and higher are extra panelswide
- the width of a glyph in pixelshigh
- the height of a glyph in pixelspublic SquidLayers setTextSize(int wide, int high)
wide
- the width of a glyph in pixelshigh
- the height of a glyph in pixelspublic SquidLayers put(int x, int y, char c)
x
- in grid cells.y
- in grid cells.c
- a character to be drawn in the foregroundpublic SquidLayers put(int x, int y, char c, int foregroundIndex)
x
- in grid cells.y
- in grid cells.c
- a character to be drawn in the foregroundforegroundIndex
- int index into the default palette for the char being drawnpublic SquidLayers put(int x, int y, char c, com.badlogic.gdx.graphics.Color foreground)
x
- in grid cells.y
- in grid cells.c
- a character to be drawn in the foregroundforeground
- Color for the char being drawnpublic SquidLayers put(int x, int y, char c, int foregroundIndex, int backgroundIndex)
x
- in grid cells.y
- in grid cells.c
- a character to be drawn in the foregroundforegroundIndex
- int index into the default palette for the char being drawnbackgroundIndex
- int index into the default palette for the backgroundpublic SquidLayers put(int x, int y, char c, com.badlogic.gdx.graphics.Color foreground, com.badlogic.gdx.graphics.Color background)
x
- in grid cells.y
- in grid cells.c
- a character to be drawn in the foregroundforeground
- Color for the char being drawnbackground
- Color for the backgroundpublic SquidLayers put(int x, int y, char c, int foregroundIndex, int backgroundIndex, int backgroundLightness)
x
- in grid cells.y
- in grid cells.c
- a character to be drawn in the foregroundforegroundIndex
- int index into the default palette for the char being drawnbackgroundIndex
- int index into the default palette for the backgroundbackgroundLightness
- int between -255 and 255 , lower numbers are darker, higher lighter.public SquidLayers put(int x, int y, char c, ArrayList<com.badlogic.gdx.graphics.Color> alternatePalette, int foregroundIndex, int backgroundIndex, int backgroundLightness)
x
- in grid cells.y
- in grid cells.c
- a character to be drawn in the foregroundalternatePalette
- an alternate Color ArrayList for both foreground and backgroundforegroundIndex
- int index into alternatePalette for the char being drawnbackgroundIndex
- int index into alternatePalette for the backgroundbackgroundLightness
- int between -255 and 255 , lower numbers are darker, higher lighter.public SquidLayers put(int x, int y, char c, com.badlogic.gdx.graphics.Color foreground, com.badlogic.gdx.graphics.Color background, int backgroundLightness)
x
- in grid cells.y
- in grid cells.c
- a character to be drawn in the foregroundforeground
- Color for the char being drawnbackground
- Color for the backgroundbackgroundLightness
- int between -255 and 255 , lower numbers are darker, higher lighter.public SquidLayers put(int x, int y, char c, int foregroundIndex, ArrayList<com.badlogic.gdx.graphics.Color> fgPalette, int backgroundIndex, ArrayList<com.badlogic.gdx.graphics.Color> bgPalette, int backgroundLightness)
x
- in grid cells.y
- in grid cells.c
- a character to be drawn in the foregroundforegroundIndex
- int index into alternatePalette for the char being drawnfgPalette
- an alternate Color ArrayList for the foreground; can be null to use the default.backgroundIndex
- int index into alternatePalette for the backgroundbgPalette
- an alternate Color ArrayList for the background; can be null to use the default.backgroundLightness
- int between -255 and 255 , lower numbers are darker, higher lighter.public SquidLayers put(int x, int y, char[][] c)
public SquidLayers put(int x, int y, char[][] c, int[][] foregroundIndex)
public SquidLayers put(int x, int y, char[][] c, int[][] foregroundIndex, int[][] backgroundIndex)
public SquidLayers put(int x, int y, char[][] c, int[][] foregroundIndex, int[][] backgroundIndex, int[][] backgroundLightness)
x
- in grid cells.y
- in grid cells.c
- char[][] to be drawn in the foreground starting from x, yforegroundIndex
- int[][] of indices into the default palette for the char being drawnbackgroundIndex
- int[][] of indices into the default palette for the backgroundbackgroundLightness
- int[][] with elements between -255 and 255 , lower darker, higher lighter.public SquidLayers put(int x, int y, char[][] c, ArrayList<com.badlogic.gdx.graphics.Color> alternatePalette, int[][] foregroundIndex, int[][] backgroundIndex, int[][] backgroundLightness)
x
- in grid cells.y
- in grid cells.c
- char[][] to be drawn in the foreground starting from x, yalternatePalette
- an alternate Color ArrayList for both foreground and backgroundforegroundIndex
- int[][] of indices into alternatePalette for the char being drawnbackgroundIndex
- int[][] of indices into alternatePalette for the backgroundbackgroundLightness
- int[][] with elements between -255 and 255 , lower darker, higher lighter.public SquidLayers put(int x, int y, char[][] c, com.badlogic.gdx.graphics.Color[][] foregrounds, com.badlogic.gdx.graphics.Color[][] backgrounds, int[][] backgroundLightness)
x
- in grid cells.y
- in grid cells.c
- char[][] to be drawn in the foreground starting from x, yforegrounds
- int[][] of indices into alternatePalette for the char being drawnbackgrounds
- int[][] of indices into alternatePalette for the backgroundbackgroundLightness
- int[][] with elements between -255 and 255 , lower darker, higher lighter.public SquidLayers put(int x, int y, char[][] c, int[][] foregroundIndex, ArrayList<com.badlogic.gdx.graphics.Color> fgPalette, int[][] backgroundIndex, ArrayList<com.badlogic.gdx.graphics.Color> bgPalette, int[][] backgroundLightness)
x
- in grid cells.y
- in grid cells.c
- char[][] to be drawn in the foreground starting from x, yforegroundIndex
- int[][] of indices into fgPalette for the char being drawnfgPalette
- an alternate Color ArrayList for the foreground; can be null to use the default.backgroundIndex
- int[][] of indices into bgPalette for the backgroundbgPalette
- an alternate Color ArrayList for the background; can be null to use the default.backgroundLightness
- int[][] with elements between -255 and 255 , lower darker, higher lighter.public SquidLayers putInto(int layer, int x, int y, char c)
layer
- 0 or 1 for background, 2 for foreground, 3 or higher for extra layers added on.x
- in grid cells.y
- in grid cells.c
- char to be drawn in the foreground at x, ypublic SquidLayers putInto(int layer, int x, int y, char c, int colorIndex)
layer
- 0 or 1 for background, 2 for foreground, 3 or higher for extra layers added on.x
- in grid cells.y
- in grid cells.c
- char to be drawn in the foreground at x, ycolorIndex
- int index into alternatePalette for the char being drawnpublic SquidLayers putInto(int layer, int x, int y, char c, ArrayList<com.badlogic.gdx.graphics.Color> alternatePalette, int colorIndex)
layer
- 0 or 1 for background, 2 for foreground, 3 or higher for extra layers added on.x
- in grid cells.y
- in grid cells.c
- char to be drawn in the foreground at x, yalternatePalette
- an alternate Color ArrayList for both foreground and backgroundcolorIndex
- int index into alternatePalette for the char being drawnpublic SquidLayers putInto(int layer, int x, int y, char c, com.badlogic.gdx.graphics.Color color)
layer
- the layer to draw intox
- in grid cells.y
- in grid cells.c
- a character to be drawn in the specified layercolor
- Color for the char being drawnpublic SquidLayers putInto(int layer, int x, int y, char[][] c)
layer
- 0 or 1 for background, 2 for foreground, 3 or higher for extra layers added on.x
- in grid cells.y
- in grid cells.c
- char[][] to be drawn in the foreground starting from x, ypublic SquidLayers putInto(int layer, int x, int y, char[][] c, int[][] colorIndex)
layer
- 0 or 1 for background, 2 for foreground, 3 or higher for extra layers added on.x
- in grid cells.y
- in grid cells.c
- char[][] to be drawn in the foreground starting from x, ycolorIndex
- int[][] of indices into alternatePalette for the char being drawnpublic SquidLayers putInto(int layer, int x, int y, char[][] c, ArrayList<com.badlogic.gdx.graphics.Color> alternatePalette, int[][] colorIndex)
layer
- 0 or 1 for background, 2 for foreground, 3 or higher for extra layers added on.x
- in grid cells.y
- in grid cells.c
- char[][] to be drawn in the foreground starting from x, yalternatePalette
- an alternate Color ArrayList for both foreground and backgroundcolorIndex
- int[][] of indices into alternatePalette for the char being drawnpublic SquidLayers putInto(int layer, int x, int y, char[][] c, com.badlogic.gdx.graphics.Color[][] colors)
layer
- 0 or 1 for background, 2 for foreground, 3 or higher for extra layers added on.x
- in grid cells.y
- in grid cells.c
- char[][] to be drawn in the foreground starting from x, ycolors
- int[][] of indices into alternatePalette for the char being drawnpublic SquidLayers putString(int x, int y, String s)
x
- in grid cells.y
- in grid cells.s
- the string to printpublic SquidLayers putString(int x, int y, String s, int foregroundIndex)
x
- in grid cells.y
- in grid cells.s
- the string to printforegroundIndex
- the indexed color to usepublic SquidLayers putString(int x, int y, String s, int foregroundIndex, int backgroundIndex)
x
- in grid cells.y
- in grid cells.s
- the string to printforegroundIndex
- the indexed color to usebackgroundIndex
- the indexed color to usepublic SquidLayers putString(int x, int y, String s, ArrayList<com.badlogic.gdx.graphics.Color> alternatePalette, int foregroundIndex, int backgroundIndex)
x
- in grid cells.y
- in grid cells.s
- the string to printalternatePalette
- the colors this can use, where the indices are used instead of individual colorsforegroundIndex
- the indexed color to usebackgroundIndex
- the indexed color to usepublic SquidLayers putString(int x, int y, String s, com.badlogic.gdx.graphics.Color foreground, com.badlogic.gdx.graphics.Color background)
x
- in grid cells.y
- in grid cells.s
- the string to printforeground
- the Color of the string's charsbackground
- the Color of the background of the stringpublic SquidLayers putBoxedString(int x, int y, String s)
x
- in grid cells.y
- in grid cells.s
- the string to print inside the boxpublic SquidLayers highlight(int x, int y, int lightness)
x
- in grid cells.y
- in grid cells.lightness
- int between -255 and 255 , lower numbers are darker, higher lighter.public SquidLayers highlight(int x, int y, int[][] lightness)
x
- in grid cells.y
- in grid cells.lightness
- int[][] with elements between -255 and 255 , lower numbers are darker, higher lighter.public boolean hasValue(int x, int y)
x
- in grid cells.y
- in grid cells.public SquidLayers clear(int x, int y)
x
- in grid cellsy
- in grid cellspublic SquidLayers eraseLayer(int layer)
public SquidLayers erase()
public SquidLayers bump(int x, int y, int layer, squidpony.squidgrid.Direction dir, float duration)
public SquidLayers bump(AnimatedEntity ae, int layer, squidpony.squidgrid.Direction dir, float duration)
public SquidLayers bump(int x, int y, squidpony.squidgrid.Direction dir)
public SquidLayers bump(AnimatedEntity ae, squidpony.squidgrid.Direction dir)
public SquidLayers slide(AnimatedEntity ae, int endX, int endY, int layer, float duration)
public SquidLayers slide(int x, int y, int endX, int endY, int layer, float duration)
public SquidLayers slide(int x, int y, int endX, int endY)
public SquidLayers slide(AnimatedEntity ae, int endX, int endY)
public SquidLayers wiggle(int x, int y, int layer, float duration)
public SquidLayers wiggle(AnimatedEntity ae, int layer, float duration)
public SquidLayers wiggle(int x, int y)
public SquidLayers wiggle(AnimatedEntity ae)
public SquidLayers tint(int x, int y, com.badlogic.gdx.graphics.Color color, int layer, float duration)
public SquidLayers tint(AnimatedEntity ae, com.badlogic.gdx.graphics.Color color, int layer, float duration)
public SquidLayers tint(int x, int y, com.badlogic.gdx.graphics.Color color)
public SquidLayers tint(AnimatedEntity ae, com.badlogic.gdx.graphics.Color color)
public boolean hasActiveAnimations()
public AnimatedEntity animateActor(int x, int y, char c, com.badlogic.gdx.graphics.Color color, int layer)
public AnimatedEntity animateActor(int x, int y, char c, com.badlogic.gdx.graphics.Color color)
public AnimatedEntity animateActor(int x, int y, char c, com.badlogic.gdx.graphics.Color color, boolean doubleWidth)
public AnimatedEntity animateActor(int x, int y, char c, Collection<com.badlogic.gdx.graphics.Color> colors, boolean doubleWidth)
public AnimatedEntity animateActor(int x, int y, char c, Collection<com.badlogic.gdx.graphics.Color> colors, float loopTime, boolean doubleWidth)
public AnimatedEntity animateActor(int x, int y, char c, int index, ArrayList<com.badlogic.gdx.graphics.Color> palette, int layer)
public AnimatedEntity animateActor(int x, int y, char c, int index, ArrayList<com.badlogic.gdx.graphics.Color> palette)
public AnimatedEntity animateActor(int x, int y, char c, int index, int layer)
public AnimatedEntity animateActor(int x, int y, char c, int index)
public AnimatedEntity animateActor(int x, int y, char c, int index, boolean doubleWidth)
public AnimatedEntity animateActor(int x, int y, String s, com.badlogic.gdx.graphics.Color color, int layer)
public AnimatedEntity animateActor(int x, int y, String s, com.badlogic.gdx.graphics.Color color, int layer, boolean doubleWidth)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, com.badlogic.gdx.graphics.Color color, int layer)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, com.badlogic.gdx.graphics.Color color, int layer, boolean doubleWidth, boolean stretch)
public AnimatedEntity animateActor(int x, int y, String s, com.badlogic.gdx.graphics.Color color)
public AnimatedEntity animateActor(int x, int y, String s, com.badlogic.gdx.graphics.Color color, boolean doubleWidth)
public AnimatedEntity animateActor(int x, int y, String s, int index, ArrayList<com.badlogic.gdx.graphics.Color> palette, int layer)
public AnimatedEntity animateActor(int x, int y, String s, int index, ArrayList<com.badlogic.gdx.graphics.Color> palette)
public AnimatedEntity animateActor(int x, int y, String s, int index, int layer)
public AnimatedEntity animateActor(int x, int y, String s, int index)
public AnimatedEntity animateActor(int x, int y, String s, int index, boolean doubleWidth)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, com.badlogic.gdx.graphics.Color color)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, com.badlogic.gdx.graphics.Color color, boolean doubleWidth)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, com.badlogic.gdx.graphics.Color color, boolean doubleWidth, boolean stretch)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, int index, ArrayList<com.badlogic.gdx.graphics.Color> palette, int layer)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, int index, ArrayList<com.badlogic.gdx.graphics.Color> palette, int layer, boolean doubleWidth)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, int index, ArrayList<com.badlogic.gdx.graphics.Color> palette, int layer, boolean doubleWidth, boolean stretch)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, int index, ArrayList<com.badlogic.gdx.graphics.Color> palette)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, int index, int layer)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, int index)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, int index, boolean doubleWidth)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, int index, boolean doubleWidth, boolean stretch)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, boolean doubleWidth)
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, boolean doubleWidth, boolean stretch)
public LinkedHashSet<AnimatedEntity> getAnimatedEntities(int layer)
public LinkedHashSet<AnimatedEntity> getAnimatedEntities()
public AnimatedEntity getAnimatedEntityByCell(int x, int y, int layer)
public void removeAnimatedEntity(AnimatedEntity ae, int layer)
public void removeAnimatedEntity(AnimatedEntity ae)
public AnimatedEntity getAnimatedEntityByCell(int x, int y)
public void removeAnimatedEntityByCell(int x, int y, int layer)
public void removeAnimatedEntityByCell(int x, int y)
public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
draw
in class com.badlogic.gdx.scenes.scene2d.Group
public void drawActor(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha, AnimatedEntity ae, int layer)
public void drawActor(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha, AnimatedEntity ae)
public void setLightingColor(com.badlogic.gdx.graphics.Color lightingColor)
public com.badlogic.gdx.graphics.Color getLightingColor()
public void setPosition(float x, float y)
setPosition
in class com.badlogic.gdx.scenes.scene2d.Actor
x
- y
- public SquidPanel getLayer(int layer)
public SquidPanel getForegroundLayer()
public SquidPanel getBackgroundLayer()
public void setFGColorCenter(squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> scc)
scc
- an IColorCenterpublic void setBGColorCenter(squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> scc)
scc
- an IColorCenterpublic void setOffsets(float x, float y)
Copyright © 2012–2016. All rights reserved.