public class SquidPanel extends com.badlogic.gdx.scenes.scene2d.Group implements squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>
| Modifier and Type | Field and Description |
|---|---|
float |
DEFAULT_ANIMATION_DURATION |
| Constructor and Description |
|---|
SquidPanel(int gridWidth,
int gridHeight)
Creates a bare-bones panel with all default values for text rendering.
|
SquidPanel(int gridWidth,
int gridHeight,
int cellWidth,
int cellHeight)
Creates a panel with the given grid and cell size.
|
SquidPanel(int gridWidth,
int gridHeight,
TextCellFactory factory)
Builds a panel with the given grid size and all other parameters determined by the factory.
|
| Modifier and Type | Method and Description |
|---|---|
AnimatedEntity |
animateActor(int x,
int y,
boolean doubleWidth,
boolean stretch,
com.badlogic.gdx.graphics.g2d.TextureRegion texture)
Create an AnimatedEntity at position x, y, using a TextureRegion with no color modifications, which, if and only
if stretch is true, will be stretched to fit one cell, or two cells if doubleWidth is true.
|
AnimatedEntity |
animateActor(int x,
int y,
boolean doubleWidth,
boolean stretch,
com.badlogic.gdx.graphics.g2d.TextureRegion texture,
com.badlogic.gdx.graphics.Color color)
Create an AnimatedEntity at position x, y, using a TextureRegion with the given color, which, if and only
if stretch is true, will be stretched to fit one cell, or two cells if doubleWidth is true.
|
AnimatedEntity |
animateActor(int x,
int y,
boolean doubleWidth,
char c,
com.badlogic.gdx.graphics.Color color)
Create an AnimatedEntity at position x, y, using the char c in the given color.
|
AnimatedEntity |
animateActor(int x,
int y,
boolean doubleWidth,
String s,
com.badlogic.gdx.graphics.Color color)
Create an AnimatedEntity at position x, y, using the String s in the given color.
|
AnimatedEntity |
animateActor(int x,
int y,
boolean doubleWidth,
com.badlogic.gdx.graphics.g2d.TextureRegion texture)
Create an AnimatedEntity at position x, y, using a TextureRegion with no color modifications, which will be
stretched to fit one cell, or two cells if doubleWidth is true.
|
AnimatedEntity |
animateActor(int x,
int y,
boolean doubleWidth,
com.badlogic.gdx.graphics.g2d.TextureRegion texture,
com.badlogic.gdx.graphics.Color color)
Create an AnimatedEntity at position x, y, using a TextureRegion with the given color, which will be
stretched to fit one cell, or two cells if doubleWidth is true.
|
AnimatedEntity |
animateActor(int x,
int y,
char c,
com.badlogic.gdx.graphics.Color color)
Create an AnimatedEntity at position x, y, using the char c in the given color.
|
AnimatedEntity |
animateActor(int x,
int y,
char c,
int index,
ArrayList<com.badlogic.gdx.graphics.Color> palette)
Create an AnimatedEntity at position x, y, using the char c with a color looked up by index in palette.
|
AnimatedEntity |
animateActor(int x,
int y,
String s,
com.badlogic.gdx.graphics.Color color)
Create an AnimatedEntity at position x, y, using the String s in the given color.
|
AnimatedEntity |
animateActor(int x,
int y,
String s,
int index,
ArrayList<com.badlogic.gdx.graphics.Color> palette)
Create an AnimatedEntity at position x, y, using the String s with a color looked up by index in palette.
|
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion texture)
Create an AnimatedEntity at position x, y, using a TextureRegion with no color modifications, which will be
stretched to fit one cell.
|
AnimatedEntity |
animateActor(int x,
int y,
com.badlogic.gdx.graphics.g2d.TextureRegion texture,
com.badlogic.gdx.graphics.Color color)
Create an AnimatedEntity at position x, y, using a TextureRegion with the given color, which will be
stretched to fit one cell.
|
void |
bump(AnimatedEntity ae,
squidpony.squidgrid.Direction direction,
float duration)
Start a bumping animation in the given direction that will last duration seconds.
|
void |
bump(squidpony.squidmath.Coord location,
squidpony.squidgrid.Direction direction)
Starts a bumping animation in the direction provided.
|
void |
bump(int x,
int y,
squidpony.squidgrid.Direction direction)
Starts a bumping animation in the direction provided.
|
void |
bump(int x,
int y,
squidpony.squidgrid.Direction direction,
float duration)
Start a bumping animation in the given direction that will last duration seconds.
|
int |
cellHeight() |
com.badlogic.gdx.scenes.scene2d.Actor |
cellToActor(int x,
int y)
Created an Actor from the contents of the given x,y position on the grid.
|
com.badlogic.gdx.scenes.scene2d.Actor |
cellToActor(int x,
int y,
boolean doubleWidth)
Created an Actor from the contents of the given x,y position on the grid.
|
int |
cellWidth() |
void |
clear(int x,
int y) |
void |
draw(com.badlogic.gdx.graphics.g2d.Batch batch,
float parentAlpha) |
void |
drawActor(com.badlogic.gdx.graphics.g2d.Batch batch,
float parentAlpha,
AnimatedEntity ae)
Draws one AnimatedEntity, specifically the Actor it contains.
|
void |
erase()
Erases the entire panel, leaving only a transparent space.
|
LinkedHashSet<AnimatedEntity> |
getAnimatedEntities() |
AnimatedEntity |
getAnimatedEntityByCell(int x,
int y) |
squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color> |
getBacker() |
com.badlogic.gdx.graphics.Color |
getDefaultForegroundColor() |
int |
gridHeight() |
int |
gridWidth() |
boolean |
hasActiveAnimations()
Returns true if there are animations running when this method is called.
|
void |
placeVerticalString(int xOffset,
int yOffset,
String string,
boolean vertical)
Puts the given string horizontally with the first character at the given offset.
|
void |
put(char[][] chars)
Places the given characters into the grid starting at 0,0.
|
void |
put(char[][] chars,
com.badlogic.gdx.graphics.Color[][] foregrounds) |
void |
put(char[][] chars,
int[][] indices,
ArrayList<com.badlogic.gdx.graphics.Color> palette) |
void |
put(int x,
int y,
char c) |
void |
put(int xOffset,
int yOffset,
char[][] chars) |
void |
put(int xOffset,
int yOffset,
char[][] chars,
com.badlogic.gdx.graphics.Color foreground) |
void |
put(int xOffset,
int yOffset,
char[][] chars,
com.badlogic.gdx.graphics.Color[][] foregrounds) |
void |
put(int xOffset,
int yOffset,
char[][] chars,
int[][] indices,
ArrayList<com.badlogic.gdx.graphics.Color> palette) |
void |
put(int x,
int y,
char c,
com.badlogic.gdx.graphics.Color color)
Takes a unicode codepoint for input.
|
void |
put(int x,
int y,
char c,
int index,
ArrayList<com.badlogic.gdx.graphics.Color> palette) |
void |
put(int x,
int y,
com.badlogic.gdx.graphics.Color color) |
void |
put(int xOffset,
int yOffset,
com.badlogic.gdx.graphics.Color[][] foregrounds) |
void |
put(int xOffset,
int yOffset,
squidpony.panel.IColoredString<? extends com.badlogic.gdx.graphics.Color> cs) |
void |
put(int x,
int y,
int code)
Takes a unicode codepoint for input.
|
void |
put(int xOffset,
int yOffset,
int[][] indices,
ArrayList<com.badlogic.gdx.graphics.Color> palette) |
void |
put(int x,
int y,
int index,
ArrayList<com.badlogic.gdx.graphics.Color> palette) |
void |
put(int x,
int y,
int c,
com.badlogic.gdx.graphics.Color color) |
void |
put(int xOffset,
int yOffset,
String string)
Puts the given string horizontally with the first character at the given offset.
|
void |
put(int xOffset,
int yOffset,
String string,
com.badlogic.gdx.graphics.Color foreground) |
void |
put(int xOffset,
int yOffset,
String string,
com.badlogic.gdx.graphics.Color foreground,
boolean vertical)
Puts the given string horizontally with the first character at the given offset.
|
void |
recallActor(com.badlogic.gdx.scenes.scene2d.Actor a) |
void |
recallActor(AnimatedEntity ae) |
void |
refresh() |
void |
setDefaultForeground(com.badlogic.gdx.graphics.Color defaultForeground) |
void |
slide(AnimatedEntity ae,
int newX,
int newY,
float duration)
Start a movement animation for the object at the grid location x, y and moves it to newX, newY over a number of
seconds given by duration (often 0.12f or somewhere around there).
|
void |
slide(squidpony.squidmath.Coord start,
squidpony.squidmath.Coord end)
Starts a movement animation for the object at the given grid location at the default speed.
|
void |
slide(squidpony.squidmath.Coord start,
squidpony.squidmath.Coord end,
float duration)
Starts a sliding movement animation for the object at the given location at the provided speed.
|
void |
slide(squidpony.squidmath.Coord start,
squidpony.squidgrid.Direction direction)
Starts a movement animation for the object at the given grid location at the default speed for one grid square in
the direction provided.
|
void |
slide(int x,
int y,
int newX,
int newY,
float duration)
Start a movement animation for the object at the grid location x, y and moves it to newX, newY over a number of
seconds given by duration (often 0.12f or somewhere around there).
|
void |
tint(AnimatedEntity ae,
com.badlogic.gdx.graphics.Color color,
float duration)
Starts an wiggling animation for the object at the given location for the given duration in seconds.
|
void |
tint(int x,
int y,
com.badlogic.gdx.graphics.Color color,
float duration)
Starts an wiggling animation for the object at the given location for the given duration in seconds.
|
void |
wiggle(AnimatedEntity ae,
float duration)
Starts an wiggling animation for the object at the given location for the given duration in seconds.
|
void |
wiggle(int x,
int y,
float duration)
Starts an wiggling animation for the object at the given location for the given duration in seconds.
|
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, toStringaddAction, addCaptureListener, addListener, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebugBounds, fire, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasParent, isAscendantOf, isDescendantOf, isTouchable, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, scaleBy, scaleBy, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setY, setZIndex, sizeBy, sizeBy, sizeChanged, stageToLocalCoordinates, toBack, toFrontpublic float DEFAULT_ANIMATION_DURATION
public SquidPanel(int gridWidth, int gridHeight)
gridWidth - the number of cells horizontallygridHeight - the number of cells verticallypublic SquidPanel(int gridWidth, int gridHeight, int cellWidth, int cellHeight)
gridWidth - the number of cells horizontallygridHeight - the number of cells verticallycellWidth - the number of horizontal pixels in each cellcellHeight - the number of vertical pixels in each cellpublic SquidPanel(int gridWidth, int gridHeight, TextCellFactory factory)
gridWidth - the number of cells horizontallygridHeight - the number of cells verticallyfactory - the factory to use for cell renderingpublic void put(char[][] chars)
chars - public void put(char[][] chars, com.badlogic.gdx.graphics.Color[][] foregrounds)
put in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>public void put(char[][] chars, int[][] indices, ArrayList<com.badlogic.gdx.graphics.Color> palette)
public void put(int xOffset, int yOffset, char[][] chars)
public void put(int xOffset, int yOffset, char[][] chars, com.badlogic.gdx.graphics.Color[][] foregrounds)
public void put(int xOffset, int yOffset, char[][] chars, int[][] indices, ArrayList<com.badlogic.gdx.graphics.Color> palette)
public void put(int xOffset, int yOffset, com.badlogic.gdx.graphics.Color[][] foregrounds)
public void put(int xOffset, int yOffset, int[][] indices, ArrayList<com.badlogic.gdx.graphics.Color> palette)
public void put(int xOffset, int yOffset, char[][] chars, com.badlogic.gdx.graphics.Color foreground)
public void put(int xOffset, int yOffset, String string)
xOffset - the x coordinate of the first characteryOffset - the y coordinate of the first characterstring - the characters to be displayedpublic void put(int xOffset, int yOffset, squidpony.panel.IColoredString<? extends com.badlogic.gdx.graphics.Color> cs)
put in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>public void put(int xOffset, int yOffset, String string, com.badlogic.gdx.graphics.Color foreground)
put in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>public void placeVerticalString(int xOffset, int yOffset, String string, boolean vertical)
xOffset - the x coordinate of the first characteryOffset - the y coordinate of the first characterstring - the characters to be displayedvertical - true if the text should be written vertically, from top to bottompublic void put(int xOffset, int yOffset, String string, com.badlogic.gdx.graphics.Color foreground, boolean vertical)
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 charactersvertical - true if the text should be written vertically, from top to bottompublic void erase()
public void clear(int x, int y)
clear in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>public void put(int x, int y, com.badlogic.gdx.graphics.Color color)
put in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>public void put(int x, int y, char c)
put in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>public void put(int x, int y, int code)
x - y - code - public void put(int x, int y, int c, com.badlogic.gdx.graphics.Color color)
public void put(int x, int y, char c, int index, ArrayList<com.badlogic.gdx.graphics.Color> palette)
public void put(int x, int y, char c, com.badlogic.gdx.graphics.Color color)
put in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>x - y - c - color - public int cellWidth()
public int cellHeight()
public int gridHeight()
gridHeight in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>public int gridWidth()
gridWidth in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
draw in class com.badlogic.gdx.scenes.scene2d.Grouppublic void drawActor(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha, AnimatedEntity ae)
batch - Must have start() called already but not stop() yet during this frame.parentAlpha - This can be assumed to be 1.0f if you don't know itae - The AnimatedEntity to draw; the position to draw ae is stored inside it.public void setDefaultForeground(com.badlogic.gdx.graphics.Color defaultForeground)
setDefaultForeground in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>public com.badlogic.gdx.graphics.Color getDefaultForegroundColor()
getDefaultForegroundColor in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>public AnimatedEntity getAnimatedEntityByCell(int x, int y)
public AnimatedEntity animateActor(int x, int y, char c, com.badlogic.gdx.graphics.Color color)
x - y - c - color - public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, char c, com.badlogic.gdx.graphics.Color color)
x - y - doubleWidth - c - color - public AnimatedEntity animateActor(int x, int y, String s, com.badlogic.gdx.graphics.Color color)
x - y - s - color - public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, String s, com.badlogic.gdx.graphics.Color color)
x - y - doubleWidth - s - color - public AnimatedEntity animateActor(int x, int y, char c, int index, ArrayList<com.badlogic.gdx.graphics.Color> palette)
x - y - c - index - palette - public AnimatedEntity animateActor(int x, int y, String s, int index, ArrayList<com.badlogic.gdx.graphics.Color> palette)
x - y - s - index - palette - public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion texture)
x - y - texture - public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion texture, com.badlogic.gdx.graphics.Color color)
x - y - texture - color - public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, com.badlogic.gdx.graphics.g2d.TextureRegion texture)
x - y - doubleWidth - texture - public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, com.badlogic.gdx.graphics.g2d.TextureRegion texture, com.badlogic.gdx.graphics.Color color)
x - y - doubleWidth - texture - color - public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, boolean stretch, com.badlogic.gdx.graphics.g2d.TextureRegion texture)
x - y - doubleWidth - stretch - texture - public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, boolean stretch, com.badlogic.gdx.graphics.g2d.TextureRegion texture, com.badlogic.gdx.graphics.Color color)
x - y - doubleWidth - stretch - texture - color - public com.badlogic.gdx.scenes.scene2d.Actor cellToActor(int x, int y)
x - y - public com.badlogic.gdx.scenes.scene2d.Actor cellToActor(int x, int y, boolean doubleWidth)
x - y - doubleWidth - public void recallActor(com.badlogic.gdx.scenes.scene2d.Actor a)
public void recallActor(AnimatedEntity ae)
public void bump(AnimatedEntity ae, squidpony.squidgrid.Direction direction, float duration)
ae - an AnimatedEntity returned by animateActor()direction - duration - a float, measured in seconds, for how long the animation should last; commonly 0.12fpublic void bump(int x, int y, squidpony.squidgrid.Direction direction, float duration)
x - y - direction - duration - a float, measured in seconds, for how long the animation should last; commonly 0.12fpublic void bump(int x, int y, squidpony.squidgrid.Direction direction)
x - y - direction - public void bump(squidpony.squidmath.Coord location, squidpony.squidgrid.Direction direction)
location - direction - public void slide(AnimatedEntity ae, int newX, int newY, float duration)
ae - an AnimatedEntity returned by animateActor()newX - newY - duration - public void slide(int x, int y, int newX, int newY, float duration)
x - y - newX - newY - duration - public void slide(squidpony.squidmath.Coord start, squidpony.squidmath.Coord end)
start - end - public void slide(squidpony.squidmath.Coord start, squidpony.squidgrid.Direction direction)
start - direction - public void slide(squidpony.squidmath.Coord start, squidpony.squidmath.Coord end, float duration)
start - end - duration - public void wiggle(AnimatedEntity ae, float duration)
ae - an AnimatedEntity returned by animateActor()duration - public void wiggle(int x, int y, float duration)
x - y - duration - public void tint(AnimatedEntity ae, com.badlogic.gdx.graphics.Color color, float duration)
ae - an AnimatedEntity returned by animateActor()color - duration - public void tint(int x, int y, com.badlogic.gdx.graphics.Color color, float duration)
x - y - color - duration - public boolean hasActiveAnimations()
public LinkedHashSet<AnimatedEntity> getAnimatedEntities()
public void refresh()
refresh in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>public squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color> getBacker()
getBacker in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>Copyright © 2012–2015. All rights reserved.