<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Sun Jun 03 02:18:10 CEST 2012 -->
<TITLE>
BitmapFontCache (libgdx API)
</TITLE>
<META NAME="date" CONTENT="2012-06-03">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="BitmapFontCache (libgdx API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package
</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class
</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/BitmapFontCache.html"><FONT CLASS="NavBarFont1"><B>Use
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help
</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
libgdx API
<style>
body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt }
pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif }
h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%; font-weight:bold }
.TableHeadingColor { background:#EEEEFF; }
a { text-decoration:none }
a:hover { text-decoration:underline }
a:link, a:visited { color:blue }
table { border:0px }
.TableRowColor td:first-child { border-left:1px solid black }
.TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black }
hr { border:0px; border-bottom:1px solid #333366; }
</style>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d"><B>PREV CLASS
</B></A>
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/EmptyNinePatch.html" title="class in com.badlogic.gdx.graphics.g2d"><B>NEXT CLASS
</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?com/badlogic/gdx/graphics/g2d/BitmapFontCache.html" target="_top"><B>FRAMES
</B></A>
<A HREF="BitmapFontCache.html" target="_top"><B>NO FRAMES
</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes
</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:
NESTED
|
FIELD
|
<A HREF="#constructor_summary">CONSTR
</A> |
<A HREF="#method_summary">METHOD
</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:
FIELD
|
<A HREF="#constructor_detail">CONSTR
</A> |
<A HREF="#method_detail">METHOD
</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.badlogic.gdx.graphics.g2d
</FONT>
<BR>
Class BitmapFontCache
</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.badlogic.gdx.graphics.g2d.BitmapFontCache
</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:
</B> <DD><A HREF="../../../../../com/badlogic/gdx/utils/Disposable.html" title="interface in com.badlogic.gdx.utils">Disposable
</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class
<B>BitmapFontCache
</B><DT>extends java.lang.Object
<DT>implements
<A HREF="../../../../../com/badlogic/gdx/utils/Disposable.html" title="interface in com.badlogic.gdx.utils">Disposable
</A></DL>
</PRE>
<P>
Caches glyph geometry for a BitmapFont, providing a fast way to render static text. This saves needing to compute the location
of each glyph each frame.
<P>
<P>
<DL>
<DT><B>Author:
</B></DT>
<DD>Nathan Sweet, Matthias Mann
</DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary
</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#BitmapFontCache(com.badlogic.gdx.graphics.g2d.BitmapFont)">BitmapFontCache
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont
</A> font)
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#BitmapFontCache(com.badlogic.gdx.graphics.g2d.BitmapFont, boolean)">BitmapFontCache
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont
</A> font,
boolean
integer)
</CODE>
<BR>
Creates a new BitmapFontCache
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary
</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#dispose()">dispose
</A></B>()
</CODE>
<BR>
Disposes the underlying BitmapFont of this cache.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#draw(com.badlogic.gdx.graphics.g2d.SpriteBatch)">draw
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html" title="class in com.badlogic.gdx.graphics.g2d">SpriteBatch
</A> spriteBatch)
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#draw(com.badlogic.gdx.graphics.g2d.SpriteBatch, float)">draw
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html" title="class in com.badlogic.gdx.graphics.g2d">SpriteBatch
</A> spriteBatch,
float
alphaModulation)
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont.TextBounds
</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#getBounds()">getBounds
</A></B>()
</CODE>
<BR>
Returns the size of the cached string.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#getColor()">getColor
</A></B>()
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont
</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#getFont()">getFont
</A></B>()
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> float
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#getX()">getX
</A></B>()
</CODE>
<BR>
Returns the x position of the cached string, relative to the position when the string was cached.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> float
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#getY()">getY
</A></B>()
</CODE>
<BR>
Returns the y position of the cached string, relative to the position when the string was cached.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#setColor(com.badlogic.gdx.graphics.Color)">setColor
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</A> tint)
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#setColor(float)">setColor
</A></B>(float
color)
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#setColor(float, float, float, float)">setColor
</A></B>(float
r,
float
g,
float
b,
float
a)
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont.TextBounds
</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#setMultiLineText(java.lang.CharSequence, float, float)">setMultiLineText
</A></B>(java.lang.CharSequence
str,
float
x,
float
y)
</CODE>
<BR>
Caches a string, which may contain newlines (\n), with the specified position.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont.TextBounds
</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#setMultiLineText(java.lang.CharSequence, float, float, float, com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment)">setMultiLineText
</A></B>(java.lang.CharSequence
str,
float
x,
float
y,
float
alignmentWidth,
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.HAlignment.html" title="enum in com.badlogic.gdx.graphics.g2d">BitmapFont.HAlignment
</A> alignment)
</CODE>
<BR>
Caches a string, which may contain newlines (\n), with the specified position and alignment.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#setPosition(float, float)">setPosition
</A></B>(float
x,
float
y)
</CODE>
<BR>
Sets the position of the text, relative to the position when the cached text was created.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont.TextBounds
</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#setText(java.lang.CharSequence, float, float)">setText
</A></B>(java.lang.CharSequence
str,
float
x,
float
y)
</CODE>
<BR>
Caches a string with the specified position.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont.TextBounds
</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#setText(java.lang.CharSequence, float, float, int, int)">setText
</A></B>(java.lang.CharSequence
str,
float
x,
float
y,
int
start,
int
end)
</CODE>
<BR>
Caches a substring with the specified position.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#setUseIntegerPositions(boolean)">setUseIntegerPositions
</A></B>(boolean
use)
</CODE>
<BR>
Specifies whether to use integer positions or not.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont.TextBounds
</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#setWrappedText(java.lang.CharSequence, float, float, float)">setWrappedText
</A></B>(java.lang.CharSequence
str,
float
x,
float
y,
float
wrapWidth)
</CODE>
<BR>
Caches a string, which may contain newlines (\n), with the specified position.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont.TextBounds
</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#setWrappedText(java.lang.CharSequence, float, float, float, com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment)">setWrappedText
</A></B>(java.lang.CharSequence
str,
float
x,
float
y,
float
wrapWidth,
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.HAlignment.html" title="enum in com.badlogic.gdx.graphics.g2d">BitmapFont.HAlignment
</A> alignment)
</CODE>
<BR>
Caches a string, which may contain newlines (\n), with the specified position.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#translate(float, float)">translate
</A></B>(float
xAmount,
float
yAmount)
</CODE>
<BR>
Sets the position of the text, relative to its current position.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFontCache.html#usesIntegerPositions()">usesIntegerPositions
</A></B>()
</CODE>
<BR>
</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object
</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail
</B></FONT></TH>
</TR>
</TABLE>
<A NAME="BitmapFontCache(com.badlogic.gdx.graphics.g2d.BitmapFont)"><!-- --></A><H3>
BitmapFontCache
</H3>
<PRE>
public
<B>BitmapFontCache
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont
</A> font)
</PRE>
<DL>
</DL>
<HR>
<A NAME="BitmapFontCache(com.badlogic.gdx.graphics.g2d.BitmapFont, boolean)"><!-- --></A><H3>
BitmapFontCache
</H3>
<PRE>
public
<B>BitmapFontCache
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont
</A> font,
boolean
integer)
</PRE>
<DL>
<DD>Creates a new BitmapFontCache
<P>
<DL>
<DT><B>Parameters:
</B><DD><CODE>font
</CODE> - the font to use
<DD><CODE>integer
</CODE> - whether to use integer positions and sizes.
</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail
</B></FONT></TH>
</TR>
</TABLE>
<A NAME="setPosition(float, float)"><!-- --></A><H3>
setPosition
</H3>
<PRE>
public void
<B>setPosition
</B>(float
x,
float
y)
</PRE>
<DL>
<DD>Sets the position of the text, relative to the position when the cached text was created.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>x
</CODE> - The x coordinate
<DD><CODE>y
</CODE> - The y coodinate
</DL>
</DD>
</DL>
<HR>
<A NAME="translate(float, float)"><!-- --></A><H3>
translate
</H3>
<PRE>
public void
<B>translate
</B>(float
xAmount,
float
yAmount)
</PRE>
<DL>
<DD>Sets the position of the text, relative to its current position.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>xAmount
</CODE> - The amount in x to move the text
<DD><CODE>yAmount
</CODE> - The amount in y to move the text
</DL>
</DD>
</DL>
<HR>
<A NAME="setColor(float)"><!-- --></A><H3>
setColor
</H3>
<PRE>
public void
<B>setColor
</B>(float
color)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setColor(com.badlogic.gdx.graphics.Color)"><!-- --></A><H3>
setColor
</H3>
<PRE>
public void
<B>setColor
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</A> tint)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setColor(float, float, float, float)"><!-- --></A><H3>
setColor
</H3>
<PRE>
public void
<B>setColor
</B>(float
r,
float
g,
float
b,
float
a)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="draw(com.badlogic.gdx.graphics.g2d.SpriteBatch)"><!-- --></A><H3>
draw
</H3>
<PRE>
public void
<B>draw
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html" title="class in com.badlogic.gdx.graphics.g2d">SpriteBatch
</A> spriteBatch)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="draw(com.badlogic.gdx.graphics.g2d.SpriteBatch, float)"><!-- --></A><H3>
draw
</H3>
<PRE>
public void
<B>draw
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html" title="class in com.badlogic.gdx.graphics.g2d">SpriteBatch
</A> spriteBatch,
float
alphaModulation)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getColor()"><!-- --></A><H3>
getColor
</H3>
<PRE>
public
<A HREF="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</A> <B>getColor
</B>()
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setText(java.lang.CharSequence, float, float)"><!-- --></A><H3>
setText
</H3>
<PRE>
public
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont.TextBounds
</A> <B>setText
</B>(java.lang.CharSequence
str,
float
x,
float
y)
</PRE>
<DL>
<DD>Caches a string with the specified position.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>x
</CODE> - The x position for the left most character.
<DD><CODE>y
</CODE> - The y position for the top of most capital letters in the font (the
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.html#getCapHeight()"><CODE>cap height
</CODE></A>).
<DT><B>Returns:
</B><DD>The bounds of the cached string (the height is the distance from y to the baseline).
</DL>
</DD>
</DL>
<HR>
<A NAME="setText(java.lang.CharSequence, float, float, int, int)"><!-- --></A><H3>
setText
</H3>
<PRE>
public
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont.TextBounds
</A> <B>setText
</B>(java.lang.CharSequence
str,
float
x,
float
y,
int
start,
int
end)
</PRE>
<DL>
<DD>Caches a substring with the specified position.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>x
</CODE> - The x position for the left most character.
<DD><CODE>y
</CODE> - The y position for the top of most capital letters in the font (the
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.html#getCapHeight()"><CODE>cap height
</CODE></A>).
<DD><CODE>start
</CODE> - The first character of the string to draw.
<DD><CODE>end
</CODE> - The last character of the string to draw (exclusive).
<DT><B>Returns:
</B><DD>The bounds of the cached string (the height is the distance from y to the baseline).
</DL>
</DD>
</DL>
<HR>
<A NAME="setMultiLineText(java.lang.CharSequence, float, float)"><!-- --></A><H3>
setMultiLineText
</H3>
<PRE>
public
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont.TextBounds
</A> <B>setMultiLineText
</B>(java.lang.CharSequence
str,
float
x,
float
y)
</PRE>
<DL>
<DD>Caches a string, which may contain newlines (\n), with the specified position.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>x
</CODE> - The x position for the left most character.
<DD><CODE>y
</CODE> - The y position for the top of most capital letters in the font (the
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.html#getCapHeight()"><CODE>cap height
</CODE></A>).
<DT><B>Returns:
</B><DD>The bounds of the cached string (the height is the distance from y to the baseline of the last line).
</DL>
</DD>
</DL>
<HR>
<A NAME="setMultiLineText(java.lang.CharSequence, float, float, float, com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment)"><!-- --></A><H3>
setMultiLineText
</H3>
<PRE>
public
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont.TextBounds
</A> <B>setMultiLineText
</B>(java.lang.CharSequence
str,
float
x,
float
y,
float
alignmentWidth,
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.HAlignment.html" title="enum in com.badlogic.gdx.graphics.g2d">BitmapFont.HAlignment
</A> alignment)
</PRE>
<DL>
<DD>Caches a string, which may contain newlines (\n), with the specified position and alignment. Each line is aligned
horizontally within a rectangle of the specified width.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>x
</CODE> - The x position for the left most character.
<DD><CODE>y
</CODE> - The y position for the top of most capital letters in the font (the
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.html#getCapHeight()"><CODE>cap height
</CODE></A>).
<DT><B>Returns:
</B><DD>The bounds of the cached string (the height is the distance from y to the baseline of the last line).
</DL>
</DD>
</DL>
<HR>
<A NAME="setWrappedText(java.lang.CharSequence, float, float, float)"><!-- --></A><H3>
setWrappedText
</H3>
<PRE>
public
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont.TextBounds
</A> <B>setWrappedText
</B>(java.lang.CharSequence
str,
float
x,
float
y,
float
wrapWidth)
</PRE>
<DL>
<DD>Caches a string, which may contain newlines (\n), with the specified position. Each line is automatically wrapped to keep it
within a rectangle of the specified width.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>x
</CODE> - The x position for the left most character.
<DD><CODE>y
</CODE> - The y position for the top of most capital letters in the font (the
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.html#getCapHeight()"><CODE>cap height
</CODE></A>).
<DT><B>Returns:
</B><DD>The bounds of the cached string (the height is the distance from y to the baseline of the last line).
</DL>
</DD>
</DL>
<HR>
<A NAME="setWrappedText(java.lang.CharSequence, float, float, float, com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment)"><!-- --></A><H3>
setWrappedText
</H3>
<PRE>
public
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont.TextBounds
</A> <B>setWrappedText
</B>(java.lang.CharSequence
str,
float
x,
float
y,
float
wrapWidth,
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.HAlignment.html" title="enum in com.badlogic.gdx.graphics.g2d">BitmapFont.HAlignment
</A> alignment)
</PRE>
<DL>
<DD>Caches a string, which may contain newlines (\n), with the specified position. Each line is automatically wrapped to keep it
within a rectangle of the specified width, and aligned horizontally within that rectangle.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>x
</CODE> - The x position for the left most character.
<DD><CODE>y
</CODE> - The y position for the top of most capital letters in the font (the
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.html#getCapHeight()"><CODE>cap height
</CODE></A>).
<DT><B>Returns:
</B><DD>The bounds of the cached string (the height is the distance from y to the baseline of the last line).
</DL>
</DD>
</DL>
<HR>
<A NAME="getBounds()"><!-- --></A><H3>
getBounds
</H3>
<PRE>
public
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont.TextBounds
</A> <B>getBounds
</B>()
</PRE>
<DL>
<DD>Returns the size of the cached string. The height is the distance from the top of most capital letters in the font (the
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.html#getCapHeight()"><CODE>cap height
</CODE></A>) to the baseline of the last line of text.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getX()"><!-- --></A><H3>
getX
</H3>
<PRE>
public float
<B>getX
</B>()
</PRE>
<DL>
<DD>Returns the x position of the cached string, relative to the position when the string was cached.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getY()"><!-- --></A><H3>
getY
</H3>
<PRE>
public float
<B>getY
</B>()
</PRE>
<DL>
<DD>Returns the y position of the cached string, relative to the position when the string was cached.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getFont()"><!-- --></A><H3>
getFont
</H3>
<PRE>
public
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.html" title="class in com.badlogic.gdx.graphics.g2d">BitmapFont
</A> <B>getFont
</B>()
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="dispose()"><!-- --></A><H3>
dispose
</H3>
<PRE>
public void
<B>dispose
</B>()
</PRE>
<DL>
<DD>Disposes the underlying BitmapFont of this cache.
<P>
<DD><DL>
<DT><B>Specified by:
</B><DD><CODE><A HREF="../../../../../com/badlogic/gdx/utils/Disposable.html#dispose()">dispose
</A></CODE> in interface
<CODE><A HREF="../../../../../com/badlogic/gdx/utils/Disposable.html" title="interface in com.badlogic.gdx.utils">Disposable
</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setUseIntegerPositions(boolean)"><!-- --></A><H3>
setUseIntegerPositions
</H3>
<PRE>
public void
<B>setUseIntegerPositions
</B>(boolean
use)
</PRE>
<DL>
<DD>Specifies whether to use integer positions or not. Default is to use them so filtering doesn't kick in as badly.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>use
</CODE> -
</DL>
</DD>
</DL>
<HR>
<A NAME="usesIntegerPositions()"><!-- --></A><H3>
usesIntegerPositions
</H3>
<PRE>
public boolean
<B>usesIntegerPositions
</B>()
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:
</B><DD>whether this font uses integer positions for drawing.
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package
</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class
</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/BitmapFontCache.html"><FONT CLASS="NavBarFont1"><B>Use
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help
</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
libgdx API
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/BitmapFont.TextBounds.html" title="class in com.badlogic.gdx.graphics.g2d"><B>PREV CLASS
</B></A>
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/EmptyNinePatch.html" title="class in com.badlogic.gdx.graphics.g2d"><B>NEXT CLASS
</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?com/badlogic/gdx/graphics/g2d/BitmapFontCache.html" target="_top"><B>FRAMES
</B></A>
<A HREF="BitmapFontCache.html" target="_top"><B>NO FRAMES
</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes
</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:
NESTED
|
FIELD
|
<A HREF="#constructor_summary">CONSTR
</A> |
<A HREF="#method_summary">METHOD
</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:
FIELD
|
<A HREF="#constructor_detail">CONSTR
</A> |
<A HREF="#method_detail">METHOD
</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<div style="font-size:9pt"><i>
Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)
</i></div>
</BODY>
</HTML>