espresso3d.engine.viewport.text
Class E3DFixedWidthFont
java.lang.Object
espresso3d.engine.base.E3DEngineItem
espresso3d.engine.renderer.base.E3DRenderable
espresso3d.engine.renderer.base.E3DBlendedRenderable
espresso3d.engine.renderer.base.E3DBlendedTexturedRenderable
espresso3d.engine.viewport.text.E3DFont
espresso3d.engine.viewport.text.E3DFixedWidthFont
- public class E3DFixedWidthFont
- extends espresso3d.engine.viewport.text.E3DFont
- Author:
- cmoxley
A fixed with font is a font that has even spacing between all characters
A texture is divided into a grid of (numColumns x numRows) and each portion of the
grid will be 1 symbol. Symbols are then bound to a column/row.
|
Constructor Summary |
E3DFixedWidthFont(E3DEngine engine,
java.lang.String fontID,
java.lang.String textureName,
int numColumns,
int numRows)
Instantiate a fixed width font. |
E3DFixedWidthFont(E3DEngine engine,
java.lang.String fontID,
java.lang.String textureName,
int numColumns,
int numRows,
int blendMode)
Instantiate a fixed width font. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
E3DFixedWidthFont
public E3DFixedWidthFont(E3DEngine engine,
java.lang.String fontID,
java.lang.String textureName,
int numColumns,
int numRows)
- Instantiate a fixed width font.
- Parameters:
engine - Engine the font will reside infontID - Unique ID for the fonttextureName - Name of the texture (loaded from a textureset) that contains all the symbols for the fontnumColumns - Number of columns in the texture. This will divide the texture up evenly into numColumns and use the space in-between the columns as the place the symbols will residenumRows - Number of rows in the texture. This will divide the texture up evenly into numRows and use the space in-between the rows as the place the symbols will reside
E3DFixedWidthFont
public E3DFixedWidthFont(E3DEngine engine,
java.lang.String fontID,
java.lang.String textureName,
int numColumns,
int numRows,
int blendMode)
- Instantiate a fixed width font.
- Parameters:
engine - Engine the font will reside infontID - Unique ID for the fonttextureName - Name of the texture (loaded from a textureset) that contains all the symbols for the fontnumColumns - Number of columns in the texture. This will divide the texture up evenly into numColumns and use the space in-between the columns as the place the symbols will residenumRows - Number of rows in the texture. This will divide the texture up evenly into numRows and use the space in-between the rows as the place the symbols will resideblendMode - Type of blending to use for the font
bindSymbolToTexturePosition
public void bindSymbolToTexturePosition(char symbol,
int row,
int column)
- This binds a symbol (a single letter, number, etc) to
a certain position on this fonts texture. That position will be where
the engine looks on the texture when the symbol is passed into a viewport print statement.
Row/Column starts in the upper left hand corner of the texture image with row=1, column=1.
For example, row=1 col=1 would give you the portion of the texture starting in the upper
left hand corner and extending right symbolWidths pixels and extending down symbolHeights pixels.
row=1, col=2 would have an upper left corner starting at symbolWidth + 1 and extending to symbolWidth * 2 and symbolHeight
getFontSymbol
public espresso3d.engine.viewport.text.E3DSymbol getFontSymbol(char symbol)
unbindSymbolFromTexture
public void unbindSymbolFromTexture(char symbol)
getFontID
public java.lang.String getFontID()
setFontID
public void setFontID(java.lang.String fontID)
getGlTextureID
public int getGlTextureID()
setGlTextureID
public void setGlTextureID(int glTextureID)
renderAtPosition
public void renderAtPosition(E3DVector3F position)
- Specified by:
renderAtPosition in class E3DBlendedTexturedRenderable
getCharSymbolMapping
public java.util.HashMap getCharSymbolMapping()
getNumColumns
public int getNumColumns()
getNumRows
public int getNumRows()