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 lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_17) on Sun Nov 03 15:35:45 CET 2013 -->
<title>SpriteBatch (libgdx API)</title>
<meta name="date" content="2013-11-03">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
   if (location.href.indexOf('is-external=true') == -1) {
       parent.document.title="SpriteBatch (libgdx API)";
   }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/SpriteBatch.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><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></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/badlogic/gdx/graphics/g2d/Sprite.html" title="class in com.badlogic.gdx.graphics.g2d"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html" title="class in com.badlogic.gdx.graphics.g2d"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/badlogic/gdx/graphics/g2d/SpriteBatch.html" target="_top">Frames</a></li>
<li><a href="SpriteBatch.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
 allClassesLink = document.getElementById("allclasses_navbar_top");
 if(window==top) {
   allClassesLink.style.display = "block";
 }
 else {
   allClassesLink.style.display = "none";
 }
 //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.badlogic.gdx.graphics.g2d</div>
<h2 title="Class SpriteBatch" class="title">Class SpriteBatch</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.badlogic.gdx.graphics.g2d.SpriteBatch</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../../com/badlogic/gdx/utils/Disposable.html" title="interface in com.badlogic.gdx.utils">Disposable</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">SpriteBatch</span>
extends java.lang.Object
implements <a href="../../../../../com/badlogic/gdx/utils/Disposable.html" title="interface in com.badlogic.gdx.utils">Disposable</a></pre>
<div class="block">A SpriteBatch is used to draw 2D rectangles that reference a texture (region). The class will batch the drawing commands and
 optimize them for processing by the GPU.
 <p>
 To draw something with a SpriteBatch one has to first call the <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#begin()"><code>begin()</code></a> method which will setup appropriate
 render states. When you are done with drawing you have to call <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#end()"><code>end()</code></a> which will actually draw the things
 you specified.
 <p>
 All drawing commands of the SpriteBatch operate in screen coordinates. The screen coordinate system has an x-axis pointing to
 the right, an y-axis pointing upwards and the origin is in the lower left corner of the screen. You can also provide your own
 transformation and projection matrices if you so wish.
 <p>
 A SpriteBatch is managed. In case the OpenGL context is lost all OpenGL resources a SpriteBatch uses internally get
 invalidated. A context is lost when a user switches to another application or receives an incoming call on Android. A
 SpriteBatch will be automatically reloaded after the OpenGL context is restored.
 <p>
 A SpriteBatch is a pretty heavy object so you should only ever have one in your program.
 <p>
 A SpriteBatch works with OpenGL ES 1.x and 2.0. In the case of a 2.0 context it will use its own custom shader to draw all
 provided sprites. You can set your own custom shader via <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setShader(com.badlogic.gdx.graphics.glutils.ShaderProgram)"><code>setShader(ShaderProgram)</code></a>.
 <p>
 A SpriteBatch has to be disposed if it is no longer used.</div>
<dl><dt><span class="strong">Author:</span></dt>
  <dd>mzechner</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#C1">C1</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#C2">C2</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#C3">C3</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#C4">C4</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#maxSpritesInBatch">maxSpritesInBatch</a></strong></code>
<div class="block">The maximum number of sprites rendered in one batch so far.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#renderCalls">renderCalls</a></strong></code>
<div class="block">Number of render calls since the last <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#begin()"><code>begin()</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#totalRenderCalls">totalRenderCalls</a></strong></code>
<div class="block">Number of rendering calls, ever.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#U1">U1</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#U2">U2</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#U3">U3</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#U4">U4</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#V1">V1</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#V2">V2</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#V3">V3</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#V4">V4</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#X1">X1</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#X2">X2</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#X3">X3</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#X4">X4</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#Y1">Y1</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#Y2">Y2</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#Y3">Y3</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#Y4">Y4</a></strong></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#SpriteBatch()">SpriteBatch</a></strong>()</code>
<div class="block">Constructs a new SpriteBatch with a size of 1000, one buffer, and the default shader.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#SpriteBatch(int)">SpriteBatch</a></strong>(int&nbsp;size)</code>
<div class="block">Constructs a SpriteBatch with one buffer and the default shader.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#SpriteBatch(int, int)">SpriteBatch</a></strong>(int&nbsp;size,
           int&nbsp;buffers)</code>
<div class="block">Constructs a SpriteBatch with the default shader.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#SpriteBatch(int, int, com.badlogic.gdx.graphics.glutils.ShaderProgram)">SpriteBatch</a></strong>(int&nbsp;size,
           int&nbsp;buffers,
           <a href="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram</a>&nbsp;defaultShader)</code>
<div class="block">Constructs a new SpriteBatch.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#SpriteBatch(int, com.badlogic.gdx.graphics.glutils.ShaderProgram)">SpriteBatch</a></strong>(int&nbsp;size,
           <a href="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram</a>&nbsp;defaultShader)</code>
<div class="block">Constructs a new SpriteBatch with one buffer.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#begin()">begin</a></strong>()</code>
<div class="block">Sets up the SpriteBatch for drawing.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#createDefaultShader()">createDefaultShader</a></strong>()</code>
<div class="block">Returns a new instance of the default shader used by SpriteBatch for GL2 when no shader is specified.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#disableBlending()">disableBlending</a></strong>()</code>
<div class="block">Disables blending for drawing sprites.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#dispose()">dispose</a></strong>()</code>
<div class="block">Disposes all resources associated with this SpriteBatch.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.Texture, float[], int, int)">draw</a></strong>(<a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture</a>&nbsp;texture,
    float[]&nbsp;spriteVertices,
    int&nbsp;offset,
    int&nbsp;count)</code>
<div class="block">Draws a rectangle using the given vertices.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.Texture, float, float)">draw</a></strong>(<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>
<div class="block">Draws a rectangle with the bottom left corner at x,y having the width and height of the texture.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.Texture, float, float, float, float)">draw</a></strong>(<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)</code>
<div class="block">Draws a rectangle with the bottom left corner at x,y and stretching the region to cover the given width and height.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.Texture, float, float, float, float, float, float, float, float)">draw</a></strong>(<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,
    float&nbsp;u,
    float&nbsp;v,
    float&nbsp;u2,
    float&nbsp;v2)</code>
<div class="block">Draws a rectangle with the bottom left corner at x,y having the given width and height in pixels.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.Texture, float, float, float, float, float, float, float, float, float, int, int, int, int, boolean, boolean)">draw</a></strong>(<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>
<div class="block">Draws a rectangle with the bottom left corner at x,y having the given width and height in pixels.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.Texture, float, float, float, float, int, int, int, int, boolean, boolean)">draw</a></strong>(<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>
<div class="block">Draws a rectangle with the bottom left corner at x,y having the given width and height in pixels.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.Texture, float, float, int, int, int, int)">draw</a></strong>(<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>
<div class="block">Draws a rectangle with the bottom left corner at x,y having the given width and height in pixels.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float)">draw</a></strong>(<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>
<div class="block">Draws a rectangle with the bottom left corner at x,y having the width and height of the region.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float)">draw</a></strong>(<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>
<div class="block">Draws a rectangle with the bottom left corner at x,y and stretching the region to cover the given width and height.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float, float, float, float, float, float)">draw</a></strong>(<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>
<div class="block">Draws a rectangle with the bottom left corner at x,y and stretching the region to cover the given width and height.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float, float, float, float, float, float, boolean)">draw</a></strong>(<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,
    boolean&nbsp;clockwise)</code>
<div class="block">Draws a rectangle with the texture coordinates rotated 90 degrees.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#enableBlending()">enableBlending</a></strong>()</code>
<div class="block">Enables blending for drawing sprites.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#end()">end</a></strong>()</code>
<div class="block">Finishes off rendering.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#flush()">flush</a></strong>()</code>
<div class="block">Causes any pending sprites to be rendered, without ending the SpriteBatch.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#getBlendDstFunc()">getBlendDstFunc</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#getBlendSrcFunc()">getBlendSrcFunc</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#getColor()">getColor</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#getProjectionMatrix()">getProjectionMatrix</a></strong>()</code>
<div class="block">Returns the current projection matrix.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#getTransformMatrix()">getTransformMatrix</a></strong>()</code>
<div class="block">Returns the current transform matrix.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#isBlendingEnabled()">isBlendingEnabled</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setBlendFunction(int, int)">setBlendFunction</a></strong>(int&nbsp;srcFunc,
                int&nbsp;dstFunc)</code>
<div class="block">Sets the blending function to be used when rendering sprites.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setColor(com.badlogic.gdx.graphics.Color)">setColor</a></strong>(<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color</a>&nbsp;tint)</code>
<div class="block">Sets the color used to tint images when they are added to the SpriteBatch.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setColor(float)">setColor</a></strong>(float&nbsp;color)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setColor(float, float, float, float)">setColor</a></strong>(float&nbsp;r,
        float&nbsp;g,
        float&nbsp;b,
        float&nbsp;a)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setProjectionMatrix(com.badlogic.gdx.math.Matrix4)">setProjectionMatrix</a></strong>(<a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</a>&nbsp;projection)</code>
<div class="block">Sets the projection matrix to be used by this SpriteBatch.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setShader(com.badlogic.gdx.graphics.glutils.ShaderProgram)">setShader</a></strong>(<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram</a>&nbsp;shader)</code>
<div class="block">Sets the shader to be used in a GLES 2.0 environment.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setTransformMatrix(com.badlogic.gdx.math.Matrix4)">setTransformMatrix</a></strong>(<a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</a>&nbsp;transform)</code>
<div class="block">Sets the transform matrix to be used by this SpriteBatch.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a name="renderCalls">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>renderCalls</h4>
<pre>public&nbsp;int renderCalls</pre>
<div class="block">Number of render calls since the last <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#begin()"><code>begin()</code></a>.</div>
</li>
</ul>
<a name="totalRenderCalls">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>totalRenderCalls</h4>
<pre>public&nbsp;int totalRenderCalls</pre>
<div class="block">Number of rendering calls, ever. Will not be reset unless set manually.</div>
</li>
</ul>
<a name="maxSpritesInBatch">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>maxSpritesInBatch</h4>
<pre>public&nbsp;int maxSpritesInBatch</pre>
<div class="block">The maximum number of sprites rendered in one batch so far.</div>
</li>
</ul>
<a name="X1">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>X1</h4>
<pre>public static final&nbsp;int X1</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.X1">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="Y1">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Y1</h4>
<pre>public static final&nbsp;int Y1</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.Y1">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="C1">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>C1</h4>
<pre>public static final&nbsp;int C1</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.C1">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="U1">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>U1</h4>
<pre>public static final&nbsp;int U1</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.U1">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="V1">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>V1</h4>
<pre>public static final&nbsp;int V1</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.V1">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="X2">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>X2</h4>
<pre>public static final&nbsp;int X2</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.X2">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="Y2">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Y2</h4>
<pre>public static final&nbsp;int Y2</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.Y2">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="C2">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>C2</h4>
<pre>public static final&nbsp;int C2</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.C2">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="U2">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>U2</h4>
<pre>public static final&nbsp;int U2</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.U2">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="V2">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>V2</h4>
<pre>public static final&nbsp;int V2</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.V2">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="X3">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>X3</h4>
<pre>public static final&nbsp;int X3</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.X3">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="Y3">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Y3</h4>
<pre>public static final&nbsp;int Y3</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.Y3">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="C3">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>C3</h4>
<pre>public static final&nbsp;int C3</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.C3">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="U3">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>U3</h4>
<pre>public static final&nbsp;int U3</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.U3">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="V3">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>V3</h4>
<pre>public static final&nbsp;int V3</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.V3">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="X4">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>X4</h4>
<pre>public static final&nbsp;int X4</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.X4">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="Y4">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Y4</h4>
<pre>public static final&nbsp;int Y4</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.Y4">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="C4">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>C4</h4>
<pre>public static final&nbsp;int C4</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.C4">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="U4">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>U4</h4>
<pre>public static final&nbsp;int U4</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.U4">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="V4">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>V4</h4>
<pre>public static final&nbsp;int V4</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.V4">Constant Field Values</a></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="SpriteBatch()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SpriteBatch</h4>
<pre>public&nbsp;SpriteBatch()</pre>
<div class="block">Constructs a new SpriteBatch with a size of 1000, one buffer, and the default shader.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#SpriteBatch(int, int, com.badlogic.gdx.graphics.glutils.ShaderProgram)"><code>SpriteBatch(int, int, ShaderProgram)</code></a></dd></dl>
</li>
</ul>
<a name="SpriteBatch(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SpriteBatch</h4>
<pre>public&nbsp;SpriteBatch(int&nbsp;size)</pre>
<div class="block">Constructs a SpriteBatch with one buffer and the default shader.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#SpriteBatch(int, int, com.badlogic.gdx.graphics.glutils.ShaderProgram)"><code>SpriteBatch(int, int, ShaderProgram)</code></a></dd></dl>
</li>
</ul>
<a name="SpriteBatch(int, com.badlogic.gdx.graphics.glutils.ShaderProgram)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SpriteBatch</h4>
<pre>public&nbsp;SpriteBatch(int&nbsp;size,
           <a href="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram</a>&nbsp;defaultShader)</pre>
<div class="block">Constructs a new SpriteBatch with one buffer.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#SpriteBatch(int, int, com.badlogic.gdx.graphics.glutils.ShaderProgram)"><code>SpriteBatch(int, int, ShaderProgram)</code></a></dd></dl>
</li>
</ul>
<a name="SpriteBatch(int, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SpriteBatch</h4>
<pre>public&nbsp;SpriteBatch(int&nbsp;size,
           int&nbsp;buffers)</pre>
<div class="block">Constructs a SpriteBatch with the default shader.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#SpriteBatch(int, int, com.badlogic.gdx.graphics.glutils.ShaderProgram)"><code>SpriteBatch(int, int, ShaderProgram)</code></a></dd></dl>
</li>
</ul>
<a name="SpriteBatch(int, int, com.badlogic.gdx.graphics.glutils.ShaderProgram)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SpriteBatch</h4>
<pre>public&nbsp;SpriteBatch(int&nbsp;size,
           int&nbsp;buffers,
           <a href="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram</a>&nbsp;defaultShader)</pre>
<div class="block">Constructs a new SpriteBatch. Sets the projection matrix to an orthographic projection with y-axis point upwards, x-axis
 point to the right and the origin being in the bottom left corner of the screen. The projection will be pixel perfect with
 respect to the current screen resolution.
 <p>
 The defaultShader specifies the shader to use. Note that the names for uniforms for this default shader are different than
 the ones expect for shaders set with <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setShader(com.badlogic.gdx.graphics.glutils.ShaderProgram)"><code>setShader(ShaderProgram)</code></a>. See <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#createDefaultShader()"><code>createDefaultShader()</code></a>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>size</code> - The max number of sprites in a single batch. Max of 5460.</dd><dd><code>buffers</code> - The number of meshes to use. This is an expert function. It only makes sense with VBOs (see
           <a href="../../../../../com/badlogic/gdx/graphics/Mesh.html#forceVBO"><code>Mesh.forceVBO</code></a>).</dd><dd><code>defaultShader</code> - The default shader to use. This is not owned by the SpriteBatch and must be disposed separately.</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="createDefaultShader()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createDefaultShader</h4>
<pre>public static&nbsp;<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram</a>&nbsp;createDefaultShader()</pre>
<div class="block">Returns a new instance of the default shader used by SpriteBatch for GL2 when no shader is specified.</div>
</li>
</ul>
<a name="begin()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>begin</h4>
<pre>public&nbsp;void&nbsp;begin()</pre>
<div class="block">Sets up the SpriteBatch for drawing. This will disable depth buffer writting. It enables blending and texturing. If you have
 more texture units enabled than the first one you have to disable them before calling this. Uses a screen coordinate system
 by default where everything is given in pixels. You can specify your own projection and modelview matrices via
 <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setProjectionMatrix(com.badlogic.gdx.math.Matrix4)"><code>setProjectionMatrix(Matrix4)</code></a> and <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setTransformMatrix(com.badlogic.gdx.math.Matrix4)"><code>setTransformMatrix(Matrix4)</code></a>.</div>
</li>
</ul>
<a name="end()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>end</h4>
<pre>public&nbsp;void&nbsp;end()</pre>
<div class="block">Finishes off rendering. Enables depth writes, disables blending and texturing. Must always be called after a call to
 <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#begin()"><code>begin()</code></a></div>
</li>
</ul>
<a name="setColor(com.badlogic.gdx.graphics.Color)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setColor</h4>
<pre>public&nbsp;void&nbsp;setColor(<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color</a>&nbsp;tint)</pre>
<div class="block">Sets the color used to tint images when they are added to the SpriteBatch. Default is <a href="../../../../../com/badlogic/gdx/graphics/Color.html#WHITE"><code>Color.WHITE</code></a>.</div>
</li>
</ul>
<a name="setColor(float, float, float, float)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setColor</h4>
<pre>public&nbsp;void&nbsp;setColor(float&nbsp;r,
            float&nbsp;g,
            float&nbsp;b,
            float&nbsp;a)</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setColor(com.badlogic.gdx.graphics.Color)"><code>setColor(Color)</code></a></dd></dl>
</li>
</ul>
<a name="setColor(float)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setColor</h4>
<pre>public&nbsp;void&nbsp;setColor(float&nbsp;color)</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.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></dd></dl>
</li>
</ul>
<a name="getColor()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getColor</h4>
<pre>public&nbsp;<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color</a>&nbsp;getColor()</pre>
<dl><dt><span class="strong">Returns:</span></dt><dd>the rendering color of this SpriteBatch. Manipulating the returned instance has no effect.</dd></dl>
</li>
</ul>
<a name="draw(com.badlogic.gdx.graphics.Texture, float, float, float, float, float, float, float, float, float, int, int, int, int, boolean, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>draw</h4>
<pre>public&nbsp;void&nbsp;draw(<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>
<div class="block">Draws a rectangle with the bottom left corner at x,y having the given width and height in pixels. The rectangle is offset by
 originX, originY relative to the origin. Scale specifies the scaling factor by which the rectangle should be scaled around
 originX, originY. Rotation specifies the angle of counter clockwise rotation of the rectangle around originX, originY. The
 portion of the <a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics"><code>Texture</code></a> given by srcX, srcY and srcWidth, srcHeight is used. These coordinates and sizes are given in
 texels. FlipX and flipY specify whether the texture portion should be fliped horizontally or vertically.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - the x-coordinate in screen space</dd><dd><code>y</code> - the y-coordinate in screen space</dd><dd><code>originX</code> - the x-coordinate of the scaling and rotation origin relative to the screen space coordinates</dd><dd><code>originY</code> - the y-coordinate of the scaling and rotation origin relative to the screen space coordinates</dd><dd><code>width</code> - the width in pixels</dd><dd><code>height</code> - the height in pixels</dd><dd><code>scaleX</code> - the scale of the rectangle around originX/originY in x</dd><dd><code>scaleY</code> - the scale of the rectangle around originX/originY in y</dd><dd><code>rotation</code> - the angle of counter clockwise rotation of the rectangle around originX/originY</dd><dd><code>srcX</code> - the x-coordinate in texel space</dd><dd><code>srcY</code> - the y-coordinate in texel space</dd><dd><code>srcWidth</code> - the source with in texels</dd><dd><code>srcHeight</code> - the source height in texels</dd><dd><code>flipX</code> - whether to flip the sprite horizontally</dd><dd><code>flipY</code> - whether to flip the sprite vertically</dd></dl>
</li>
</ul>
<a name="draw(com.badlogic.gdx.graphics.Texture, float, float, float, float, int, int, int, int, boolean, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>draw</h4>
<pre>public&nbsp;void&nbsp;draw(<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>
<div class="block">Draws a rectangle with the bottom left corner at x,y having the given width and height in pixels. The portion of the
 <a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics"><code>Texture</code></a> given by srcX, srcY and srcWidth, srcHeight is used. These coordinates and sizes are given in texels. FlipX
 and flipY specify whether the texture portion should be fliped horizontally or vertically.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - the x-coordinate in screen space</dd><dd><code>y</code> - the y-coordinate in screen space</dd><dd><code>width</code> - the width in pixels</dd><dd><code>height</code> - the height in pixels</dd><dd><code>srcX</code> - the x-coordinate in texel space</dd><dd><code>srcY</code> - the y-coordinate in texel space</dd><dd><code>srcWidth</code> - the source with in texels</dd><dd><code>srcHeight</code> - the source height in texels</dd><dd><code>flipX</code> - whether to flip the sprite horizontally</dd><dd><code>flipY</code> - whether to flip the sprite vertically</dd></dl>
</li>
</ul>
<a name="draw(com.badlogic.gdx.graphics.Texture, float, float, int, int, int, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>draw</h4>
<pre>public&nbsp;void&nbsp;draw(<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>
<div class="block">Draws a rectangle with the bottom left corner at x,y having the given width and height in pixels. The portion of the
 <a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics"><code>Texture</code></a> given by srcX, srcY and srcWidth, srcHeight are used. These coordinates and sizes are given in texels.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - the x-coordinate in screen space</dd><dd><code>y</code> - the y-coordinate in screen space</dd><dd><code>srcX</code> - the x-coordinate in texel space</dd><dd><code>srcY</code> - the y-coordinate in texel space</dd><dd><code>srcWidth</code> - the source with in texels</dd><dd><code>srcHeight</code> - the source height in texels</dd></dl>
</li>
</ul>
<a name="draw(com.badlogic.gdx.graphics.Texture, float, float, float, float, float, float, float, float)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>draw</h4>
<pre>public&nbsp;void&nbsp;draw(<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,
        float&nbsp;u,
        float&nbsp;v,
        float&nbsp;u2,
        float&nbsp;v2)</pre>
<div class="block">Draws a rectangle with the bottom left corner at x,y having the given width and height in pixels. The portion of the
 <a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics"><code>Texture</code></a> given by u, v and u2, v2 are used. These coordinates and sizes are given in texture size percentage. The
 rectangle will have the given tint <a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics"><code>Color</code></a>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - the x-coordinate in screen space</dd><dd><code>y</code> - the y-coordinate in screen space</dd><dd><code>width</code> - the width in pixels</dd><dd><code>height</code> - the height in pixels</dd></dl>
</li>
</ul>
<a name="draw(com.badlogic.gdx.graphics.Texture, float, float)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>draw</h4>
<pre>public&nbsp;void&nbsp;draw(<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>
<div class="block">Draws a rectangle with the bottom left corner at x,y having the width and height of the texture.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - the x-coordinate in screen space</dd><dd><code>y</code> - the y-coordinate in screen space</dd></dl>
</li>
</ul>
<a name="draw(com.badlogic.gdx.graphics.Texture, float, float, float, float)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>draw</h4>
<pre>public&nbsp;void&nbsp;draw(<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)</pre>
<div class="block">Draws a rectangle with the bottom left corner at x,y and stretching the region to cover the given width and height.</div>
</li>
</ul>
<a name="draw(com.badlogic.gdx.graphics.Texture, float[], int, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>draw</h4>
<pre>public&nbsp;void&nbsp;draw(<a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture</a>&nbsp;texture,
        float[]&nbsp;spriteVertices,
        int&nbsp;offset,
        int&nbsp;count)</pre>
<div class="block">Draws a rectangle using the given vertices. There must be 4 vertices, each made up of 5 elements in this order: x, y, color,
 u, v. The <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#getColor()"><code>getColor()</code></a> from the SpriteBatch is not applied.</div>
</li>
</ul>
<a name="draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>draw</h4>
<pre>public&nbsp;void&nbsp;draw(<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>
<div class="block">Draws a rectangle with the bottom left corner at x,y having the width and height of the region.</div>
</li>
</ul>
<a name="draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>draw</h4>
<pre>public&nbsp;void&nbsp;draw(<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>
<div class="block">Draws a rectangle with the bottom left corner at x,y and stretching the region to cover the given width and height.</div>
</li>
</ul>
<a name="draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float, float, float, float, float, float)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>draw</h4>
<pre>public&nbsp;void&nbsp;draw(<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>
<div class="block">Draws a rectangle with the bottom left corner at x,y and stretching the region to cover the given width and height. The
 rectangle is offset by originX, originY relative to the origin. Scale specifies the scaling factor by which the rectangle
 should be scaled around originX, originY. Rotation specifies the angle of counter clockwise rotation of the rectangle around
 originX, originY.</div>
</li>
</ul>
<a name="draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float, float, float, float, float, float, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>draw</h4>
<pre>public&nbsp;void&nbsp;draw(<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,
        boolean&nbsp;clockwise)</pre>
<div class="block">Draws a rectangle with the texture coordinates rotated 90 degrees. The bottom left corner at x,y and stretching the region
 to cover the given width and height. The rectangle is offset by originX, originY relative to the origin. Scale specifies the
 scaling factor by which the rectangle should be scaled around originX, originY. Rotation specifies the angle of counter
 clockwise rotation of the rectangle around originX, originY.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>clockwise</code> - If true, the texture coordinates are rotated 90 degrees clockwise. If false, they are rotated 90 degrees
           counter clockwise.</dd></dl>
</li>
</ul>
<a name="flush()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>flush</h4>
<pre>public&nbsp;void&nbsp;flush()</pre>
<div class="block">Causes any pending sprites to be rendered, without ending the SpriteBatch.</div>
</li>
</ul>
<a name="disableBlending()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>disableBlending</h4>
<pre>public&nbsp;void&nbsp;disableBlending()</pre>
<div class="block">Disables blending for drawing sprites. Calling this within <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#begin()"><code>begin()</code></a>/<a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#end()"><code>end()</code></a> will flush the batch.</div>
</li>
</ul>
<a name="enableBlending()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>enableBlending</h4>
<pre>public&nbsp;void&nbsp;enableBlending()</pre>
<div class="block">Enables blending for drawing sprites. Calling this within <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#begin()"><code>begin()</code></a>/<a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#end()"><code>end()</code></a> will flush the batch.</div>
</li>
</ul>
<a name="setBlendFunction(int, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setBlendFunction</h4>
<pre>public&nbsp;void&nbsp;setBlendFunction(int&nbsp;srcFunc,
                    int&nbsp;dstFunc)</pre>
<div class="block">Sets the blending function to be used when rendering sprites.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcFunc</code> - the source function, e.g. GL11.GL_SRC_ALPHA. If set to -1, SpriteBatch won't change the blending function.</dd><dd><code>dstFunc</code> - the destination function, e.g. GL11.GL_ONE_MINUS_SRC_ALPHA</dd></dl>
</li>
</ul>
<a name="getBlendSrcFunc()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBlendSrcFunc</h4>
<pre>public&nbsp;int&nbsp;getBlendSrcFunc()</pre>
</li>
</ul>
<a name="getBlendDstFunc()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBlendDstFunc</h4>
<pre>public&nbsp;int&nbsp;getBlendDstFunc()</pre>
</li>
</ul>
<a name="dispose()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>dispose</h4>
<pre>public&nbsp;void&nbsp;dispose()</pre>
<div class="block">Disposes all resources associated with this SpriteBatch.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../com/badlogic/gdx/utils/Disposable.html#dispose()">dispose</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../com/badlogic/gdx/utils/Disposable.html" title="interface in com.badlogic.gdx.utils">Disposable</a></code></dd>
</dl>
</li>
</ul>
<a name="getProjectionMatrix()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getProjectionMatrix</h4>
<pre>public&nbsp;<a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</a>&nbsp;getProjectionMatrix()</pre>
<div class="block">Returns the current projection matrix. Changing this within <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#begin()"><code>begin()</code></a>/<a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#end()"><code>end()</code></a> results in undefined behaviour.</div>
</li>
</ul>
<a name="getTransformMatrix()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTransformMatrix</h4>
<pre>public&nbsp;<a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</a>&nbsp;getTransformMatrix()</pre>
<div class="block">Returns the current transform matrix. Changing this within <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#begin()"><code>begin()</code></a>/<a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#end()"><code>end()</code></a> results in undefined behaviour.</div>
</li>
</ul>
<a name="setProjectionMatrix(com.badlogic.gdx.math.Matrix4)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setProjectionMatrix</h4>
<pre>public&nbsp;void&nbsp;setProjectionMatrix(<a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</a>&nbsp;projection)</pre>
<div class="block">Sets the projection matrix to be used by this SpriteBatch. If this is called inside a <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#begin()"><code>begin()</code></a>/<a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#end()"><code>end()</code></a> block,
 the current batch is flushed to the gpu.</div>
</li>
</ul>
<a name="setTransformMatrix(com.badlogic.gdx.math.Matrix4)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setTransformMatrix</h4>
<pre>public&nbsp;void&nbsp;setTransformMatrix(<a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4</a>&nbsp;transform)</pre>
<div class="block">Sets the transform matrix to be used by this SpriteBatch. If this is called inside a <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#begin()"><code>begin()</code></a>/<a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#end()"><code>end()</code></a> block,
 the current batch is flushed to the gpu.</div>
</li>
</ul>
<a name="setShader(com.badlogic.gdx.graphics.glutils.ShaderProgram)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setShader</h4>
<pre>public&nbsp;void&nbsp;setShader(<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram</a>&nbsp;shader)</pre>
<div class="block">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 "a_texCoord0", the color attribute is called "a_color". See
 <a href="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html#POSITION_ATTRIBUTE"><code>ShaderProgram.POSITION_ATTRIBUTE</code></a>, <a href="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html#COLOR_ATTRIBUTE"><code>ShaderProgram.COLOR_ATTRIBUTE</code></a> and <a href="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html#TEXCOORD_ATTRIBUTE"><code>ShaderProgram.TEXCOORD_ATTRIBUTE</code></a>
 which gets "0" appened to indicate the use of the first texture unit. The combined transform and projection matrx is
 uploaded via a mat4 uniform called "u_projTrans". The texture sampler is passed via a uniform called "u_texture".
 <p>
 Call this method with a null argument to use the default shader.
 <p>
 This method will flush the batch before setting the new shader, you can call it in between <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#begin()"><code>begin()</code></a> and
 <a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#end()"><code>end()</code></a>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><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.</dd></dl>
</li>
</ul>
<a name="isBlendingEnabled()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isBlendingEnabled</h4>
<pre>public&nbsp;boolean&nbsp;isBlendingEnabled()</pre>
<dl><dt><span class="strong">Returns:</span></dt><dd>whether blending for sprites is enabled</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/SpriteBatch.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em>libgdx API</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/badlogic/gdx/graphics/g2d/Sprite.html" title="class in com.badlogic.gdx.graphics.g2d"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.html" title="class in com.badlogic.gdx.graphics.g2d"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/badlogic/gdx/graphics/g2d/SpriteBatch.html" target="_top">Frames</a></li>
<li><a href="SpriteBatch.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
 allClassesLink = document.getElementById("allclasses_navbar_bottom");
 if(window==top) {
   allClassesLink.style.display = "block";
 }
 else {
   allClassesLink.style.display = "none";
 }
 //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
                                <div style="font-size:9pt"><i>
                                Copyright &copy; 2010-2013 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)
                                </i></div>
                        </small></p>
</body>
</html>