public class ImageSquidPanel extends SquidPanel
Modifier and Type | Field and Description |
---|---|
com.badlogic.gdx.utils.IntMap<com.badlogic.gdx.graphics.g2d.TextureRegion> |
imageMap |
animatedEntities, animationCount, autoActors, cellHeight, cellWidth, colors, contents, DEFAULT_ANIMATION_DURATION, defaultForeground, gridHeight, gridOffsetX, gridOffsetY, gridWidth, lightingColor, lightingFloat, onlyRenderEven, scc, textFactory, tmpColor, xOffset, yOffset
Constructor and Description |
---|
ImageSquidPanel(int gridWidth,
int gridHeight)
Creates a bare-bones panel with all default values for text rendering.
|
ImageSquidPanel(int gridWidth,
int gridHeight,
int cellWidth,
int cellHeight)
Creates a panel with the given grid and cell size.
|
ImageSquidPanel(int gridWidth,
int gridHeight,
TextCellFactory factory)
Builds a panel with the given grid size and all other parameters determined by the factory.
|
ImageSquidPanel(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.
|
ImageSquidPanel(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.
|
ImageSquidPanel(int gridWidth,
int gridHeight,
TextCellFactory factory,
squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> center,
float xOffset,
float yOffset,
char[][] actualMap)
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,
java.util.Collection<com.badlogic.gdx.graphics.Color> colors)
Create an AnimatedEntity at position x, y, using the char c in the given colors to cycle through.
|
AnimatedEntity |
animateActor(int x,
int y,
boolean doubleWidth,
char c,
java.util.Collection<com.badlogic.gdx.graphics.Color> colors,
float loopTime)
Create an AnimatedEntity at position x, y, using the char c in the given colors to cycle through.
|
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,
java.lang.String s,
java.util.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,
java.lang.String s,
java.util.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,
java.lang.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,
java.util.Collection<com.badlogic.gdx.graphics.Color> colors)
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,
boolean doubleWidth,
com.badlogic.gdx.graphics.g2d.TextureRegion texture,
java.util.Collection<com.badlogic.gdx.graphics.Color> colors,
float loopTime)
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,
boolean doubleWidth,
com.badlogic.gdx.graphics.g2d.TextureRegion texture,
java.util.Collection<com.badlogic.gdx.graphics.Color> colors,
float loopTime,
java.lang.String name)
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,
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,
boolean doubleWidth,
com.badlogic.gdx.graphics.g2d.TextureRegion texture,
com.badlogic.gdx.graphics.Color color,
java.lang.String name)
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,
java.util.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,
java.lang.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,
java.lang.String s,
int index,
java.util.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.
|
AnimatedEntity |
directionMarker(int x,
int y,
boolean doubleWidth,
java.util.Collection<com.badlogic.gdx.graphics.Color> colors,
float loopTime)
Create an AnimatedEntity at position x, y, using '^' as its contents, but as an image so it can be rotated.
|
AnimatedEntity |
directionMarker(int x,
int y,
boolean doubleWidth,
com.badlogic.gdx.graphics.Color color) |
void |
draw(com.badlogic.gdx.graphics.g2d.Batch batch,
float parentAlpha)
Draws this ImageSquidPanel and any
SquidPanel.autoActors it has, and calls Actor.act(float) for each
AnimatedEntity this contains in SquidPanel.animatedEntities or SquidPanel.autoActors . |
void |
drawActor(com.badlogic.gdx.graphics.g2d.Batch batch,
float parentAlpha,
com.badlogic.gdx.scenes.scene2d.Actor ac)
Draws one AnimatedEntity, specifically the Actor it contains.
|
void |
drawActor(com.badlogic.gdx.graphics.g2d.Batch batch,
float parentAlpha,
AnimatedEntity ae)
Draws one AnimatedEntity, specifically the Actor it contains.
|
AnimatedEntity |
getAnimatedEntityByCell(int x,
int y) |
com.badlogic.gdx.graphics.Color |
getDefaultForegroundColor() |
com.badlogic.gdx.graphics.g2d.TextureRegion |
getImageSwap(char toFind)
If there is a TextureRegion that would replace the char toFind when drawn, this will return that TextureRegion,
otherwise it returns null.
|
java.lang.StringBuilder |
getSnapshot()
Gets a "snapshot" of the data represented by this ImageSquidPanel; stores the dimensions, the char data, and the
color data in a way that can be set back to a SquidPanel or ImageSquidPanel using
setFromSnapshot(String, int, int, int, int) or its overload that takes a StringBuilder. |
java.lang.StringBuilder |
getSnapshot(int startX,
int startY,
int width,
int height)
Gets a "snapshot" of the data represented by this ImageSquidPanel; stores the dimensions, the char data, and the
color data in a way that can be set back to a SquidPanel or ImageSquidPanel using
setFromSnapshot(String, int, int, int, int) or its overload that takes a StringBuilder. |
static char |
getUnusedChar(char initial)
Meant for taking easy-to-write chars and generating chars that can map to images, while still allowing the
original easy-to-write char to be used as its own non-image char.
|
void |
removeImageSwap(char toRemove)
Removes the char toRemove from the mapping of chars to replace with images, or does nothing if this did not
already replace toRemove with an image.
|
void |
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)
Sets the default foreground color.
|
ImageSquidPanel |
setFromSnapshot(java.lang.String snapshot)
Given a "snapshot" from
getSnapshot(int, int, int, int) , this assigns the chars and colors in this
ImageSquidPanel from 0,0 (inclusive) up to the dimensions stored in the snapshot to match the snapshot's data. |
ImageSquidPanel |
setFromSnapshot(java.lang.StringBuilder snapshot)
Given a "snapshot" from
getSnapshot(int, int, int, int) , this assigns the chars and colors in this
ImageSquidPanel from 0,0 (inclusive) up to the dimensions stored in the snapshot to match the snapshot's data. |
ImageSquidPanel |
setFromSnapshot(java.lang.StringBuilder snapshot,
int putX,
int putY)
Given a "snapshot" from
getSnapshot(int, int, int, int) , this assigns the chars and colors in this
ImageSquidPanel from the position given by putX,putY (inclusive) up to the dimensions stored in the snapshot
(considering putX and putY as offsets) so they have the values stored in the snapshot. |
ImageSquidPanel |
setFromSnapshot(java.lang.StringBuilder snapshot,
int putX,
int putY,
int limitWidth,
int limitHeight)
Given a "snapshot" from
getSnapshot(int, int, int, int) , this assigns the chars and colors in this
ImageSquidPanel from the position given by putX,putY (inclusive) to putX+limitWidth,putY+limitHeight (exclusive)
so they have the values stored in the snapshot. |
ImageSquidPanel |
setFromSnapshot(java.lang.String snapshot,
int putX,
int putY)
Given a "snapshot" from
getSnapshot(int, int, int, int) , this assigns the chars and colors in this
ImageSquidPanel from the position given by putX,putY (inclusive) up to the dimensions stored in the snapshot
(considering putX and putY as offsets) so they have the values stored in the snapshot. |
ImageSquidPanel |
setFromSnapshot(java.lang.String snapshot,
int putX,
int putY,
int limitWidth,
int limitHeight)
Given a "snapshot" from
getSnapshot(int, int, int, int) , this assigns the chars and colors in this
ImageSquidPanel from the position given by putX,putY (inclusive) to putX+limitWidth,putY+limitHeight (exclusive)
so they have the values stored in the snapshot. |
void |
setImageSwap(char swapOut,
com.badlogic.gdx.graphics.g2d.TextureRegion swapIn)
Makes it so when the char swapOut would be drawn, the TextureRegion swapIn is drawn instead.
|
adjustX, adjustY, blend, bump, bump, bump, bump, burst, burst, burst, burst, burst, burst, burst, cellHeight, cellToActor, cellToActor, cellWidth, clampDuration, clear, createActor, createActor, erase, fade, fixPosition, fixPositions, getAnimatedEntities, getAt, getColorAt, getColorCenter, getGridHeight, getGridOffsetX, getGridOffsetY, getGridWidth, getLightingColor, getOnlyRenderEven, getTextCellFactory, getTotalHeight, getTotalWidth, getxOffset, getyOffset, gridHeight, gridWidth, hasActiveAnimations, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, putBorders, putBorders, putBorders, putBorders, putBorders, putBordersCaptioned, putBordersCaptioned, recallActor, recallActor, recallActor, recallActor, recallActor, removeAnimatedEntity, setGridHeight, setGridOffsetX, setGridOffsetY, setGridWidth, setLightingColor, setOffsets, setOffsetX, setOffsetY, setOnlyRenderEven, setPosition, setTextSize, slide, slide, slide, slide, slide, slide, slide, summon, summon, summon, summon, summon, summon, tint, tint, tint, tint, wiggle, wiggle, worldX, worldY
act, addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, applyTransform, childrenChanged, clear, clear, clearChildren, clearChildren, computeTransform, debugAll, drawChildren, drawDebug, drawDebugChildren, findActor, getChild, getChildren, getCullingArea, hasChildren, hit, isTransform, localToDescendantCoordinates, removeActor, removeActor, removeActorAt, resetTransform, resetTransform, setCullingArea, setDebug, setStage, setTransform, swapActor, swapActor, toString
addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebugBounds, fire, firstAscendant, 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, hasKeyboardFocus, hasParent, hasScrollFocus, isAscendantOf, isDescendantOf, isTouchable, isTouchFocusListener, isTouchFocusTarget, isVisible, localToActorCoordinates, localToAscendantCoordinates, localToParentCoordinates, localToScreenCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, scaleChanged, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, sizeChanged, stageToLocalCoordinates, toBack, toFront
public com.badlogic.gdx.utils.IntMap<com.badlogic.gdx.graphics.g2d.TextureRegion> imageMap
public ImageSquidPanel(int gridWidth, int gridHeight)
gridWidth
- the number of cells horizontallygridHeight
- the number of cells verticallypublic ImageSquidPanel(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 ImageSquidPanel(int gridWidth, int gridHeight, TextCellFactory factory)
gridWidth
- the number of cells horizontallygridHeight
- the number of cells verticallyfactory
- the factory to use for cell renderingpublic ImageSquidPanel(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
SquidPanel.setColorCenter(IColorCenter)
.public ImageSquidPanel(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
SquidPanel.setColorCenter(IColorCenter)
.public ImageSquidPanel(int gridWidth, int gridHeight, TextCellFactory factory, squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> center, float xOffset, float yOffset, char[][] actualMap)
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
SquidPanel.setColorCenter(IColorCenter)
.xOffset
- the x offset to start rendering at, in pixels (or some other sub-cell measurement your game uses)yOffset
- the y offset to start rendering at, in pixels (or some other sub-cell measurement your game uses)actualMap
- will often be a different size than gridWidth by gridHeight, which enables camera scrollingpublic void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
SquidPanel.autoActors
it has, and calls Actor.act(float)
for each
AnimatedEntity this contains in SquidPanel.animatedEntities
or SquidPanel.autoActors
.
batch
if using a distance field or MSDF font and the shader is currently not
configured for such a font; it does not reset the shader to the default so that multiple Actors can all use the
same shader and so specific extra glyphs or other items can be rendered after calling draw(). If you need to draw
both a distance field font and full-color art, you should set the shader on the Batch to null when you want to
draw full-color art, and end the Batch between drawing this object and the other art.draw
in class SquidPanel
batch
- a Batch such as a FilterBatch
that must be between a begin() and end() call; usually done by StageparentAlpha
- only used when drawing children of this ImageSquidPanelpublic void drawActor(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha, AnimatedEntity ae)
drawActor
in class SquidPanel
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 drawActor(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha, com.badlogic.gdx.scenes.scene2d.Actor ac)
drawActor
in class SquidPanel
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 itac
- The Actor to draw; the position to draw ac is modified and reset based on some fields of this objectpublic void setDefaultForeground(com.badlogic.gdx.graphics.Color defaultForeground)
IPackedColorPanel
setDefaultForeground
in interface IPackedColorPanel
setDefaultForeground
in class SquidPanel
public com.badlogic.gdx.graphics.Color getDefaultForegroundColor()
getDefaultForegroundColor
in interface IPackedColorPanel
getDefaultForegroundColor
in class SquidPanel
IPackedColorPanel.setDefaultForeground(Color)
), or the last color set
with IPackedColorPanel.setDefaultForeground(Color)
. Cannot be
null
.public AnimatedEntity getAnimatedEntityByCell(int x, int y)
getAnimatedEntityByCell
in class SquidPanel
public AnimatedEntity animateActor(int x, int y, char c, com.badlogic.gdx.graphics.Color color)
animateActor
in class SquidPanel
x
- y
- c
- color
- public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, char c, com.badlogic.gdx.graphics.Color color)
animateActor
in class SquidPanel
x
- y
- doubleWidth
- c
- color
- public AnimatedEntity animateActor(int x, int y, java.lang.String s, com.badlogic.gdx.graphics.Color color)
animateActor
in class SquidPanel
x
- y
- s
- color
- public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, java.lang.String s, com.badlogic.gdx.graphics.Color color)
animateActor
in class SquidPanel
x
- y
- doubleWidth
- s
- color
- public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, java.lang.String s, java.util.Collection<com.badlogic.gdx.graphics.Color> colors)
animateActor
in class SquidPanel
x
- y
- doubleWidth
- s
- colors
- public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, java.lang.String s, java.util.Collection<com.badlogic.gdx.graphics.Color> colors, float loopTime)
animateActor
in class SquidPanel
x
- y
- doubleWidth
- s
- colors
- loopTime
- public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, char c, java.util.Collection<com.badlogic.gdx.graphics.Color> colors)
x
- y
- doubleWidth
- c
- colors
- public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, char c, java.util.Collection<com.badlogic.gdx.graphics.Color> colors, float loopTime)
x
- y
- doubleWidth
- c
- colors
- loopTime
- public AnimatedEntity directionMarker(int x, int y, boolean doubleWidth, java.util.Collection<com.badlogic.gdx.graphics.Color> colors, float loopTime)
directionMarker
in class SquidPanel
x
- y
- doubleWidth
- colors
- loopTime
- public AnimatedEntity directionMarker(int x, int y, boolean doubleWidth, com.badlogic.gdx.graphics.Color color)
directionMarker
in class SquidPanel
public AnimatedEntity animateActor(int x, int y, char c, int index, java.util.ArrayList<com.badlogic.gdx.graphics.Color> palette)
x
- y
- c
- index
- palette
- public AnimatedEntity animateActor(int x, int y, java.lang.String s, int index, java.util.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)
animateActor
in class SquidPanel
x
- y
- texture
- public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion texture, com.badlogic.gdx.graphics.Color color)
animateActor
in class SquidPanel
x
- y
- texture
- color
- public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, com.badlogic.gdx.graphics.g2d.TextureRegion texture)
animateActor
in class SquidPanel
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)
animateActor
in class SquidPanel
x
- y
- doubleWidth
- texture
- color
- public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, com.badlogic.gdx.graphics.g2d.TextureRegion texture, com.badlogic.gdx.graphics.Color color, java.lang.String name)
x
- y
- doubleWidth
- texture
- color
- public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, com.badlogic.gdx.graphics.g2d.TextureRegion texture, java.util.Collection<com.badlogic.gdx.graphics.Color> colors)
animateActor
in class SquidPanel
x
- y
- doubleWidth
- texture
- colors
- public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, com.badlogic.gdx.graphics.g2d.TextureRegion texture, java.util.Collection<com.badlogic.gdx.graphics.Color> colors, float loopTime)
animateActor
in class SquidPanel
x
- y
- doubleWidth
- texture
- colors
- public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, com.badlogic.gdx.graphics.g2d.TextureRegion texture, java.util.Collection<com.badlogic.gdx.graphics.Color> colors, float loopTime, java.lang.String name)
x
- y
- doubleWidth
- texture
- colors
- public AnimatedEntity animateActor(int x, int y, boolean doubleWidth, boolean stretch, com.badlogic.gdx.graphics.g2d.TextureRegion texture)
animateActor
in class SquidPanel
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)
animateActor
in class SquidPanel
x
- y
- doubleWidth
- stretch
- texture
- color
- public void 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 class SquidPanel
scc
- The color center to use. Should not be null
.java.lang.NullPointerException
- If scc
is null
.public java.lang.StringBuilder getSnapshot()
setFromSnapshot(String, int, int, int, int)
or its overload that takes a StringBuilder. The actual
contents of the returned StringBuilder are unlikely to be legible in any way if read as text, and are meant to be
concise and stable across versions.
getSnapshot
in class SquidPanel
setFromSnapshot(StringBuilder, int, int, int, int)
or converted to String and passed to its overloadpublic java.lang.StringBuilder getSnapshot(int startX, int startY, int width, int height)
setFromSnapshot(String, int, int, int, int)
or its overload that takes a StringBuilder. The actual
contents of the returned StringBuilder are unlikely to be legible in any way if read as text, and are meant to be
concise and stable across versions. This overload allows the first x and y position used to be specified, as well
as the width and height to use (the actual width and height stored may be different if this SquidPanel's
gridWidth and/or gridHeight are smaller than the width and/or height given).
getSnapshot
in class SquidPanel
startX
- the first x position to use in the snapshot, inclusivestartY
- the first y position to use in the snapshot, inclusivewidth
- how wide the snapshot area should be; x positions from startX to startX + width - 1 will be usedheight
- how tall the snapshot area should be; y positions from startY to startY + height - 1 will be usedsetFromSnapshot(StringBuilder, int, int, int, int)
or converted to String and passed to its overloadpublic ImageSquidPanel setFromSnapshot(java.lang.StringBuilder snapshot)
getSnapshot(int, int, int, int)
, this assigns the chars and colors in this
ImageSquidPanel from 0,0 (inclusive) up to the dimensions stored in the snapshot to match the snapshot's data.setFromSnapshot
in class SquidPanel
snapshot
- a StringBuilder in a special format as produced by getSnapshot(int, int, int, int)
public ImageSquidPanel setFromSnapshot(java.lang.StringBuilder snapshot, int putX, int putY)
getSnapshot(int, int, int, int)
, this assigns the chars and colors in this
ImageSquidPanel from the position given by putX,putY (inclusive) up to the dimensions stored in the snapshot
(considering putX and putY as offsets) so they have the values stored in the snapshot.setFromSnapshot
in class SquidPanel
snapshot
- a StringBuilder in a special format as produced by getSnapshot(int, int, int, int)
putX
- where to start placing the data from the snapshot, x positionputY
- where to start placing the data from the snapshot, y positionpublic ImageSquidPanel setFromSnapshot(java.lang.StringBuilder snapshot, int putX, int putY, int limitWidth, int limitHeight)
getSnapshot(int, int, int, int)
, this assigns the chars and colors in this
ImageSquidPanel from the position given by putX,putY (inclusive) to putX+limitWidth,putY+limitHeight (exclusive)
so they have the values stored in the snapshot. If limitWidth or limitHeight is negative, this uses the full
width and height of the snapshot (stopping early if it would extend past the gridWidth or gridHeight of this
ImageSquidPanel).setFromSnapshot
in class SquidPanel
snapshot
- a StringBuilder in a special format as produced by getSnapshot(int, int, int, int)
putX
- where to start placing the data from the snapshot, x positionputY
- where to start placing the data from the snapshot, y positionlimitWidth
- if negative, uses all of snapshot's width as possible, otherwise restricts the width allowedlimitHeight
- if negative, uses all of snapshot's height as possible, otherwise restricts the height allowedpublic ImageSquidPanel setFromSnapshot(java.lang.String snapshot)
getSnapshot(int, int, int, int)
, this assigns the chars and colors in this
ImageSquidPanel from 0,0 (inclusive) up to the dimensions stored in the snapshot to match the snapshot's data.
setFromSnapshot
in class SquidPanel
snapshot
- a String in a special format as produced by getSnapshot(int, int, int, int)
public ImageSquidPanel setFromSnapshot(java.lang.String snapshot, int putX, int putY)
getSnapshot(int, int, int, int)
, this assigns the chars and colors in this
ImageSquidPanel from the position given by putX,putY (inclusive) up to the dimensions stored in the snapshot
(considering putX and putY as offsets) so they have the values stored in the snapshot.
setFromSnapshot
in class SquidPanel
snapshot
- a String in a special format as produced by getSnapshot(int, int, int, int)
putX
- where to start placing the data from the snapshot, x positionputY
- where to start placing the data from the snapshot, y positionpublic ImageSquidPanel setFromSnapshot(java.lang.String snapshot, int putX, int putY, int limitWidth, int limitHeight)
getSnapshot(int, int, int, int)
, this assigns the chars and colors in this
ImageSquidPanel from the position given by putX,putY (inclusive) to putX+limitWidth,putY+limitHeight (exclusive)
so they have the values stored in the snapshot. If limitWidth or limitHeight is negative, this uses the full
width and height of the snapshot (stopping early if it would extend past the gridWidth or gridHeight of this
ImageSquidPanel).
setFromSnapshot
in class SquidPanel
snapshot
- a String in a special format as produced by getSnapshot(int, int, int, int)
putX
- where to start placing the data from the snapshot, x positionputY
- where to start placing the data from the snapshot, y positionlimitWidth
- if negative, uses all of snapshot's width as possible, otherwise restricts the width allowedlimitHeight
- if negative, uses all of snapshot's height as possible, otherwise restricts the height allowedpublic void setImageSwap(char swapOut, com.badlogic.gdx.graphics.g2d.TextureRegion swapIn)
removeImageSwap(char)
or directly changing this object's imageMap
.swapOut
- the char to avoid rendering and replace with an imageswapIn
- the image to replace the character withpublic void removeImageSwap(char toRemove)
toRemove
- the char to render as a glyph instead of a texturepublic com.badlogic.gdx.graphics.g2d.TextureRegion getImageSwap(char toFind)
toFind
- the char to find the corresponding TextureRegion that it could be mapped topublic static char getUnusedChar(char initial)
char goblinChar = ImageSquidPanel.getUnusedChar('g');
and then register goblinChar in the image mapping
with myImageSquidPanel.setImageSwap(goblinChar, goblinImage);
, which would allow you to draw 'g' directly
by placing a 'g' with put(), or draw goblinImage by placing either goblinChar or
ImageSquidPanel.getUnusedChar('g')
with put().initial
- a char that ideally should be from the earlier parts of Unicode (before 0x1000 is ideal)Copyright © Eben Howard 2012–2022. All rights reserved.