Subversion Repositories AndroidProjects

Rev

Blame | Last modification | View Log | RSS feed

<!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>
SpriteCache (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="SpriteCache (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>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SpriteCache.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</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">
&nbsp;<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html" title="class in com.badlogic.gdx.graphics.g2d"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureAtlas.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/SpriteCache.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="SpriteCache.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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 SpriteCache</H2>
<PRE>
java.lang.Object
  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.badlogic.gdx.graphics.g2d.SpriteCache</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>SpriteCache</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>
Draws 2D images, optimized for geometry that does not change. Sprites and/or textures are cached and given an ID, which can
 later be used for drawing. The size, color, and texture region for each cached image cannot be modified. This information is
 stored in video memory and does not have to be sent to the GPU each time it is drawn.<br>
 <br>
 To cache <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/Sprite.html" title="class in com.badlogic.gdx.graphics.g2d"><CODE>sprites</CODE></A> or <A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics"><CODE>textures</CODE></A>, first call <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#beginCache()"><CODE>beginCache()</CODE></A>, then call the
 appropriate add method to define the images. To complete the cache, call <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#endCache()"><CODE>endCache()</CODE></A> and store the returned
 cache ID.<br>
 <br>
 To draw with SpriteCache, first call <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#begin()"><CODE>begin()</CODE></A>, then call <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#draw(int)"><CODE>draw(int)</CODE></A> with a cache ID. When SpriteCache drawing
 is complete, call <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#end()"><CODE>end()</CODE></A>.<br>
 <br>
 By default, SpriteCache draws using screen coordinates and uses an x-axis pointing to the right, an y-axis pointing upwards and
 the origin is the bottom left corner of the screen. The default transformation and projection matrices can be changed. If the
 screen is <A HREF="../../../../../com/badlogic/gdx/ApplicationListener.html#resize(int, int)"><CODE>resized</CODE></A>, the SpriteCache's matrices must be updated. For example:<br>
 <code>cache.getProjectionMatrix().setToOrtho2D(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());</code><br>
 <br>
 Note that SpriteCache does not manage blending. You will need to enable blending (<i>Gdx.gl.glEnable(GL10.GL_BLEND);</i>) and
 set the blend func as needed before or between calls to <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#draw(int)"><CODE>draw(int)</CODE></A>.<br>
 <br>
 SpriteCache is managed. If the OpenGL context is lost and the restored, all OpenGL resources a SpriteCache uses internally are
 restored.<br>
 <br>
 SpriteCache is a reasonably heavyweight object. Typically only one instance should be used for an entire application.<br>
 <br>
 SpriteCache works with OpenGL ES 1.x and 2.0. For 2.0, it uses its own custom shader to draw.<br>
 <br>
 SpriteCache must be disposed once it is no longer needed.
<P>

<P>
<DL>
<DT><B>Author:</B></DT>
  <DD>Nathan Sweet</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/SpriteCache.html#SpriteCache()">SpriteCache</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a cache that uses indexed geometry and can contain up to 1000 images.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#SpriteCache(int, boolean)">SpriteCache</A></B>(int&nbsp;size,
            boolean&nbsp;useIndices)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a cache with the specified size, using a default shader if OpenGL ES 2.0 is being used.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#SpriteCache(int, com.badlogic.gdx.graphics.glutils.ShaderProgram, boolean)">SpriteCache</A></B>(int&nbsp;size,
            <A HREF="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram</A>&nbsp;shader,
            boolean&nbsp;useIndices)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a cache with the specified size and OpenGL ES 2.0 shader.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== 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>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#add(com.badlogic.gdx.graphics.g2d.Sprite)">add</A></B>(<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/Sprite.html" title="class in com.badlogic.gdx.graphics.g2d">Sprite</A>&nbsp;sprite)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds the specified sprite to the cache.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#add(com.badlogic.gdx.graphics.Texture, float[], int, int)">add</A></B>(<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture</A>&nbsp;texture,
    float[]&nbsp;vertices,
    int&nbsp;offset,
    int&nbsp;length)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds the specified vertices to the cache.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#add(com.badlogic.gdx.graphics.Texture, float, float)">add</A></B>(<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture</A>&nbsp;texture,
    float&nbsp;x,
    float&nbsp;y)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds the specified texture to the cache.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#add(com.badlogic.gdx.graphics.Texture, float, float, float, float, float, float, float, float, float, int, int, int, int, boolean, boolean)">add</A></B>(<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture</A>&nbsp;texture,
    float&nbsp;x,
    float&nbsp;y,
    float&nbsp;originX,
    float&nbsp;originY,
    float&nbsp;width,
    float&nbsp;height,
    float&nbsp;scaleX,
    float&nbsp;scaleY,
    float&nbsp;rotation,
    int&nbsp;srcX,
    int&nbsp;srcY,
    int&nbsp;srcWidth,
    int&nbsp;srcHeight,
    boolean&nbsp;flipX,
    boolean&nbsp;flipY)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds the specified texture to the cache.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#add(com.badlogic.gdx.graphics.Texture, float, float, float, float, int, int, int, int, boolean, boolean)">add</A></B>(<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture</A>&nbsp;texture,
    float&nbsp;x,
    float&nbsp;y,
    float&nbsp;width,
    float&nbsp;height,
    int&nbsp;srcX,
    int&nbsp;srcY,
    int&nbsp;srcWidth,
    int&nbsp;srcHeight,
    boolean&nbsp;flipX,
    boolean&nbsp;flipY)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds the specified texture to the cache.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#add(com.badlogic.gdx.graphics.Texture, float, float, int, int, float, float, float, float, float)">add</A></B>(<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture</A>&nbsp;texture,
    float&nbsp;x,
    float&nbsp;y,
    int&nbsp;srcWidth,
    int&nbsp;srcHeight,
    float&nbsp;u,
    float&nbsp;v,
    float&nbsp;u2,
    float&nbsp;v2,
    float&nbsp;color)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds the specified texture to the cache.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#add(com.badlogic.gdx.graphics.Texture, float, float, int, int, int, int)">add</A></B>(<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture</A>&nbsp;texture,
    float&nbsp;x,
    float&nbsp;y,
    int&nbsp;srcX,
    int&nbsp;srcY,
    int&nbsp;srcWidth,
    int&nbsp;srcHeight)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds the specified texture to the cache.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#add(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float)">add</A></B>(<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion</A>&nbsp;region,
    float&nbsp;x,
    float&nbsp;y)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds the specified region to the cache.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#add(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float)">add</A></B>(<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion</A>&nbsp;region,
    float&nbsp;x,
    float&nbsp;y,
    float&nbsp;width,
    float&nbsp;height)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds the specified region to the cache.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#add(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float, float, float, float, float, float)">add</A></B>(<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion</A>&nbsp;region,
    float&nbsp;x,
    float&nbsp;y,
    float&nbsp;originX,
    float&nbsp;originY,
    float&nbsp;width,
    float&nbsp;height,
    float&nbsp;scaleX,
    float&nbsp;scaleY,
    float&nbsp;rotation)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds the specified region to the cache.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#begin()">begin</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prepares the OpenGL state for SpriteCache rendering.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#beginCache()">beginCache</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Starts the definition of a new cache, allowing the add and <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#endCache()"><CODE>endCache()</CODE></A> methods to be called.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#beginCache(int)">beginCache</A></B>(int&nbsp;cacheID)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Starts the redefinition of an existing cache, allowing the add and <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#endCache()"><CODE>endCache()</CODE></A> methods to be called.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#clear()">clear</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Invalidates all cache IDs and resets the SpriteCache so new caches can be added.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#dispose()">dispose</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Releases all resources held by this SpriteCache.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#draw(int)">draw</A></B>(int&nbsp;cacheID)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Draws all the images defined for the specified cache ID.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#draw(int, int, int)">draw</A></B>(int&nbsp;cacheID,
     int&nbsp;offset,
     int&nbsp;length)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Draws a subset of images defined for the specified cache ID.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#end()">end</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Completes rendering for this SpriteCache.f</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#endCache()">endCache</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ends the definition of a cache, returning the cache ID to be used with <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#draw(int)"><CODE>draw(int)</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<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/SpriteCache.html#getColor()">getColor</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#getProjectionMatrix()">getProjectionMatrix</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#getTransformMatrix()">getTransformMatrix</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.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>&nbsp;tint)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the color used to tint images when they are added to the SpriteCache.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#setColor(float)">setColor</A></B>(float&nbsp;color)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#setColor(float, float, float, float)">setColor</A></B>(float&nbsp;r,
         float&nbsp;g,
         float&nbsp;b,
         float&nbsp;a)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#setProjectionMatrix(com.badlogic.gdx.math.Matrix4)">setProjectionMatrix</A></B>(<A HREF="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</A>&nbsp;projection)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#setShader(com.badlogic.gdx.graphics.glutils.ShaderProgram)">setShader</A></B>(<A HREF="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram</A>&nbsp;shader)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the shader to be used in a GLES 2.0 environment.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#setTransformMatrix(com.badlogic.gdx.math.Matrix4)">setTransformMatrix</A></B>(<A HREF="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</A>&nbsp;transform)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;<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>
&nbsp;
<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="SpriteCache()"><!-- --></A><H3>
SpriteCache</H3>
<PRE>
public <B>SpriteCache</B>()</PRE>
<DL>
<DD>Creates a cache that uses indexed geometry and can contain up to 1000 images.
<P>
</DL>
<HR>

<A NAME="SpriteCache(int, boolean)"><!-- --></A><H3>
SpriteCache</H3>
<PRE>
public <B>SpriteCache</B>(int&nbsp;size,
                   boolean&nbsp;useIndices)</PRE>
<DL>
<DD>Creates a cache with the specified size, using a default shader if OpenGL ES 2.0 is being used.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>size</CODE> - The maximum number of images this cache can hold. The memory required to hold the images is allocated up front.<DD><CODE>useIndices</CODE> - If true, indexed geometry will be used.</DL>
</DL>
<HR>

<A NAME="SpriteCache(int, com.badlogic.gdx.graphics.glutils.ShaderProgram, boolean)"><!-- --></A><H3>
SpriteCache</H3>
<PRE>
public <B>SpriteCache</B>(int&nbsp;size,
                   <A HREF="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram</A>&nbsp;shader,
                   boolean&nbsp;useIndices)</PRE>
<DL>
<DD>Creates a cache with the specified size and OpenGL ES 2.0 shader.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>size</CODE> - The maximum number of images this cache can hold. The memory required to hold the images is allocated up front.<DD><CODE>useIndices</CODE> - If true, indexed geometry will be used.</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="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>&nbsp;tint)</PRE>
<DL>
<DD>Sets the color used to tint images when they are added to the SpriteCache. Default is <A HREF="../../../../../com/badlogic/gdx/graphics/Color.html#WHITE"><CODE>Color.WHITE</CODE></A>.
<P>
<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&nbsp;r,
                     float&nbsp;g,
                     float&nbsp;b,
                     float&nbsp;a)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#setColor(com.badlogic.gdx.graphics.Color)"><CODE>setColor(Color)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setColor(float)"><!-- --></A><H3>
setColor</H3>
<PRE>
public void <B>setColor</B>(float&nbsp;color)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#setColor(com.badlogic.gdx.graphics.Color)"><CODE>setColor(Color)</CODE></A>,
<A HREF="../../../../../com/badlogic/gdx/graphics/Color.html#toFloatBits()"><CODE>Color.toFloatBits()</CODE></A></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="beginCache()"><!-- --></A><H3>
beginCache</H3>
<PRE>
public void <B>beginCache</B>()</PRE>
<DL>
<DD>Starts the definition of a new cache, allowing the add and <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#endCache()"><CODE>endCache()</CODE></A> methods to be called.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="beginCache(int)"><!-- --></A><H3>
beginCache</H3>
<PRE>
public void <B>beginCache</B>(int&nbsp;cacheID)</PRE>
<DL>
<DD>Starts the redefinition of an existing cache, allowing the add and <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#endCache()"><CODE>endCache()</CODE></A> methods to be called. If this is not
 the last cache created, it cannot have more entries added to it than when it was first created. To do that, use
 <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#clear()"><CODE>clear()</CODE></A> and then <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#begin()"><CODE>begin()</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="endCache()"><!-- --></A><H3>
endCache</H3>
<PRE>
public int <B>endCache</B>()</PRE>
<DL>
<DD>Ends the definition of a cache, returning the cache ID to be used with <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html#draw(int)"><CODE>draw(int)</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="clear()"><!-- --></A><H3>
clear</H3>
<PRE>
public void <B>clear</B>()</PRE>
<DL>
<DD>Invalidates all cache IDs and resets the SpriteCache so new caches can be added.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="add(com.badlogic.gdx.graphics.Texture, float[], int, int)"><!-- --></A><H3>
add</H3>
<PRE>
public void <B>add</B>(<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture</A>&nbsp;texture,
                float[]&nbsp;vertices,
                int&nbsp;offset,
                int&nbsp;length)</PRE>
<DL>
<DD>Adds the specified vertices to the cache. Each vertex should have 5 elements, one for each of the attributes: x, y, color,
 u, and v. If indexed geometry is used, each image should be specified as 4 vertices, otherwise each image should be
 specified as 6 vertices.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="add(com.badlogic.gdx.graphics.Texture, float, float)"><!-- --></A><H3>
add</H3>
<PRE>
public void <B>add</B>(<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture</A>&nbsp;texture,
                float&nbsp;x,
                float&nbsp;y)</PRE>
<DL>
<DD>Adds the specified texture to the cache.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="add(com.badlogic.gdx.graphics.Texture, float, float, int, int, float, float, float, float, float)"><!-- --></A><H3>
add</H3>
<PRE>
public void <B>add</B>(<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture</A>&nbsp;texture,
                float&nbsp;x,
                float&nbsp;y,
                int&nbsp;srcWidth,
                int&nbsp;srcHeight,
                float&nbsp;u,
                float&nbsp;v,
                float&nbsp;u2,
                float&nbsp;v2,
                float&nbsp;color)</PRE>
<DL>
<DD>Adds the specified texture to the cache.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="add(com.badlogic.gdx.graphics.Texture, float, float, int, int, int, int)"><!-- --></A><H3>
add</H3>
<PRE>
public void <B>add</B>(<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture</A>&nbsp;texture,
                float&nbsp;x,
                float&nbsp;y,
                int&nbsp;srcX,
                int&nbsp;srcY,
                int&nbsp;srcWidth,
                int&nbsp;srcHeight)</PRE>
<DL>
<DD>Adds the specified texture to the cache.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="add(com.badlogic.gdx.graphics.Texture, float, float, float, float, int, int, int, int, boolean, boolean)"><!-- --></A><H3>
add</H3>
<PRE>
public void <B>add</B>(<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture</A>&nbsp;texture,
                float&nbsp;x,
                float&nbsp;y,
                float&nbsp;width,
                float&nbsp;height,
                int&nbsp;srcX,
                int&nbsp;srcY,
                int&nbsp;srcWidth,
                int&nbsp;srcHeight,
                boolean&nbsp;flipX,
                boolean&nbsp;flipY)</PRE>
<DL>
<DD>Adds the specified texture to the cache.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="add(com.badlogic.gdx.graphics.Texture, float, float, float, float, float, float, float, float, float, int, int, int, int, boolean, boolean)"><!-- --></A><H3>
add</H3>
<PRE>
public void <B>add</B>(<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture</A>&nbsp;texture,
                float&nbsp;x,
                float&nbsp;y,
                float&nbsp;originX,
                float&nbsp;originY,
                float&nbsp;width,
                float&nbsp;height,
                float&nbsp;scaleX,
                float&nbsp;scaleY,
                float&nbsp;rotation,
                int&nbsp;srcX,
                int&nbsp;srcY,
                int&nbsp;srcWidth,
                int&nbsp;srcHeight,
                boolean&nbsp;flipX,
                boolean&nbsp;flipY)</PRE>
<DL>
<DD>Adds the specified texture to the cache.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="add(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float)"><!-- --></A><H3>
add</H3>
<PRE>
public void <B>add</B>(<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion</A>&nbsp;region,
                float&nbsp;x,
                float&nbsp;y)</PRE>
<DL>
<DD>Adds the specified region to the cache.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="add(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float)"><!-- --></A><H3>
add</H3>
<PRE>
public void <B>add</B>(<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion</A>&nbsp;region,
                float&nbsp;x,
                float&nbsp;y,
                float&nbsp;width,
                float&nbsp;height)</PRE>
<DL>
<DD>Adds the specified region to the cache.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="add(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float, float, float, float, float, float)"><!-- --></A><H3>
add</H3>
<PRE>
public void <B>add</B>(<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion</A>&nbsp;region,
                float&nbsp;x,
                float&nbsp;y,
                float&nbsp;originX,
                float&nbsp;originY,
                float&nbsp;width,
                float&nbsp;height,
                float&nbsp;scaleX,
                float&nbsp;scaleY,
                float&nbsp;rotation)</PRE>
<DL>
<DD>Adds the specified region to the cache.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="add(com.badlogic.gdx.graphics.g2d.Sprite)"><!-- --></A><H3>
add</H3>
<PRE>
public void <B>add</B>(<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/Sprite.html" title="class in com.badlogic.gdx.graphics.g2d">Sprite</A>&nbsp;sprite)</PRE>
<DL>
<DD>Adds the specified sprite to the cache.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="begin()"><!-- --></A><H3>
begin</H3>
<PRE>
public void <B>begin</B>()</PRE>
<DL>
<DD>Prepares the OpenGL state for SpriteCache rendering.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="end()"><!-- --></A><H3>
end</H3>
<PRE>
public void <B>end</B>()</PRE>
<DL>
<DD>Completes rendering for this SpriteCache.f
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="draw(int)"><!-- --></A><H3>
draw</H3>
<PRE>
public void <B>draw</B>(int&nbsp;cacheID)</PRE>
<DL>
<DD>Draws all the images defined for the specified cache ID.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="draw(int, int, int)"><!-- --></A><H3>
draw</H3>
<PRE>
public void <B>draw</B>(int&nbsp;cacheID,
                 int&nbsp;offset,
                 int&nbsp;length)</PRE>
<DL>
<DD>Draws a subset of images defined for the specified cache ID.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>offset</CODE> - The first image to render.<DD><CODE>length</CODE> - The number of images from the first image (inclusive) to render.</DL>
</DD>
</DL>
<HR>

<A NAME="dispose()"><!-- --></A><H3>
dispose</H3>
<PRE>
public void <B>dispose</B>()</PRE>
<DL>
<DD>Releases all resources held by this SpriteCache.
<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="getProjectionMatrix()"><!-- --></A><H3>
getProjectionMatrix</H3>
<PRE>
public <A HREF="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</A> <B>getProjectionMatrix</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="setProjectionMatrix(com.badlogic.gdx.math.Matrix4)"><!-- --></A><H3>
setProjectionMatrix</H3>
<PRE>
public void <B>setProjectionMatrix</B>(<A HREF="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</A>&nbsp;projection)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getTransformMatrix()"><!-- --></A><H3>
getTransformMatrix</H3>
<PRE>
public <A HREF="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</A> <B>getTransformMatrix</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="setTransformMatrix(com.badlogic.gdx.math.Matrix4)"><!-- --></A><H3>
setTransformMatrix</H3>
<PRE>
public void <B>setTransformMatrix</B>(<A HREF="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</A>&nbsp;transform)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="setShader(com.badlogic.gdx.graphics.glutils.ShaderProgram)"><!-- --></A><H3>
setShader</H3>
<PRE>
public void <B>setShader</B>(<A HREF="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram</A>&nbsp;shader)</PRE>
<DL>
<DD>Sets the shader to be used in a GLES 2.0 environment. Vertex position attribute is called "a_position", the texture
 coordinates attribute is called called "a_texCoords", the color attribute is called "a_color". The projection matrix is
 uploaded via a mat4 uniform called "u_proj", the transform matrix is uploaded via a uniform called "u_trans", the combined
 transform and projection matrx is is uploaded via a mat4 uniform called "u_projTrans". The texture sampler is passed via a
 uniform called "u_texture".
 
 Call this method with a null argument to use the default shader.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>shader</CODE> - the <A HREF="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils"><CODE>ShaderProgram</CODE></A> or null to use the default shader.</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>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SpriteCache.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</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">
&nbsp;<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html" title="class in com.badlogic.gdx.graphics.g2d"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureAtlas.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/SpriteCache.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="SpriteCache.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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>