Package squidpony.squidgrid.gui.gdx
Class SquidLayers
java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
com.badlogic.gdx.scenes.scene2d.Group
squidpony.squidgrid.gui.gdx.SquidLayers
- All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.utils.Cullable
public class SquidLayers extends com.badlogic.gdx.scenes.scene2d.Group
A helper class to make using multiple SquidPanels easier.
Created by Tommy Ettinger on 7/6/2015.
-
Field Summary
Fields Modifier and Type Field 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
int[][]
lightnesses
protected TextCellFactory
textFactory
protected int
width
-
Constructor Summary
Constructors Constructor Description SquidLayers()
Create a new SquidLayers widget with a default stretchable font, 40 cells wide and 40 cells high, and 12x12 pixels for each cell.SquidLayers(int gridWidth, int gridHeight)
Create a new SquidLayers widget with a default stretchable 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 stretchable font (it will adapt to the cellWidth and cellHeight you give it), 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, 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, SquidColorCenter bgColorCenter, SquidColorCenter fgColorCenter)
Create a new SquidLayers widget with a default stretchable font (it will adapt to the cellWidth and cellHeight you give it), the given number of cells for gridWidth and gridHeight, the size in pixels for each cell given by cellWidth and cellHeight, and the given SquidColorCenter instances to affect colors.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.SquidLayers(int gridWidth, int gridHeight, int cellWidth, int cellHeight, TextCellFactory tcf, SquidColorCenter bgColorCenter, SquidColorCenter fgColorCenter, char[][] actualMap)
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, the given SquidColorCenters for background and foreground, and the given 2D char array for an area map that may be sized differently than gridWidth by gridHeight (it is usually larger than gridWidth by gridHeight, which allows camera scrolling across the map). -
Method Summary
Modifier and Type Method Description SquidLayers
addExtraLayer()
Add an extra layer on top of the foreground layer.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, 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, 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, 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)
SquidLayers
autoLight()
Alters the lightnesses that affect the background colors, accepting a parameter for animation frame if rippling water and waving grass usingSeededNoise
are desired.SquidLayers
autoLight(double frame)
Alters the lightnesses that affect the background colors, accepting a parameter for animation frame if rippling water and waving grass usingSeededNoise
are desired.SquidLayers
autoLight(double frame, char deepLiquid, char shallowLiquid)
Alters the lightnesses that affect the background colors, accepting a parameter for animation frame if rippling water and waving grass usingSeededNoise
are desired.SquidLayers
bump(int x, int y, int layer, Direction dir, float duration)
SquidLayers
bump(int x, int y, Direction dir)
SquidLayers
bump(AnimatedEntity ae, int layer, Direction dir, float duration)
SquidLayers
bump(AnimatedEntity ae, Direction dir)
SquidLayers
clear(int x, int y)
Clear one cell at position x, y of its foreground contents.AnimatedEntity
directionMarker(int x, int y, com.badlogic.gdx.graphics.Color color, int layer, boolean doubleWidth)
AnimatedEntity
directionMarker(int x, int y, Collection<com.badlogic.gdx.graphics.Color> colors, float loopTime, int layer, boolean doubleWidth)
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)
OrderedSet<AnimatedEntity>
getAnimatedEntities()
OrderedSet<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 shown area of the map in grid cells.int
getGridOffsetX()
int
getGridOffsetY()
int
getGridWidth()
Width of the shown area of the map in grid cells.float
getHeight()
The pixel height of the entire map as displayed.SquidPanel
getLayer(int layer)
Gets a SquidPanel from this SquidLayers and returns a direct reference.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.TextCellFactory
getTextFactory()
int
getTotalHeight()
int
getTotalWidth()
float
getWidth()
The pixel width of the entire map as displayed.boolean
hasActiveAnimations()
boolean
hasValue(int x, int y)
Very basic check to see if something was rendered at the x,y cell requested; this only checks the foreground.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, com.badlogic.gdx.graphics.Color[][] foreground, com.badlogic.gdx.graphics.Color[][] background)
SquidLayers
put(int x, int y, char[][] c, com.badlogic.gdx.graphics.Color[][] foregrounds, com.badlogic.gdx.graphics.Color[][] backgrounds, int[][] backgroundLightness)
Place a 2@ char array c into the foreground, with foreground colors specified by a 2D Color array, background colors with another 2D Color array, and lightness variations for the background in a 2D int array (255 will make the background equal the background panel'sSquidPanel.getLightingColor()
, -255 will use the background as-is, and values in between will be linearly interpolated between those two extremes).SquidLayers
put(int x, int y, char c, float encodedForeground)
Place a char c into the foreground, with a foreground color as a packed float.SquidLayers
put(int x, int y, char c, float encodedForeground, float encodedBackground, float backgroundLightness, float mixBackground)
Place a char c into the foreground, with a foreground, background, and mix color (which affects the background) each encoded as a packed float and a lightness variation for the background (using the style that SquidPanel does, with the "lightness" a float between 0.0f and 1.0f inclusive, encodedBackground used on its own for 0 lightness, mixBackground used on its own for 1 lightness, and values in between mixing the two).SquidLayers
put(int x, int y, char c, float encodedForeground, float encodedBackground, int backgroundLightness)
Place a char c into the foreground, with a foreground and background color each encoded as a packed float and a lightness variation for the background (255 will make the background equal the background panel'sSquidPanel.getLightingColor()
, -255 will use encodedBackground as-is, and values in between will be linearly interpolated between those two extremes).SquidLayers
put(int x, int y, char c, float encodedForeground, float encodedBackground, int backgroundLightness, float mixBackground)
Place a char c into the foreground, with a foreground, background, and mix color (which affects the background) each encoded as a packed float and a lightness variation for the background (255 will make the background equal mixColor, -255 will use encodedBackground as-is, and values in between will be linearly interpolated between those two extremes).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 as a libGDX Color (or SColor).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 specified foreground color and background color.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 (255 will make the background equal the background panel'sSquidPanel.getLightingColor()
, -255 will use the background as-is, and values in between will be linearly interpolated between those two extremes).SquidLayers
put(int x, int y, char c, com.badlogic.gdx.graphics.Color foreground, com.badlogic.gdx.graphics.Color background, int mixAmount, com.badlogic.gdx.graphics.Color mixBackground)
Place a char c into the foreground, with a foreground and background libGDX Color and a lightness variation for the background (255 will make the background equal the background panel'sSquidPanel.getLightingColor()
, -255 will use the background as-is, and values in between will be linearly interpolated between those two extremes).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, using the specified layer's default foreground color.SquidLayers
putInto(int layer, int x, int y, char[][] c)
Place a 2D char array c into the specified layer, using the specified layer's default foreground color.SquidLayers
putInto(int layer, int x, int y, char[][] c, com.badlogic.gdx.graphics.Color[][] colors)
Place a 2D char array c into the specified layer, using the matching Color from the given 2D Color array.SquidLayers
putInto(int layer, int x, int y, char c, com.badlogic.gdx.graphics.Color color)
Place a char c into the specified layer with the specified Color.SquidLayers
putString(int x, int y, String s)
Put a string at the given x, y position, using the default foreground color.SquidLayers
putString(int x, int y, String s, com.badlogic.gdx.graphics.Color foreground)
Put a string at the given x, y position, with the given foreground Color.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 foreground and background Colors.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
setBackgroundLayer(SquidPanel panel)
Sets the background panel to match the given SquidPanel (it can also be a subclass of SquidPanel, a likely use).void
setBGColorCenter(IColorCenter<com.badlogic.gdx.graphics.Color> scc)
Sets the IColorCenter used by the background layer.void
setExtraPanel(SquidPanel panel, int index)
Sets an extra panel to match the given SquidPanel (it can also be a subclass of SquidPanel, a likely use).void
setFGColorCenter(IColorCenter<com.badlogic.gdx.graphics.Color> scc)
Sets the IColorCenter used by the foreground layer.void
setForegroundLayer(SquidPanel panel)
Sets the foreground panel to match the given SquidPanel (it can also be a subclass of SquidPanel, a likely use).void
setGridOffsetX(int offset)
void
setGridOffsetY(int offset)
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(float wide, float 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, float wide, float 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(int x, int y, int endX, int endY)
SquidLayers
slide(int x, int y, int endX, int endY, int layer, float duration)
SquidLayers
slide(AnimatedEntity ae, int endX, int endY)
SquidLayers
slide(AnimatedEntity ae, int endX, int endY, 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
tint(AnimatedEntity ae, com.badlogic.gdx.graphics.Color color)
SquidLayers
tint(AnimatedEntity ae, com.badlogic.gdx.graphics.Color color, int layer, float duration)
SquidLayers
wiggle(int x, int y)
SquidLayers
wiggle(int x, int y, int layer, float duration)
SquidLayers
wiggle(AnimatedEntity ae)
SquidLayers
wiggle(AnimatedEntity ae, int layer, float duration)
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Group
act, addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, applyTransform, childrenChanged, clear, 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
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor
addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebugBounds, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, 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, 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
-
Field Details
-
Constructor Details
-
SquidLayers
public SquidLayers()Create a new SquidLayers widget with a default stretchable font, 40 cells wide and 40 cells high, and 12x12 pixels for each cell.
This uses a default font that is not supplied in the JAR library of SquidLib; you need two files to use it if it does not render correctly:- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-Custom-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-Custom-distance.png
-
SquidLayers
Create a new SquidLayers widget with a default stretchable font, the given number of cells for gridWidth and gridHeight, and 12x12 pixels for each cell.
This uses a default font that is not supplied in the JAR library of SquidLib; you need two files to use it if it does not render correctly:- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-Custom-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-Custom-distance.png
- Parameters:
gridWidth
- in grid cellsgridHeight
- in grid cells
-
SquidLayers
Create a new SquidLayers widget with a default stretchable font (it will adapt to the cellWidth and cellHeight you give it), the given number of cells for gridWidth and gridHeight, and the size in pixels for each cell given by cellWidth and cellHeight.
This uses a default font that is not supplied in the JAR library of SquidLib; you need two files to use it if it does not render correctly:- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-Custom-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-Custom-distance.png
- Parameters:
gridWidth
- in grid cellsgridHeight
- in grid cellscellWidth
- in pixelscellHeight
- in pixels
-
SquidLayers
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.- Parameters:
gridWidth
- in grid cellsgridHeight
- in grid cellscellWidth
- in pixelscellHeight
- in pixelsfontpath
- A path to a BitmapFont in the assets folder
-
SquidLayers
public 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.- Parameters:
gridWidth
- in grid cellsgridHeight
- in grid cellscellWidth
- in pixelscellHeight
- in pixelsbitmapFont
- A BitmapFont that you already constructed
-
SquidLayers
public 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. Consider using predefined TextCellFactory objects fromDefaultResources
, which will be configured by this constructor for sizing when passed here.- Parameters:
gridWidth
- in grid cellsgridHeight
- in grid cellscellWidth
- in pixelscellHeight
- in pixelstcf
- A TextCellFactory that you already constructed
-
SquidLayers
public SquidLayers(int gridWidth, int gridHeight, int cellWidth, int cellHeight, SquidColorCenter bgColorCenter, SquidColorCenter fgColorCenter)Create a new SquidLayers widget with a default stretchable font (it will adapt to the cellWidth and cellHeight you give it), the given number of cells for gridWidth and gridHeight, the size in pixels for each cell given by cellWidth and cellHeight, and the given SquidColorCenter instances to affect colors.
This uses a default font that is not supplied in the JAR library of SquidLib; you need two files to use it if it does not render correctly:- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-Custom-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-Custom-distance.png
- Parameters:
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 foreground
-
SquidLayers
public 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.- Parameters:
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 foreground
-
SquidLayers
public 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.- Parameters:
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 foreground
-
SquidLayers
public 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. Consider using predefined TextCellFactory objects fromDefaultResources
, which will be configured by this constructor for sizing when passed here.- Parameters:
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 foreground
-
SquidLayers
public SquidLayers(int gridWidth, int gridHeight, int cellWidth, int cellHeight, TextCellFactory tcf, SquidColorCenter bgColorCenter, SquidColorCenter fgColorCenter, char[][] actualMap)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, the given SquidColorCenters for background and foreground, and the given 2D char array for an area map that may be sized differently than gridWidth by gridHeight (it is usually larger than gridWidth by gridHeight, which allows camera scrolling across the map). This requires some special work with the Camera and Viewports to get working correctly; in the squidlib module's examples, EverythingDemo may be a good place to see how this can be done. You can pass null for actualMap, which will simply create a char array to use internally that is exactly gridWidth by gridHeight, in cells. Consider using predefined TextCellFactory objects fromDefaultResources
, which will be configured by this constructor for sizing when passed here.- Parameters:
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 foregroundactualMap
- will often be a different size than gridWidth by gridHeight, which enables camera scrolling
-
-
Method Details
-
getWidth
The pixel width of the entire map as displayed.- Overrides:
getWidth
in classcom.badlogic.gdx.scenes.scene2d.Actor
- Returns:
- the pixel width of the entire map as displayed
-
getHeight
The pixel height of the entire map as displayed.- Overrides:
getHeight
in classcom.badlogic.gdx.scenes.scene2d.Actor
- Returns:
- the pixel height of the entire map as displayed
-
getGridWidth
Width of the shown area of the map in grid cells.- Returns:
- the width of the map in grid cells
-
getGridHeight
Height of the shown area of the map in grid cells.- Returns:
- the height of the map in grid cells
-
getCellWidth
Width of one cell in pixels.- Returns:
- the width of one cell in pixels
-
getCellHeight
Height of one cell in pixels.- Returns:
- the height of one cell in pixels
-
getAnimationDuration
-
setAnimationDuration
-
getTextFactory
-
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.- Returns:
-
autoLight
Alters the lightnesses that affect the background colors, accepting a parameter for animation frame if rippling water and waving grass usingSeededNoise
are desired. It may make sense to pass some fraction of the current time, as given bySystem.currentTimeMillis()
, instead of a frame. Does not allocate a new 2D int array likeMapUtility.generateLightnessModifiers(char[][])
or its equivalent in DungeonUtility, and directly mutates the lightness data. You can use thelightnesses
field to access the 2D array directly, where you can make further modifications to the lighting.- Returns:
- this for chaining
-
autoLight
Alters the lightnesses that affect the background colors, accepting a parameter for animation frame if rippling water and waving grass usingSeededNoise
are desired. It may make sense to pass some fraction of the current time, as given bySystem.currentTimeMillis()
, instead of a frame. Does not allocate a new 2D int array likeMapUtility.generateLightnessModifiers(char[][])
or its equivalent in DungeonUtility, and directly mutates the lightness data. You can use thelightnesses
field to access the 2D array directly, where you can make further modifications to the lighting.- Parameters:
frame
- a counter that typically should increase by between 10.0 and 20.0 each second; higher numbers make water and grass move more, and 0.013 multiplied by the current time in milliseconds works well as long as only the smaller digits of the time are used; this can be accomplished with(System.currentTimeMillis() & 0xFFFFFF) * 0.013
.- Returns:
- a 2D array of lightness values from -255 to 255 but usually close to 0; can be passed to SquidLayers
-
autoLight
Alters the lightnesses that affect the background colors, accepting a parameter for animation frame if rippling water and waving grass usingSeededNoise
are desired. It may make sense to pass some fraction of the current time, as given bySystem.currentTimeMillis()
, instead of a frame. Also allows additional chars to be treated like deep and shallow water regarding the ripple animation. Does not allocate a new 2D int array likeMapUtility.generateLightnessModifiers(char[][])
or its equivalent in DungeonUtility, and directly mutates the lightness data. You can use thelightnesses
field to access the 2D array directly, where you can make further modifications to the lighting.- Parameters:
frame
- a counter that typically should increase by between 10.0 and 20.0 each second; higher numbers make water and grass move more, and 0.013 multiplied by the current time in milliseconds works well as long as only the smaller digits of the time are used; this can be accomplished with(System.currentTimeMillis() & 0xFFFFFF) * 0.013
.deepLiquid
- a char that will be treated like deep water when animating ripplesshallowLiquid
- a char that will be treated like shallow water when animating ripples- Returns:
- a 2D array of lightness values from -255 to 255 but usually close to 0; can be passed to SquidLayers
-
setLightnesses
Sets the lightness modifiers used for background cells with the int[][] passed as lightnesses. This 2D array should have elements between 0 to 511, with 256 as the unmodified lightness level, lower numbers meaning darker, and higher meaning lighter. Elements less than 0 or higher than 511 will probably cause array out-of-bounds exceptions to be thrown when this renders, so just don't do that. This doesn't validate because maps can get large, validating many cells could be expensive, and this might be called often if it's being called at all.- Parameters:
lightnesses
- 2D array, width and height should match this class' gridWidth and gridHeight. elements must be between 0 and 511.
-
addExtraLayer
Add an extra layer on top of the foreground layer. Use putInto methods to specify the layer when adding a char (0 is background, 1 is unused, 2 is foreground, and the first call to this method creates layer 3).- Returns:
- this for chaining
-
setTextSize
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).- Parameters:
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 pixels- Returns:
- this for chaining
-
setTextSize
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).- Parameters:
wide
- the width of a glyph in pixelshigh
- the height of a glyph in pixels- Returns:
- this for chaining
-
put
Place a char c into the foreground at position x, y, with the default color.- Parameters:
x
- in grid cells.y
- in grid cells.c
- a character to be drawn in the foreground- Returns:
- this for chaining
-
put
Place a char c into the foreground, with a foreground color as a libGDX Color (or SColor).- Parameters:
x
- in grid cells.y
- in grid cells.c
- a character to be drawn in the foregroundforeground
- Color for the char being drawn- Returns:
- this for chaining
-
put
Place a char c into the foreground, with a foreground color as a packed float.- Parameters:
x
- in grid cells.y
- in grid cells.c
- a character to be drawn in the foregroundencodedForeground
- float encoding the color for the char being drawn- Returns:
- this for chaining
-
put
public 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 specified foreground color and background color.- Parameters:
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 background- Returns:
- this for chaining
-
put
public 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 (255 will make the background equal the background panel'sSquidPanel.getLightingColor()
, -255 will use the background as-is, and values in between will be linearly interpolated between those two extremes).- Parameters:
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 changed less, higher changed closer to the lighting color- Returns:
- this for chaining
-
put
public SquidLayers put(int x, int y, char c, com.badlogic.gdx.graphics.Color foreground, com.badlogic.gdx.graphics.Color background, int mixAmount, com.badlogic.gdx.graphics.Color mixBackground)Place a char c into the foreground, with a foreground and background libGDX Color and a lightness variation for the background (255 will make the background equal the background panel'sSquidPanel.getLightingColor()
, -255 will use the background as-is, and values in between will be linearly interpolated between those two extremes).- Parameters:
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 backgroundmixAmount
- int between -255 and 255 , lower numbers are changed less, higher changed closer to mixBackgroundmixBackground
- Color to mix with the background, dependent on mixAmount- Returns:
- this for chaining
-
put
public SquidLayers put(int x, int y, char c, float encodedForeground, float encodedBackground, int backgroundLightness)Place a char c into the foreground, with a foreground and background color each encoded as a packed float and a lightness variation for the background (255 will make the background equal the background panel'sSquidPanel.getLightingColor()
, -255 will use encodedBackground as-is, and values in between will be linearly interpolated between those two extremes).- Parameters:
x
- in grid cells.y
- in grid cells.c
- a character to be drawn in the foregroundencodedForeground
- float encoding the color for the char being drawnencodedBackground
- float encoding the color for the backgroundbackgroundLightness
- int between -255 and 255 , lower numbers are darker, higher lighter.- Returns:
- this for chaining
-
put
public SquidLayers put(int x, int y, char c, float encodedForeground, float encodedBackground, int backgroundLightness, float mixBackground)Place a char c into the foreground, with a foreground, background, and mix color (which affects the background) each encoded as a packed float and a lightness variation for the background (255 will make the background equal mixColor, -255 will use encodedBackground as-is, and values in between will be linearly interpolated between those two extremes).- Parameters:
x
- in grid cells.y
- in grid cells.c
- a character to be drawn in the foregroundencodedForeground
- float encoding the color for the char being drawnencodedBackground
- float encoding the color for the backgroundbackgroundLightness
- int between -255 and 255 , lower numbers are darker, higher lighter.mixBackground
- float encoding a color to mix with the background instead of the normal lighting color- Returns:
- this for chaining
-
put
public SquidLayers put(int x, int y, char c, float encodedForeground, float encodedBackground, float backgroundLightness, float mixBackground)Place a char c into the foreground, with a foreground, background, and mix color (which affects the background) each encoded as a packed float and a lightness variation for the background (using the style that SquidPanel does, with the "lightness" a float between 0.0f and 1.0f inclusive, encodedBackground used on its own for 0 lightness, mixBackground used on its own for 1 lightness, and values in between mixing the two).- Parameters:
x
- in grid cells.y
- in grid cells.c
- a character to be drawn in the foregroundencodedForeground
- float encoding the color for the char being drawnencodedBackground
- float encoding the color for the backgroundbackgroundLightness
- float between 0.0f and 1.0f (both inclusive); higher means closer to mixBackgroundmixBackground
- float encoding a color to mix with the background instead of the normal lighting color- Returns:
- this for chaining
-
put
-
put
public SquidLayers put(int x, int y, char[][] c, com.badlogic.gdx.graphics.Color[][] foreground, com.badlogic.gdx.graphics.Color[][] background) -
put
public SquidLayers put(int x, int y, char[][] c, com.badlogic.gdx.graphics.Color[][] foregrounds, com.badlogic.gdx.graphics.Color[][] backgrounds, int[][] backgroundLightness)Place a 2@ char array c into the foreground, with foreground colors specified by a 2D Color array, background colors with another 2D Color array, and lightness variations for the background in a 2D int array (255 will make the background equal the background panel'sSquidPanel.getLightingColor()
, -255 will use the background as-is, and values in between will be linearly interpolated between those two extremes).- Parameters:
x
- in grid cells.y
- in grid cells.c
- char[][] to be drawn in the foreground starting from x, yforegrounds
- Color[][] of colors for the char being drawnbackgrounds
- Color[][] of colors for the backgroundbackgroundLightness
- int[][] with elements between -255 and 255 , lower darker, higher lighter.- Returns:
- this for chaining
-
putInto
Place a char c into the specified layer, using the specified layer's default foreground color.- Parameters:
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, y- Returns:
- this for chaining
-
putInto
Place a char c into the specified layer with the specified Color.- Parameters:
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 drawn- Returns:
- this for chaining
-
putInto
Place a 2D char array c into the specified layer, using the specified layer's default foreground color.- Parameters:
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, y- Returns:
- this for chaining
-
putInto
public SquidLayers putInto(int layer, int x, int y, char[][] c, com.badlogic.gdx.graphics.Color[][] colors)Place a 2D char array c into the specified layer, using the matching Color from the given 2D Color array.- Parameters:
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
- Color[][] that should have the same width and height as c- Returns:
- this for chaining
-
putString
Put a string at the given x, y position, using the default foreground color.- Parameters:
x
- in grid cells.y
- in grid cells.s
- the string to print- Returns:
- this for chaining
-
putString
Put a string at the given x, y position, with the given foreground Color.- Parameters:
x
- in grid cells.y
- in grid cells.s
- the string to printforeground
- the Color to use- Returns:
- this, for chaining
-
putString
public 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 foreground and background Colors.- Parameters:
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 string- Returns:
- this, for chaining
-
putBoxedString
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. Useful for message boxes.- Parameters:
x
- in grid cells.y
- in grid cells.s
- the string to print inside the box- Returns:
- this, for chaining
-
highlight
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).- Parameters:
x
- in grid cells.y
- in grid cells.lightness
- int between -255 and 255 , lower numbers are darker, higher lighter.
-
highlight
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).- Parameters:
x
- in grid cells.y
- in grid cells.lightness
- int[][] with elements between -255 and 255 , lower numbers are darker, higher lighter.
-
hasValue
Very basic check to see if something was rendered at the x,y cell requested; this only checks the foreground. If the foreground contains the character' '
at the given position or has not been assigned a value at that position, then this returns false, otherwise it returns true.- Parameters:
x
- in grid cells.y
- in grid cells.- Returns:
- true if something was rendered in the foreground at the given x,y position
-
clear
Clear one cell at position x, y of its foreground contents.You may be looking for the erase() method, which erases all panels and all cells.
- Parameters:
x
- in grid cellsy
- in grid cells- Returns:
- this for chaining
-
eraseLayer
-
erase
Erase everything visible in all cells or all layers. This is not at all expensive to do compared to the pre-SquidLib-3.0.0 version of this method that used Swing and took a long time to erase.- Returns:
- this, for chaining
-
bump
-
bump
-
bump
-
bump
-
slide
-
slide
-
slide
-
slide
-
wiggle
-
wiggle
-
wiggle
-
wiggle
-
tint
public SquidLayers tint(int x, int y, com.badlogic.gdx.graphics.Color color, int layer, float duration) -
tint
public SquidLayers tint(AnimatedEntity ae, com.badlogic.gdx.graphics.Color color, int layer, float duration) -
tint
-
tint
-
hasActiveAnimations
-
directionMarker
public AnimatedEntity directionMarker(int x, int y, com.badlogic.gdx.graphics.Color color, int layer, boolean doubleWidth) -
directionMarker
public AnimatedEntity directionMarker(int x, int y, Collection<com.badlogic.gdx.graphics.Color> colors, float loopTime, int layer, boolean doubleWidth) -
animateActor
public AnimatedEntity animateActor(int x, int y, char c, com.badlogic.gdx.graphics.Color color, int layer) -
animateActor
-
animateActor
public AnimatedEntity animateActor(int x, int y, char c, com.badlogic.gdx.graphics.Color color, boolean doubleWidth) -
animateActor
public AnimatedEntity animateActor(int x, int y, char c, Collection<com.badlogic.gdx.graphics.Color> colors, boolean doubleWidth) -
animateActor
public AnimatedEntity animateActor(int x, int y, char c, Collection<com.badlogic.gdx.graphics.Color> colors, float loopTime, boolean doubleWidth) -
animateActor
public AnimatedEntity animateActor(int x, int y, String s, com.badlogic.gdx.graphics.Color color, int layer) -
animateActor
public AnimatedEntity animateActor(int x, int y, String s, com.badlogic.gdx.graphics.Color color, int layer, boolean doubleWidth) -
animateActor
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, com.badlogic.gdx.graphics.Color color, int layer) -
animateActor
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) -
animateActor
-
animateActor
public AnimatedEntity animateActor(int x, int y, String s, com.badlogic.gdx.graphics.Color color, boolean doubleWidth) -
animateActor
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, com.badlogic.gdx.graphics.Color color) -
animateActor
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, com.badlogic.gdx.graphics.Color color, boolean doubleWidth) -
animateActor
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, com.badlogic.gdx.graphics.Color color, boolean doubleWidth, boolean stretch) -
animateActor
-
animateActor
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, boolean doubleWidth) -
animateActor
public AnimatedEntity animateActor(int x, int y, com.badlogic.gdx.graphics.g2d.TextureRegion tr, boolean doubleWidth, boolean stretch) -
getAnimatedEntities
-
getAnimatedEntities
-
getAnimatedEntityByCell
-
removeAnimatedEntity
-
removeAnimatedEntity
-
getAnimatedEntityByCell
-
removeAnimatedEntityByCell
-
removeAnimatedEntityByCell
-
draw
- Overrides:
draw
in classcom.badlogic.gdx.scenes.scene2d.Group
-
drawActor
public void drawActor(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha, AnimatedEntity ae, int layer) -
drawActor
public void drawActor(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha, AnimatedEntity ae) -
setLightingColor
-
getLightingColor
-
setPosition
Sets the position of the actor's bottom left corner.- Overrides:
setPosition
in classcom.badlogic.gdx.scenes.scene2d.Actor
- Parameters:
x
-y
-
-
getLayer
Gets a SquidPanel from this SquidLayers and returns a direct reference. Layer 0 is the background, layer 1 or 2 is the foreground, and any values 3 or higher are extra SquidPanels added viaaddExtraLayer()
. If the layer is not found, this returns the foreground SquidPanel.- Parameters:
layer
- 0 for background, 1 or 2 for foreground, 3 for any extra layers; defaults to foreground- Returns:
- the corresponding SquidPanel as a direct reference
-
getForegroundLayer
-
setForegroundLayer
Sets the foreground panel to match the given SquidPanel (it can also be a subclass of SquidPanel, a likely use). This does not do any validation of size, but theSquidPanel.getTotalWidth()
andSquidPanel.getTotalHeight()
of panel should almost always match this object'sgetTotalWidth()
andgetTotalHeight()
, though there are good reasons why the cell sizes or text sizes might not match. This method is probably most useful when you want a system ofImageSquidPanel
layers; as long as you have the reference to an ImageSquidPanel outside this class, you can call its additional methods there and have it affectpanel
here.- Parameters:
panel
- a SquidPanel, ImageSquidPanel, or other subclass of SquidPanel that should have identical size
-
getBackgroundLayer
-
setBackgroundLayer
Sets the background panel to match the given SquidPanel (it can also be a subclass of SquidPanel, a likely use). This does not do any validation of size, but theSquidPanel.getTotalWidth()
andSquidPanel.getTotalHeight()
of panel should almost always match this object'sgetTotalWidth()
andgetTotalHeight()
, though there are good reasons why the cell sizes or text sizes might not match. This method is probably most useful when you want a system ofImageSquidPanel
layers; as long as you have the reference to an ImageSquidPanel outside this class, you can call its additional methods there and have it affectpanel
here.- Parameters:
panel
- a SquidPanel, ImageSquidPanel, or other subclass of SquidPanel that should have identical size
-
setExtraPanel
Sets an extra panel to match the given SquidPanel (it can also be a subclass of SquidPanel, a likely use). This tries to find the SquidPanel at the given index in the extra panels that may have been added to this withaddExtraLayer()
; if index is invalid because it is negative, this does nothing. If index is higher than the highest index for a layer, this will simply addpanel
to the extra panels, possibly at an earlier index (it will use the next available index, which could easily be 0 or 1). If index is valid, this sets the extra panel at that index topanel
, without changes. This does not do any validation of size, but theSquidPanel.getTotalWidth()
andSquidPanel.getTotalHeight()
of panel should almost always match this object'sgetTotalWidth()
andgetTotalHeight()
, though there are good reasons why the cell sizes or text sizes might not match. This method is probably most useful when you want a system ofImageSquidPanel
layers; as long as you have the reference to an ImageSquidPanel outside this class, you can call its additional methods there and have it affectpanel
here.- Parameters:
panel
- a SquidPanel, ImageSquidPanel, or other subclass of SquidPanel that should have identical sizeindex
- the 0-based index into the extra panels list to try to assign panel to, or to append panel to
-
setFGColorCenter
Sets the IColorCenter used by the foreground layer.- Parameters:
scc
- an IColorCenter; commonly a SquidColorCenter with an optional filter
-
setBGColorCenter
Sets the IColorCenter used by the background layer.- Parameters:
scc
- an IColorCenter; commonly a SquidColorCenter with an optional filter
-
setOffsets
-
getGridOffsetX
-
getGridOffsetY
-
setGridOffsetX
-
setGridOffsetY
-
getTotalWidth
-
getTotalHeight
-