public abstract class AbstractTextScreen<T extends com.badlogic.gdx.graphics.Color> extends AbstractSquidScreen<T>
wrap(int)
).
If you use libgdx Color
as your type of color, you can use a less
abstract subtype: TextScreen
.
TextScreen
AbstractSquidScreen.SquidScreenInput<T>
Modifier and Type | Field and Description |
---|---|
protected int[] |
alignment |
protected List<squidpony.panel.IColoredString<T>> |
text
Can contain null members (denoting empty lines)
|
colorCenter, disposed, ipb, resized, sizeManager, stage
Constructor and Description |
---|
AbstractTextScreen(AbstractSquidScreen.SquidScreenInput<T> ssi,
List<squidpony.panel.IColoredString<T>> text,
int[] alignment) |
Modifier and Type | Method and Description |
---|---|
void |
init(List<squidpony.panel.IColoredString<T>> text,
int[] alignment)
You should call this method at most once.
|
protected int[] |
toIntArray(Collection<Integer> l) |
String |
toString() |
void |
wrap(int width)
Wraps the text inside
this according to width . |
buildScreenWideSquidPanel, buildScreenWideSquidPanel, buildSquidPanel, buildSquidPanel, buildStage, clearScreen, dispose, disposeAtResize, getClearingColor, getNext, getPanelbuilder, hasPendingResize, isDisposed, resize, toSquidScreenInput
protected List<squidpony.panel.IColoredString<T extends com.badlogic.gdx.graphics.Color>> text
protected int[] alignment
public AbstractTextScreen(AbstractSquidScreen.SquidScreenInput<T> ssi, List<squidpony.panel.IColoredString<T>> text, int[] alignment)
ssi
- See super classtext
- The text to display. From top to bottom. Use null
members to jump lines.
Give null
if you wanna set it later (using
init(List, int[])
).
alignment
- How to alignment members of text
. -1 for left, 0 for
center, 1 for right. The default is to align left
Give null
if you wanna set it later (using
init(List, int[])
).
public void init(List<squidpony.panel.IColoredString<T>> text, int[] alignment)
text
- The text to display. From top to bottom. Use null
members to jump lines.alignment
- How to alignment members of text
. -1 for left, 0 for
center, 1 for right. The default is to align leftpublic void wrap(int width)
this
according to width
. This
screen's text must have been set already. This, of course, preserves the
text alignment (if any).width
- IllegalStateException
- If this
's text hasn't been initialized yet.protected int[] toIntArray(Collection<Integer> l)
Copyright © 2012–2016. All rights reserved.