public class MonospaceFontCache extends java.lang.Object implements GameFontCache
| Constructor and Description | 
|---|
| MonospaceFontCache(MonospaceFont monospaceFont) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addText(java.lang.CharSequence str,
       float x,
       float y)Adds text to the cache | 
| void | addText(java.lang.CharSequence str,
       float x,
       float y,
       float targetWidth,
       int halign,
       boolean wrap)Adds text to the cache | 
| void | clear()Clears all text from the cache | 
| void | draw(Graphics g)Draws the cache to the  Graphicscontext | 
| com.badlogic.gdx.graphics.Color | getColor()Returns the  Colorused for subsequent text operations | 
| GameFont | getFont()Returns the underlying  GameFontfor this cache | 
| void | setAllAlphas(float alpha)Sets the  Coloralpha for previous text operations | 
| void | setAllColors(com.badlogic.gdx.graphics.Color color)Sets the  Colorfor previous text operations | 
| void | setColor(com.badlogic.gdx.graphics.Color color)Sets the  Colorfor subsequent text operations | 
| void | setPosition(float x,
           float y)Sets the position of the cache | 
| void | setText(java.lang.CharSequence str,
       float x,
       float y)Clears all text from the cache and adds a new text sequence | 
| void | setText(java.lang.CharSequence str,
       float x,
       float y,
       float targetWidth,
       int halign,
       boolean wrap)Clears all text from the cache and adds a new text sequence | 
| void | translate(float x,
         float y)Sets the position of the text relative to its current position | 
public MonospaceFontCache(MonospaceFont monospaceFont)
public void addText(java.lang.CharSequence str,
                    float x,
                    float y)
GameFontCacheaddText in interface GameFontCachestr - The text to be addedx - The x coordinate to add the text toy - The y coordinate to add the text topublic void addText(java.lang.CharSequence str,
                    float x,
                    float y,
                    float targetWidth,
                    int halign,
                    boolean wrap)
GameFontCacheaddText in interface GameFontCachestr - The text to be addedx - The x coordinate to add the text toy - The y coordinate to add the text totargetWidth - The target width of the text (text will wrap if exceeded)halign - The horizontal alignment of the text based on Alignpublic void clear()
GameFontCacheclear in interface GameFontCachepublic void draw(Graphics g)
GameFontCacheGraphics contextdraw in interface GameFontCacheg - The Graphics context to draw topublic com.badlogic.gdx.graphics.Color getColor()
GameFontCacheColor used for subsequent text operationsgetColor in interface GameFontCacheColor to draw withpublic void setColor(com.badlogic.gdx.graphics.Color color)
GameFontCacheColor for subsequent text operationssetColor in interface GameFontCachecolor - The Color to draw withpublic void setAllColors(com.badlogic.gdx.graphics.Color color)
GameFontCacheColor for previous text operationssetAllColors in interface GameFontCachecolor - The Color to draw withpublic void setAllAlphas(float alpha)
GameFontCacheColor alpha for previous text operationssetAllAlphas in interface GameFontCachealpha - The alpha to draw withpublic void setText(java.lang.CharSequence str,
                    float x,
                    float y)
GameFontCachesetText in interface GameFontCachestr - The text to be addedx - The x coordinate to add the text toy - The y coordinate to add the text topublic void setText(java.lang.CharSequence str,
                    float x,
                    float y,
                    float targetWidth,
                    int halign,
                    boolean wrap)
GameFontCachesetText in interface GameFontCachestr - The text to be addedx - The x coordinate to add the text toy - The y coordinate to add the text totargetWidth - The target width of the text (text will wrap if exceeded)halign - The horizontal alignment of the text based on Alignwrap - True if the text should wrap when exceeding the targetWidth, false if the text should clippublic void translate(float x,
                      float y)
GameFontCachetranslate in interface GameFontCachex - The amount to move by on the x axisy - The amount to move by on the y axispublic void setPosition(float x,
                        float y)
GameFontCachesetPosition in interface GameFontCachex - The amount to move by on the x axisy - The amount to move by on the y axispublic GameFont getFont()
GameFontCacheGameFont for this cachegetFont in interface GameFontCacheGameFont this cache was created for