Modifier and Type | Class and Description |
---|---|
class |
TextFamily
A variant of
TextCellFactory that allows switching between regular, bold, italic, and bold italic styles. |
Modifier and Type | Field and Description |
---|---|
TextCellFactory |
SparseLayers.font
The TextCellFactory that is used to determine font size as well as cell size; must be initialized, usually using
initBySize() , if this is changed after construction. |
protected TextCellFactory |
TextPanel.tcf |
protected TextCellFactory |
VisualInput.tcfLeft |
protected TextCellFactory |
VisualInput.tcfRight |
protected TextCellFactory |
SquidLayers.textFactory |
protected TextCellFactory |
SquidPanel.textFactory |
TextCellFactory |
StarterKit.textFactory
One of the more critical parts of rendering text is what font to use, and textFactory should usually
not be reassigned during a game because so many things depend on this value or a copy of it (so the
change might not affect what it was expected to, and might break other things).
|
Modifier and Type | Method and Description |
---|---|
TextCellFactory |
TextCellFactory.addFit(java.lang.String fit)
Adds the code points in the string to the list of characters that will be
guaranteed to fit as fixed-width.
|
TextCellFactory |
TextCellFactory.addSwap(char find,
char replace)
Adds a pair of chars as a replacement pair, so when the find char is requested to be drawn, the replace char is
used instead.
|
TextCellFactory |
TextCellFactory.addSwap(java.lang.String find,
java.lang.String replace)
Adds a pair of Strings (typically both with length 1) as a replacement pair, so when the find String is requested
to be drawn, the replace String is used instead.
|
TextCellFactory |
TextCellFactory.addSwaps(squidpony.squidmath.OrderedMap<java.lang.Character,java.lang.Character> swaps)
Appends to the mapping of replacement pairs, adding or replacing any entries in the current mapping with the
entries in a Map of Character keys to String values.
|
TextCellFactory |
TextCellFactory.antialias(boolean antialias)
Deprecated.
AA is the wave of the future!
|
TextCellFactory |
TextCellFactory.bottomPadding(int padding)
Sets the amount of padding on the bottom side to the provided value.
|
TextCellFactory |
TextCellFactory.clearSwaps()
Clears all replacement pairs this has been told to swap.
|
TextCellFactory |
TextCellFactory.copy() |
TextCellFactory |
TextCellFactory.defaultDistanceFieldFont()
Sets the TextCellFactory to use a square distance field font that will resize to whatever size you request.
|
TextCellFactory |
TextCellFactory.defaultFont()
Sets this factory to use a default 12x24 font that supports Latin, Greek, Cyrillic, and many more, including
box-drawing characters, zodiac signs, playing-card suits, and chess piece symbols.
|
TextCellFactory |
TextCellFactory.defaultNarrowDistanceFieldFont()
Sets the TextCellFactory to use a half-square distance field font that will resize to whatever size you request.
|
TextCellFactory |
TextCellFactory.defaultNarrowFont()
Sets this factory to use a default 12x24 font that renders very accurately, with no gaps between box-drawing
characters and very geometric lines.
|
TextCellFactory |
TextCellFactory.defaultSquareFont()
Sets this factory to use a default 12x12 font, which...
|
TextCellFactory |
TextCellFactory.fit(java.lang.String fit)
Sets the characters that will be guaranteed to fit as fixed-width to the provided ones.
|
TextCellFactory |
TextCellFactory.fitAll()
Sets all valid characters to be guaranteed to fit as fixed-width.
|
TextCellFactory |
TextCellFactory.font(com.badlogic.gdx.graphics.g2d.BitmapFont bitmapFont)
Sets this factory to use the provided BitmapFont as its font without re-constructing anything.
|
TextCellFactory |
TextCellFactory.font(java.lang.String fontpath)
Sets this factory to use the provided font.
|
TextCellFactory |
TextCellFactory.fontDistanceField(java.lang.String fontPath,
java.lang.String texturePath)
Sets the font to a distance field font with the given String path to a .fnt file and String path to a texture.
|
TextCellFactory |
TextCellFactory.fontMultiDistanceField(java.lang.String fontPath,
java.lang.String texturePath) |
static TextCellFactory |
DefaultResources.getCrispCarvedFont()
Returns a TextCellFactory already configured to use a partially-angular variable-width font with good Unicode
support and an appearance as if it were carved into solid rock, that should scale cleanly to even very large
sizes (using an MSDF technique).
|
static TextCellFactory |
DefaultResources.getCrispCascadiaFont()
Returns a TextCellFactory already configured to use a fixed-width font with excellent Unicode support
and a humanist style, that should scale cleanly to even very large sizes (using an MSDF technique).
|
static TextCellFactory |
DefaultResources.getCrispCurvySquareFont()
Returns a TextCellFactory already configured to use an all-caps (with lighter-weight versions of upper-case
letters for the lower-case glyphs) square font that should scale cleanly to many sizes.
|
static TextCellFactory |
DefaultResources.getCrispDejaVuFont()
Returns a TextCellFactory already configured to use a fixed-width sans-serif font with excellent Unicode support,
that should scale cleanly to even very large sizes.
|
static TextCellFactory |
DefaultResources.getCrispIconFont()
Returns a TextCellFactory already configured to use a fixed-width icon font (no letters are supported) using the
Font-Awesome icon set, that should scale cleanly to even very large sizes.
|
static TextCellFactory |
DefaultResources.getCrispLeanFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support
and a sans-serif geometric style, that should scale cleanly to even very large sizes (using an MSDF technique).
|
static TextCellFactory |
DefaultResources.getCrispLeanItalicFont()
Deprecated.
use
DefaultResources.getCrispLeanFamily() instead |
static TextCellFactory |
DefaultResources.getCrispOctagonalSquareFont()
Returns a TextCellFactory already configured to use a square font with 45-degree angled sections, based on the
typeface used on the Atari ST console, that should scale cleanly to many sizes.
|
static TextCellFactory |
DefaultResources.getCrispRobotoSansFont()
Returns a TextCellFactory already configured to use a variable-width sans-serif font with good Unicode support
and a no-nonsense look, that should scale cleanly to even very large or small sizes (using an MSDF technique).
|
static TextCellFactory |
DefaultResources.getCrispSlabFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support
and a slab-serif geometric style, that should scale cleanly to even very large sizes (using an MSDF technique).
|
static TextCellFactory |
DefaultResources.getCrispSlabItalicFont()
Deprecated.
use
DefaultResources.getCrispSlabFamily() instead |
static TextCellFactory |
DefaultResources.getCrispSmoothFont()
Returns a TextCellFactory already configured to use a narrow font (twice as tall as it is wide) that should scale
cleanly to many sizes.
|
TextCellFactory |
SparseLayers.getFont()
Gets a direct reference to the TextCellFactory this uses to draw and size its text items and cells.
|
TextCellFactory |
TextPanel.getFont() |
static TextCellFactory |
DefaultResources.getStretchableCleanFont()
Returns a TextCellFactory already configured to use a variable-width sans-serif font that currently looks
slightly jumbled without certain layout features.
|
static TextCellFactory |
DefaultResources.getStretchableCodeFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with broad Unicode support
that should scale cleanly to many sizes.
|
static TextCellFactory |
DefaultResources.getStretchableCodeJPFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with strong CJK support (in
particular, very good coverage for Japanese) that should scale cleanly to many sizes.
|
static TextCellFactory |
DefaultResources.getStretchableDejaVuFont()
Returns a TextCellFactory already configured to use a font with extremely wide Unicode support that should scale
cleanly to many sizes.
|
static TextCellFactory |
DefaultResources.getStretchableFont()
Returns a TextCellFactory already configured to use a narrow font (twice as tall as it is wide) that should scale
cleanly to many sizes.
|
static TextCellFactory |
DefaultResources.getStretchableHeavySquareFont()
Returns a TextCellFactory already configured to use an blocky, fairly-bold square font that should scale cleanly
to many sizes.
|
static TextCellFactory |
DefaultResources.getStretchableLeanFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support
and a thin, geometric style, that should scale cleanly to many sizes.
|
static TextCellFactory |
DefaultResources.getStretchableLeanLightFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support
and a very thin, geometric style, that should scale cleanly to many sizes.
|
static TextCellFactory |
DefaultResources.getStretchableOrbitFont()
Returns a TextCellFactory already configured to use a variable-width sans-serif font that should have a blocky,
futuristic look (based on the font Orbitron), and that should scale cleanly to many sizes.
|
static TextCellFactory |
DefaultResources.getStretchablePrintFont()
Returns a TextCellFactory already configured to use a variable-width serif font that should look like the serif
fonts used in many novels' main texts, and that should scale cleanly to many sizes.
|
static TextCellFactory |
DefaultResources.getStretchableSlabFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support
and a slab-serif geometric style, that should scale cleanly to many sizes.
|
static TextCellFactory |
DefaultResources.getStretchableSlabLightFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support
and a very thin, slab-serif geometric style, that should scale cleanly to many sizes.
|
static TextCellFactory |
DefaultResources.getStretchableSquareFont()
Returns a TextCellFactory already configured to use a square font that should scale cleanly to many sizes.
|
static TextCellFactory |
DefaultResources.getStretchableTypewriterFont()
Returns a TextCellFactory already configured to use a narrow typewriter-style serif font that should scale
cleanly to many sizes.
|
TextCellFactory |
SquidPanel.getTextCellFactory() |
TextCellFactory |
SquidLayers.getTextFactory() |
TextCellFactory |
TextCellFactory.height(float height)
Sets the factory's cell height to the provided value.
|
TextCellFactory |
TextCellFactory.includedFont()
Sets this factory to use the one font included with libGDX, which is Liberation Sans at size 15 px.
|
TextCellFactory |
TextCellFactory.initByFont()
Initializes the factory to then be able to create text cells on demand.
|
TextCellFactory |
TextCellFactory.initBySize()
Initializes the factory to then be able to create text cells on demand.
|
TextCellFactory |
TextCellFactory.initVerbatim()
Identical to
initBySize() . |
TextCellFactory |
TextCellFactory.leftPadding(int padding)
Sets the amount of padding on the left side to the provided value.
|
TextCellFactory |
TextCellFactory.padding(int padding)
Sets the amount of padding on all sides to the provided value.
|
TextCellFactory |
TextCellFactory.removeSwap(char find)
Removes the replacement pair, if present, that searches for the given key, find.
|
TextCellFactory |
TextCellFactory.removeSwap(java.lang.String find)
Removes the replacement pair, if present, that searches for the given key, find.
|
TextCellFactory |
TextCellFactory.resetSize()
Acts like calling
initBySize() , but doesn't create new ShaderPrograms or other objects if this has
already been initialized. |
TextCellFactory |
TextCellFactory.resetSize(float newWidth,
float newHeight)
Acts like calling
width(float) , height(float) , and initBySize() in succession, but
doesn't create new ShaderPrograms or other objects if this has already been initialized. |
TextCellFactory |
TextCellFactory.rightPadding(int padding)
Sets the amount of padding on the right side to the provided value.
|
TextCellFactory |
TextCellFactory.setAllSwaps(squidpony.squidmath.OrderedMap<java.lang.Character,java.lang.Character> swaps)
Sets the mapping of replacement pairs to a different one as a Map of Character keys to String values.
|
TextCellFactory |
TextCellFactory.setColorCenter(squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> icc) |
TextCellFactory |
TextCellFactory.setDirectionGlyph(char directionGlyph) |
TextCellFactory |
TextCellFactory.setSmoothingMultiplier(float smoothingMultiplier)
If this uses a distance field font, the smoothing multiplier affects how crisp or blurry lines are, with higher
numbers generally resulting in more crisp fonts, but numbers that are too high cause jagged aliasing.
|
TextCellFactory |
TextCellFactory.topPadding(int padding)
Sets the amount of padding on the top side to the provided value.
|
TextCellFactory |
TextCellFactory.tweakHeight(float height)
Sets the factory's height used for text to the provided value, but does not change the size of a cell.
|
TextCellFactory |
TextCellFactory.tweakWidth(float width)
Sets the factory's height used for text to the provided value, but does not change the size of a cell.
|
TextCellFactory |
TextCellFactory.width(float width)
Sets the factory's cell width to the provided value.
|
Modifier and Type | Method and Description |
---|---|
void |
SparseTextMap.draw(com.badlogic.gdx.graphics.g2d.Batch batch,
TextCellFactory textFactory)
Draws the contents of this SparseTextMap, using the keys as x,y pairs as they would be entered by calling
SparseTextMap.place(int, int, char, float) and drawing the associated char at that x,y position. |
void |
SparseTextMap.draw(com.badlogic.gdx.graphics.g2d.Batch batch,
TextCellFactory textFactory,
float screenOffsetX,
float screenOffsetY)
Draws the contents of this SparseTextMap, using the keys as x,y pairs as they would be entered by calling
SparseTextMap.place(int, int, char, float) and drawing the associated char at that x,y position, potentially with an
offset on x and/or y. |
void |
SparseTextMap.draw(com.badlogic.gdx.graphics.g2d.Batch batch,
TextCellFactory textFactory,
com.badlogic.gdx.math.Frustum frustum)
Draws the contents of this SparseTextMap, using the keys as x,y pairs as they would be entered by calling
SparseTextMap.place(int, int, char, float) and drawing the associated char at that x,y position. |
void |
SparseTextMap.draw(com.badlogic.gdx.graphics.g2d.Batch batch,
TextCellFactory textFactory,
com.badlogic.gdx.math.Frustum frustum,
float screenOffsetX,
float screenOffsetY)
Draws the contents of this SparseTextMap, using the keys as x,y pairs as they would be entered by calling
SparseTextMap.place(int, int, char, float) and drawing the associated char at that x,y position, potentially with an
offset on x and/or y. |
void |
SparseTextMap.draw(com.badlogic.gdx.graphics.g2d.Batch batch,
TextCellFactory textFactory,
com.badlogic.gdx.math.Frustum frustum,
float screenOffsetX,
float screenOffsetY,
char replacement)
Draws the contents of this SparseTextMap, using the keys as x,y pairs as they would be entered by calling
SparseTextMap.place(int, int, char, float) and drawing the char replacement at that x,y position, potentially with an
offset on x and/or y. |
void |
VisualInput.init(TextCellFactory font,
java.util.Map<java.lang.Character,java.lang.String> available)
For each char and String in available, registers each keyboard key (as a char, such as 'A' or
SquidInput.LEFT_ARROW) with a String that names the action that key is used to perform, and makes these Strings
available as buttons on the right side of the screen if on a device with no hardware keyboard.
|
void |
VisualInput.init(TextCellFactory font,
java.lang.String... enabled)
Convenience method that does essentially the same thing as init(Map<Character, String>).
|
void |
SparseLayers.setFont(TextCellFactory font)
Sets the TextCellFactory this uses to draw and size its text items and cells.
|
void |
TextPanel.setFont(TextCellFactory font)
Sets the font to use.
|
Constructor and Description |
---|
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.
|
SparseLayers(int gridWidth,
int gridHeight,
float cellWidth,
float cellHeight,
TextCellFactory font) |
SparseLayers(int gridWidth,
int gridHeight,
float cellWidth,
float cellHeight,
TextCellFactory font,
float xOffset,
float yOffset) |
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).
|
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.
|
SquidPanel(int gridWidth,
int gridHeight,
TextCellFactory factory)
Builds a panel with the given grid size and all other parameters determined by the factory.
|
SquidPanel(int gridWidth,
int gridHeight,
TextCellFactory factory,
squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> center)
Builds a panel with the given grid size and all other parameters determined by the factory.
|
SquidPanel(int gridWidth,
int gridHeight,
TextCellFactory factory,
squidpony.IColorCenter<com.badlogic.gdx.graphics.Color> center,
float xOffset,
float yOffset)
Builds a panel with the given grid size and all other parameters determined by the factory.
|
SquidPanel(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.
|
StarterKit(TextCellFactory textFactory,
int gridWidth,
int gridHeight,
int cellWidth,
int cellHeight)
Constructs a StarterKit with the given width and height in cells (gridWidth and gridHeight) and the given width
and height for each letter (cellWidth and cellHeight), using the given TextCellFactory for the font.
|
StarterKit(TextCellFactory textFactory,
int gridWidth,
int gridHeight,
int cellWidth,
int cellHeight,
int additionalWidth,
int additionalHeight)
Constructs a StarterKit with the given width and height in cells (gridWidth and gridHeight) and the given width
and height for each letter (cellWidth and cellHeight), using the given TextCellFactory for the font; this
overload also allows specifying additional space in pixels to be added to the right or bottom sides of the area
with the grid of chars.
|
SubcellLayers(int gridWidth,
int gridHeight,
float cellWidth,
float cellHeight,
TextCellFactory font) |
SubcellLayers(int gridWidth,
int gridHeight,
float cellWidth,
float cellHeight,
TextCellFactory font,
float xOffset,
float yOffset) |
TextPanel(TextCellFactory font)
The text to display MUST be set later on with
TextPanel.init(float, float, Collection) (which can't be updated) or
TextPanel.initShared(float, float, ArrayList) (which reflects changes in the given ArrayList). |
Copyright © Eben Howard 2012–2022. All rights reserved.