public class SquidMessageBox extends SquidPanel
Modifier and Type | Field and Description |
---|---|
protected ArrayList<com.badlogic.gdx.scenes.scene2d.ui.Label> |
labels |
protected GDXMarkup |
markup |
protected int |
messageIndex |
protected ArrayList<squidpony.panel.IColoredString<com.badlogic.gdx.graphics.Color>> |
messages |
animatedEntities, animationCount, cellHeight, cellWidth, colors, contents, DEFAULT_ANIMATION_DURATION, defaultForeground, distanceField, gridHeight, gridOffsetX, gridOffsetY, gridWidth, lightingColor, scc, textFactory, xOffset, yOffset
Constructor and Description |
---|
SquidMessageBox(int gridWidth,
int gridHeight)
Creates a bare-bones panel with all default values for text rendering.
|
SquidMessageBox(int gridWidth,
int gridHeight,
int cellWidth,
int cellHeight)
Creates a panel with the given grid and cell size.
|
SquidMessageBox(int gridWidth,
int gridHeight,
TextCellFactory factory)
Builds a panel with the given grid size and all other parameters determined by the factory.
|
SquidMessageBox(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.
|
Modifier and Type | Method and Description |
---|---|
void |
appendMessage(squidpony.panel.IColoredString<com.badlogic.gdx.graphics.Color> message)
A common way of using this class.
|
void |
appendMessage(String message)
The primary way of using this class.
|
void |
appendWrappingMessage(squidpony.panel.IColoredString<com.badlogic.gdx.graphics.Color> message)
Appends a new line as an IColoredString to the message listing and scrolls to the bottom.
|
void |
appendWrappingMessage(String message)
Appends a new line to the message listing and scrolls to the bottom.
|
void |
draw(com.badlogic.gdx.graphics.g2d.Batch batch,
float parentAlpha) |
void |
nudgeDown()
Used internally to scroll down by one line, but can also be triggered by your code.
|
void |
nudgeUp()
Used internally to scroll up by one line, but can also be triggered by your code.
|
void |
setBounds(float x,
float y,
float width,
float height)
Set the x, y position of the lower left corner, plus set the width and height.
|
adjustX, adjustY, animateActor, animateActor, animateActor, animateActor, animateActor, animateActor, animateActor, animateActor, animateActor, animateActor, animateActor, animateActor, animateActor, animateActor, bump, bump, bump, bump, cellHeight, cellToActor, cellToActor, cellWidth, clampDuration, clear, drawActor, erase, fade, getAnimatedEntities, getAnimatedEntityByCell, getAt, getBacker, getColorAt, getColorCenter, getDefaultForegroundColor, getGridHeight, getGridOffsetX, getGridOffsetY, getGridWidth, getLightingColor, getTextCellFactory, getxOffset, getyOffset, gridHeight, gridWidth, hasActiveAnimations, placeVerticalString, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, recallActor, recallActor, removeAnimatedEntity, setColorCenter, setDefaultForeground, setGridHeight, setGridOffsetX, setGridOffsetY, setGridWidth, setLightingColor, setOffsets, setOffsetX, setOffsetY, setPosition, setTextSize, slide, slide, slide, slide, slide, tint, tint, tint, wiggle, wiggle
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, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setY, setZIndex, sizeBy, sizeBy, sizeChanged, stageToLocalCoordinates, toBack, toFront
protected ArrayList<squidpony.panel.IColoredString<com.badlogic.gdx.graphics.Color>> messages
protected int messageIndex
public SquidMessageBox(int gridWidth, int gridHeight)
gridWidth
- the number of cells horizontallygridHeight
- the number of cells vertically, must be at least 3public SquidMessageBox(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 SquidMessageBox(int gridWidth, int gridHeight, TextCellFactory factory)
gridWidth
- the number of cells horizontallygridHeight
- the number of cells verticallyfactory
- the factory to use for cell renderingpublic SquidMessageBox(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 void appendMessage(String message)
message
- a String that should be no longer than gridWidth - 2; will be truncated otherwise.public void appendWrappingMessage(String message)
message
- a String; this method has no specific length restrictionspublic void appendMessage(squidpony.panel.IColoredString<com.badlogic.gdx.graphics.Color> message)
message
- an IColoredString that should be no longer than gridWidth - 2; will be truncated otherwise.public void appendWrappingMessage(squidpony.panel.IColoredString<com.badlogic.gdx.graphics.Color> message)
message
- an IColoredString with type parameter Color; this method has no specific length restrictionspublic void nudgeUp()
public void nudgeDown()
public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
draw
in class SquidPanel
public void setBounds(float x, float y, float width, float height)
setBounds
in class com.badlogic.gdx.scenes.scene2d.Actor
x
- x position in pixels or other units that libGDX is set to usex
- y position in pixels or other units that libGDX is set to usewidth
- the width in pixels (usually) of the message box; changes on resizeheight
- the height in pixels (usually) of the message box; changes on resizeCopyright © 2012–2016. All rights reserved.