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 |
---|---|
protected LinkedHashSet<AnimatedEntity> |
animatedEntities |
protected int |
animationCount |
protected int |
cellHeight |
protected int |
cellWidth |
protected com.badlogic.gdx.graphics.Color[][] |
colors |
protected String[][] |
contents |
float |
DEFAULT_ANIMATION_DURATION |
protected com.badlogic.gdx.graphics.Color |
defaultForeground |
protected boolean |
distanceField |
protected int |
gridHeight |
protected int |
gridOffsetX |
protected int |
gridOffsetY |
protected int |
gridWidth |
protected com.badlogic.gdx.graphics.Color |
lightingColor |
protected squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> |
scc |
protected TextCellFactory |
textFactory |
protected float |
xOffset |
protected float |
yOffset |
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.
|
SquidPanel(int gridWidth,
int gridHeight,
TextCellFactory factory,
squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> center)
Builds a panel with the given grid size and all other parameters determined by the factory.
|
SquidPanel(int gridWidth,
int gridHeight,
TextCellFactory factory,
squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> center,
float xOffset,
float yOffset)
Builds a panel with the given grid size and all other parameters determined by the factory.
|
Modifier and Type | Method and Description |
---|---|
float |
adjustX(float x,
boolean doubleWidth) |
float |
adjustY(float y) |
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,
Collection<com.badlogic.gdx.graphics.Color> colors)
Create an AnimatedEntity at position x, y, using the String s in the given color.
|
AnimatedEntity |
animateActor(int x,
int y,
boolean doubleWidth,
String s,
Collection<com.badlogic.gdx.graphics.Color> colors,
float loopTime)
Create an AnimatedEntity at position x, y, using the String s 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() |
protected float |
clampDuration(float duration) |
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.
|
void |
fade(int x,
int y,
com.badlogic.gdx.graphics.Color color,
float duration)
Fade the cell at
(x,y) to color . |
LinkedHashSet<AnimatedEntity> |
getAnimatedEntities() |
AnimatedEntity |
getAnimatedEntityByCell(int x,
int y) |
String |
getAt(int x,
int y) |
squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color> |
getBacker() |
com.badlogic.gdx.graphics.Color |
getColorAt(int x,
int y) |
squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> |
getColorCenter() |
com.badlogic.gdx.graphics.Color |
getDefaultForegroundColor() |
int |
getGridHeight()
The number of cells along the y-axis that will be rendered of this panel
|
int |
getGridOffsetX()
The X offset that the whole panel's internals will be rendered at.
|
int |
getGridOffsetY()
The Y offset that the whole panel's internals will be rendered at.
|
int |
getGridWidth()
The number of cells along the x-axis that will be rendered of this panel.
|
com.badlogic.gdx.graphics.Color |
getLightingColor() |
TextCellFactory |
getTextCellFactory() |
float |
getxOffset() |
float |
getyOffset() |
int |
gridHeight() |
int |
gridWidth() |
boolean |
hasActiveAnimations() |
void |
placeVerticalString(int xOffset,
int yOffset,
String string,
boolean vertical)
Puts the given string horizontally or optionally vertically, 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,
com.badlogic.gdx.graphics.Color foreground,
float colorMultiplier) |
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,
com.badlogic.gdx.graphics.Color color,
float colorMultiplier) |
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 x,
int y,
com.badlogic.gdx.graphics.Color color,
float colorMultiplier) |
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 or optionally vertically, with the first character at the given offset.
|
void |
put(int xOffset,
int yOffset,
String string,
com.badlogic.gdx.graphics.Color foreground,
float colorMultiplier) |
void |
recallActor(com.badlogic.gdx.scenes.scene2d.Actor a) |
void |
recallActor(AnimatedEntity ae) |
void |
removeAnimatedEntity(AnimatedEntity ae) |
SquidPanel |
setColorCenter(squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> scc)
Use this method if you use your own
IColorCenter and want this
panel not to allocate its own colors (or fill
DefaultResources.getSCC() but instead to the provided center. |
void |
setDefaultForeground(com.badlogic.gdx.graphics.Color defaultForeground) |
void |
setGridHeight(int gridHeight)
Sets the number of cells along the y-axis that will be rendered of this panel to gridHeight.
|
void |
setGridOffsetX(int gridOffsetX)
Sets the X offset that the whole panel's internals will be rendered at.
|
void |
setGridOffsetY(int gridOffsetY)
Sets the Y offset that the whole panel's internals will be rendered at.
|
void |
setGridWidth(int gridWidth)
Sets the number of cells along the x-axis that will be rendered of this panel to gridWidth.
|
void |
setLightingColor(com.badlogic.gdx.graphics.Color lightingColor) |
void |
setOffsets(float x,
float y) |
void |
setOffsetX(float xOffset) |
void |
setOffsetY(float yOffset) |
void |
setPosition(float x,
float y)
Sets the position of the actor's bottom left corner.
|
SquidPanel |
setTextSize(int wide,
int high)
Sets the size of the text in this SquidPanel (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).
|
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 a tint animation for
ae for the given duration in seconds. |
void |
tint(float delay,
int x,
int y,
com.badlogic.gdx.graphics.Color color,
float duration)
Like
tint(int, int, Color, float) , but waits for delay
(in seconds) before performing it. |
void |
tint(int x,
int y,
com.badlogic.gdx.graphics.Color color,
float duration)
Starts a tint animation for the object at
(x,y) 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, toString
addAction, 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, 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
public float DEFAULT_ANIMATION_DURATION
protected int animationCount
protected com.badlogic.gdx.graphics.Color defaultForeground
protected squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> scc
protected final int cellWidth
protected final int cellHeight
protected int gridWidth
protected int gridHeight
protected int gridOffsetX
protected int gridOffsetY
protected final com.badlogic.gdx.graphics.Color[][] colors
protected com.badlogic.gdx.graphics.Color lightingColor
protected final TextCellFactory textFactory
protected float xOffset
protected float yOffset
protected LinkedHashSet<AnimatedEntity> animatedEntities
protected boolean distanceField
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 SquidPanel(int gridWidth, int gridHeight, TextCellFactory factory, squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> center)
gridWidth
- the number of cells horizontallygridHeight
- the number of cells verticallyfactory
- the factory to use for cell renderingcenter
- The color center to use. Can be null
, but then must be set later on with
setColorCenter(IColorCenter)
.public SquidPanel(int gridWidth, int gridHeight, TextCellFactory factory, squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> center, float xOffset, float yOffset)
gridWidth
- the number of cells horizontallygridHeight
- the number of cells verticallyfactory
- the factory to use for cell renderingcenter
- The color center to use. Can be null
, but then must be set later on with
setColorCenter(IColorCenter)
.public 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 put(int xOffset, int yOffset, String string, com.badlogic.gdx.graphics.Color foreground, float colorMultiplier)
public void put(int xOffset, int yOffset, char[][] chars, com.badlogic.gdx.graphics.Color foreground, float colorMultiplier)
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, com.badlogic.gdx.graphics.Color color, float colorMultiplier)
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 void put(int x, int y, char c, com.badlogic.gdx.graphics.Color color, float colorMultiplier)
UnsupportedOperationException
- If the backing IColorCenter
isn't an instance of
SquidColorCenter
.public int cellWidth()
cellWidth
in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>
public int cellHeight()
cellHeight
in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>
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 TextCellFactory getTextCellFactory()
TextCellFactory
backing this
.public SquidPanel setTextSize(int wide, int high)
wide
- the width of a glyph in pixelshigh
- the height of a glyph in pixelspublic 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)
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, boolean doubleWidth, String s, Collection<com.badlogic.gdx.graphics.Color> colors)
x
- y
- doubleWidth
- s
- colors
- public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, String s, Collection<com.badlogic.gdx.graphics.Color> colors, float loopTime)
x
- y
- doubleWidth
- s
- colors
- loopTime
- 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 float adjustX(float x, boolean doubleWidth)
public float adjustY(float y)
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
for the given duration
in seconds.ae
- an AnimatedEntity returned by animateActor()color
- duration
- public void tint(float delay, int x, int y, com.badlogic.gdx.graphics.Color color, float duration)
tint(int, int, Color, float)
, but waits for delay
(in seconds) before performing it.public final void tint(int x, int y, com.badlogic.gdx.graphics.Color color, float duration)
(x,y)
for the given
duration
(in seconds).public void fade(int x, int y, com.badlogic.gdx.graphics.Color color, float duration)
(x,y)
to color
. Contrary to
tint(int, int, Color, float)
, this action does not restore the
cell's color at the end of its execution. This is for example useful to
fade the game screen when the rogue dies.x
- y
- color
- The color at the end of the fadeout.duration
- The fadeout's duration.public boolean hasActiveAnimations()
hasActiveAnimations
in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>
public LinkedHashSet<AnimatedEntity> getAnimatedEntities()
public void removeAnimatedEntity(AnimatedEntity ae)
public squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color> getBacker()
getBacker
in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>
public squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> getColorCenter()
null
.public SquidPanel setColorCenter(squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> scc)
IColorCenter
and want this
panel not to allocate its own colors (or fill
DefaultResources.getSCC()
but instead to the provided center.setColorCenter
in interface squidpony.panel.ISquidPanel<com.badlogic.gdx.graphics.Color>
scc
- The color center to use. Should not be null
.this
NullPointerException
- If scc
is null
.public com.badlogic.gdx.graphics.Color getColorAt(int x, int y)
public com.badlogic.gdx.graphics.Color getLightingColor()
public void setLightingColor(com.badlogic.gdx.graphics.Color lightingColor)
protected float clampDuration(float duration)
public int getGridOffsetX()
public void setGridOffsetX(int gridOffsetX)
gridOffsetX
- the requested offset in cells; should be less than gridWidthpublic int getGridOffsetY()
public void setGridOffsetY(int gridOffsetY)
gridOffsetY
- the requested offset in cells; should be less than gridHeightpublic int getGridWidth()
public void setGridWidth(int gridWidth)
gridWidth
- the requested width in cellspublic int getGridHeight()
public void setGridHeight(int gridHeight)
gridHeight
- the requested height in cellspublic void setPosition(float x, float y)
setPosition
in class com.badlogic.gdx.scenes.scene2d.Actor
x
- y
- public float getxOffset()
public void setOffsetX(float xOffset)
public float getyOffset()
public void setOffsetY(float yOffset)
public void setOffsets(float x, float y)
Copyright © 2012–2016. All rights reserved.