<!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 Mon Jul 02 02:26:22 CEST 2012 -->
<TITLE>
SpriteBatch (libgdx API)
</TITLE>
<META NAME="date" CONTENT="2012-07-02">
<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="SpriteBatch (libgdx API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package
</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class
</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SpriteBatch.html"><FONT CLASS="NavBarFont1"><B>Use
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help
</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
libgdx API
<style>
body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt }
pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif }
h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%; font-weight:bold }
.TableHeadingColor { background:#EEEEFF; }
a { text-decoration:none }
a:hover { text-decoration:underline }
a:link, a:visited { color:blue }
table { border:0px }
.TableRowColor td:first-child { border-left:1px solid black }
.TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black }
hr { border:0px; border-bottom:1px solid #333366; }
</style>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/Sprite.html" title="class in com.badlogic.gdx.graphics.g2d"><B>PREV CLASS
</B></A>
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.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/SpriteBatch.html" target="_top"><B>FRAMES
</B></A>
<A HREF="SpriteBatch.html" target="_top"><B>NO FRAMES
</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes
</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:
NESTED
|
<A HREF="#field_summary">FIELD
</A> |
<A HREF="#constructor_summary">CONSTR
</A> |
<A HREF="#method_summary">METHOD
</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:
<A HREF="#field_detail">FIELD
</A> |
<A HREF="#constructor_detail">CONSTR
</A> |
<A HREF="#method_detail">METHOD
</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.badlogic.gdx.graphics.g2d
</FONT>
<BR>
Class SpriteBatch
</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.badlogic.gdx.graphics.g2d.SpriteBatch
</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>SpriteBatch
</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>
<p>
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>
<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>
<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>
<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>
<p>
A SpriteBatch is a pretty heavy object so you should only ever have one in your program.
</p>
<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>
<p>
A SpriteBatch has to be disposed if it is no longer used.
</p>
<P>
<P>
<DL>
<DT><B>Author:
</B></DT>
<DD>mzechner
</DD>
</DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_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>Field Summary
</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#C1">C1
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#C2">C2
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#C3">C3
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#C4">C4
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#maxSpritesInBatch">maxSpritesInBatch
</A></B></CODE>
<BR>
the maximum number of sprites rendered in one batch so far
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#renderCalls">renderCalls
</A></B></CODE>
<BR>
number of render calls since last
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#begin()"><CODE>begin()
</CODE></A></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#totalRenderCalls">totalRenderCalls
</A></B></CODE>
<BR>
number of rendering calls ever, will not be reset, unless it's done manually
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#U1">U1
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#U2">U2
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#U3">U3
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#U4">U4
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#V1">V1
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#V2">V2
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#V3">V3
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#V4">V4
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#X1">X1
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#X2">X2
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#X3">X3
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#X4">X4
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#Y1">Y1
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#Y2">Y2
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#Y3">Y3
</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
int
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#Y4">Y4
</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ======== 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/SpriteBatch.html#SpriteBatch()">SpriteBatch
</A></B>()
</CODE>
<BR>
Constructs a new SpriteBatch.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#SpriteBatch(int)">SpriteBatch
</A></B>(int
size)
</CODE>
<BR>
Constructs a SpriteBatch with the specified size and (if GL2) the default shader.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#SpriteBatch(int, int)">SpriteBatch
</A></B>(int
size,
int
buffers)
</CODE>
<BR>
Constructs a SpriteBatch with the specified size and number of buffers and (if GL2) the default shader.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#SpriteBatch(int, int, com.badlogic.gdx.graphics.glutils.ShaderProgram)">SpriteBatch
</A></B>(int
size,
int
buffers,
<A HREF="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</A> defaultShader)
</CODE>
<BR>
Constructs a new SpriteBatch.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#SpriteBatch(int, com.badlogic.gdx.graphics.glutils.ShaderProgram)">SpriteBatch
</A></B>(int
size,
<A HREF="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</A> defaultShader)
</CODE>
<BR>
Constructs a new SpriteBatch.
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary
</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#begin()">begin
</A></B>()
</CODE>
<BR>
Sets up the SpriteBatch for drawing.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<A HREF="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#createDefaultShader()">createDefaultShader
</A></B>()
</CODE>
<BR>
Returns a new instance of the default shader used by SpriteBatch for GL2 when no shader is specified.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#disableBlending()">disableBlending
</A></B>()
</CODE>
<BR>
Disables blending for drawing sprites.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#dispose()">dispose
</A></B>()
</CODE>
<BR>
Disposes all resources associated with this SpriteBatch
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.Texture, float[], int, int)">draw
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float[]
spriteVertices,
int
offset,
int
length)
</CODE>
<BR>
Draws a rectangle using the given vertices.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.Texture, float, float)">draw
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float
x,
float
y)
</CODE>
<BR>
Draws a rectangle with the bottom left corner at x,y having the width and height of the texture.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.Texture, float, float, float, float)">draw
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float
x,
float
y,
float
width,
float
height)
</CODE>
<BR>
Draws a rectangle with the bottom left corner at x,y and stretching the region to cover the given width and height.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.Texture, float, float, float, float, float, float, float, float)">draw
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float
x,
float
y,
float
width,
float
height,
float
u,
float
v,
float
u2,
float
v2)
</CODE>
<BR>
Draws a rectangle with the bottom left corner at x,y having the given width and height in pixels.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/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></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float
x,
float
y,
float
originX,
float
originY,
float
width,
float
height,
float
scaleX,
float
scaleY,
float
rotation,
int
srcX,
int
srcY,
int
srcWidth,
int
srcHeight,
boolean
flipX,
boolean
flipY)
</CODE>
<BR>
Draws a rectangle with the bottom left corner at x,y having the given width and height in pixels.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.Texture, float, float, float, float, int, int, int, int, boolean, boolean)">draw
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float
x,
float
y,
float
width,
float
height,
int
srcX,
int
srcY,
int
srcWidth,
int
srcHeight,
boolean
flipX,
boolean
flipY)
</CODE>
<BR>
Draws a rectangle with the bottom left corner at x,y having the given width and height in pixels.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.Texture, float, float, int, int, int, int)">draw
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float
x,
float
y,
int
srcX,
int
srcY,
int
srcWidth,
int
srcHeight)
</CODE>
<BR>
Draws a rectangle with the bottom left corner at x,y having the given width and height in pixels.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float)">draw
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region,
float
x,
float
y)
</CODE>
<BR>
Draws a rectangle with the bottom left corner at x,y having the width and height of the region.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float)">draw
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region,
float
x,
float
y,
float
width,
float
height)
</CODE>
<BR>
Draws a rectangle with the bottom left corner at x,y and stretching the region to cover the given width and height.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float, float, float, float, float, float)">draw
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region,
float
x,
float
y,
float
originX,
float
originY,
float
width,
float
height,
float
scaleX,
float
scaleY,
float
rotation)
</CODE>
<BR>
Draws a rectangle with the bottom left corner at x,y and stretching the region to cover the given width and height.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float, float, float, float, float, float, boolean)">draw
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region,
float
x,
float
y,
float
originX,
float
originY,
float
width,
float
height,
float
scaleX,
float
scaleY,
float
rotation,
boolean
clockwise)
</CODE>
<BR>
Draws a rectangle with the bottom left corner at x,y and stretching the region to cover the given width and height.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#enableBlending()">enableBlending
</A></B>()
</CODE>
<BR>
Enables blending for sprites
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#end()">end
</A></B>()
</CODE>
<BR>
Finishes off rendering.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#flush()">flush
</A></B>()
</CODE>
<BR>
Causes any pending sprites to be rendered, without ending the SpriteBatch.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#getColor()">getColor
</A></B>()
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../com/badlogic/gdx/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/SpriteBatch.html#getProjectionMatrix()">getProjectionMatrix
</A></B>()
</CODE>
<BR>
Returns the current projection matrix.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <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/SpriteBatch.html#getTransformMatrix()">getTransformMatrix
</A></B>()
</CODE>
<BR>
Returns the current transform matrix.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#isBlendingEnabled()">isBlendingEnabled
</A></B>()
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setBlendFunction(int, int)">setBlendFunction
</A></B>(int
srcFunc,
int
dstFunc)
</CODE>
<BR>
Sets the blending function to be used when rendering sprites.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setColor(com.badlogic.gdx.graphics.Color)">setColor
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</A> tint)
</CODE>
<BR>
Sets the color used to tint images when they are added to the SpriteBatch.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setColor(float)">setColor
</A></B>(float
color)
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#setColor(float, float, float, float)">setColor
</A></B>(float
r,
float
g,
float
b,
float
a)
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.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> projection)
</CODE>
<BR>
Sets the projection matrix to be used by this SpriteBatch.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.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> shader)
</CODE>
<BR>
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> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.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> transform)
</CODE>
<BR>
Sets the transform matrix to be used by this SpriteBatch.
</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object
</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_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>Field Detail
</B></FONT></TH>
</TR>
</TABLE>
<A NAME="renderCalls"><!-- --></A><H3>
renderCalls
</H3>
<PRE>
public int
<B>renderCalls
</B></PRE>
<DL>
<DD>number of render calls since last
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#begin()"><CODE>begin()
</CODE></A>
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="totalRenderCalls"><!-- --></A><H3>
totalRenderCalls
</H3>
<PRE>
public int
<B>totalRenderCalls
</B></PRE>
<DL>
<DD>number of rendering calls ever, will not be reset, unless it's done manually
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="maxSpritesInBatch"><!-- --></A><H3>
maxSpritesInBatch
</H3>
<PRE>
public int
<B>maxSpritesInBatch
</B></PRE>
<DL>
<DD>the maximum number of sprites rendered in one batch so far
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="X1"><!-- --></A><H3>
X1
</H3>
<PRE>
public static final int
<B>X1
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.X1">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="Y1"><!-- --></A><H3>
Y1
</H3>
<PRE>
public static final int
<B>Y1
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.Y1">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="C1"><!-- --></A><H3>
C1
</H3>
<PRE>
public static final int
<B>C1
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.C1">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="U1"><!-- --></A><H3>
U1
</H3>
<PRE>
public static final int
<B>U1
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.U1">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="V1"><!-- --></A><H3>
V1
</H3>
<PRE>
public static final int
<B>V1
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.V1">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="X2"><!-- --></A><H3>
X2
</H3>
<PRE>
public static final int
<B>X2
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.X2">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="Y2"><!-- --></A><H3>
Y2
</H3>
<PRE>
public static final int
<B>Y2
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.Y2">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="C2"><!-- --></A><H3>
C2
</H3>
<PRE>
public static final int
<B>C2
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.C2">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="U2"><!-- --></A><H3>
U2
</H3>
<PRE>
public static final int
<B>U2
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.U2">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="V2"><!-- --></A><H3>
V2
</H3>
<PRE>
public static final int
<B>V2
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.V2">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="X3"><!-- --></A><H3>
X3
</H3>
<PRE>
public static final int
<B>X3
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.X3">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="Y3"><!-- --></A><H3>
Y3
</H3>
<PRE>
public static final int
<B>Y3
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.Y3">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="C3"><!-- --></A><H3>
C3
</H3>
<PRE>
public static final int
<B>C3
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.C3">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="U3"><!-- --></A><H3>
U3
</H3>
<PRE>
public static final int
<B>U3
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.U3">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="V3"><!-- --></A><H3>
V3
</H3>
<PRE>
public static final int
<B>V3
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.V3">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="X4"><!-- --></A><H3>
X4
</H3>
<PRE>
public static final int
<B>X4
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.X4">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="Y4"><!-- --></A><H3>
Y4
</H3>
<PRE>
public static final int
<B>Y4
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.Y4">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="C4"><!-- --></A><H3>
C4
</H3>
<PRE>
public static final int
<B>C4
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.C4">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="U4"><!-- --></A><H3>
U4
</H3>
<PRE>
public static final int
<B>U4
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.U4">Constant Field Values
</A></DL>
</DL>
<HR>
<A NAME="V4"><!-- --></A><H3>
V4
</H3>
<PRE>
public static final int
<B>V4
</B></PRE>
<DL>
<DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../constant-values.html#com.badlogic.gdx.graphics.g2d.SpriteBatch.V4">Constant Field Values
</A></DL>
</DL>
<!-- ========= 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="SpriteBatch()"><!-- --></A><H3>
SpriteBatch
</H3>
<PRE>
public
<B>SpriteBatch
</B>()
</PRE>
<DL>
<DD>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 screen resolution.
<P>
</DL>
<HR>
<A NAME="SpriteBatch(int)"><!-- --></A><H3>
SpriteBatch
</H3>
<PRE>
public
<B>SpriteBatch
</B>(int
size)
</PRE>
<DL>
<DD>Constructs a SpriteBatch with the specified size and (if GL2) the default shader. See
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#SpriteBatch(int, com.badlogic.gdx.graphics.glutils.ShaderProgram)"><CODE>SpriteBatch(int, ShaderProgram)
</CODE></A>.
<P>
</DL>
<HR>
<A NAME="SpriteBatch(int, com.badlogic.gdx.graphics.glutils.ShaderProgram)"><!-- --></A><H3>
SpriteBatch
</H3>
<PRE>
public
<B>SpriteBatch
</B>(int
size,
<A HREF="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</A> defaultShader)
</PRE>
<DL>
<DD><p>
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 screen resolution.
</p>
<p>
The size parameter specifies the maximum size of a single batch in number of sprites
</p>
<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 the
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#createDefaultShader()"><CODE>createDefaultShader()
</CODE></A> method.
</p>
<P>
<DL>
<DT><B>Parameters:
</B><DD><CODE>size
</CODE> - the batch size in number of sprites
<DD><CODE>defaultShader
</CODE> - the default shader to use. This is not owned by the SpriteBatch and must be disposed separately.
</DL>
</DL>
<HR>
<A NAME="SpriteBatch(int, int)"><!-- --></A><H3>
SpriteBatch
</H3>
<PRE>
public
<B>SpriteBatch
</B>(int
size,
int
buffers)
</PRE>
<DL>
<DD>Constructs a SpriteBatch with the specified size and number of buffers and (if GL2) the default shader. See
<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>.
<P>
</DL>
<HR>
<A NAME="SpriteBatch(int, int, com.badlogic.gdx.graphics.glutils.ShaderProgram)"><!-- --></A><H3>
SpriteBatch
</H3>
<PRE>
public
<B>SpriteBatch
</B>(int
size,
int
buffers,
<A HREF="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</A> defaultShader)
</PRE>
<DL>
<DD><p>
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 screen resolution.
</p>
<p>
The size parameter specifies the maximum size of a single batch in number of sprites
</p>
<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 the
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html#createDefaultShader()"><CODE>createDefaultShader()
</CODE></A> method.
</p>
<P>
<DL>
<DT><B>Parameters:
</B><DD><CODE>size
</CODE> - the batch size in number of sprites
<DD><CODE>buffers
</CODE> - the number of buffers to use. only makes sense with VBOs. This is an expert function.
<DD><CODE>defaultShader
</CODE> - the default shader to use. This is not owned by the SpriteBatch and must be disposed separately.
</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="createDefaultShader()"><!-- --></A><H3>
createDefaultShader
</H3>
<PRE>
public static
<A HREF="../../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</A> <B>createDefaultShader
</B>()
</PRE>
<DL>
<DD>Returns a new instance of the default shader used by SpriteBatch for GL2 when no shader is specified.
<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>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>.
<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>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>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setColor(com.badlogic.gdx.graphics.Color)"><!-- --></A><H3>
setColor
</H3>
<PRE>
public void
<B>setColor
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</A> tint)
</PRE>
<DL>
<DD>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>.
<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
r,
float
g,
float
b,
float
a)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:
</B><DD><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.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
color)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:
</B><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></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>
<DT><B>Returns:
</B><DD>the rendering color of this SpriteBatch. Manipulating the returned instance has no effect.
</DL>
</DD>
</DL>
<HR>
<A NAME="draw(com.badlogic.gdx.graphics.Texture, float, float, float, float, float, float, float, float, float, int, int, int, int, boolean, boolean)"><!-- --></A><H3>
draw
</H3>
<PRE>
public void
<B>draw
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float
x,
float
y,
float
originX,
float
originY,
float
width,
float
height,
float
scaleX,
float
scaleY,
float
rotation,
int
srcX,
int
srcY,
int
srcWidth,
int
srcHeight,
boolean
flipX,
boolean
flipY)
</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>texture
</CODE> - the Texture
<DD><CODE>x
</CODE> - the x-coordinate in screen space
<DD><CODE>y
</CODE> - the y-coordinate in screen space
<DD><CODE>originX
</CODE> - the x-coordinate of the scaling and rotation origin relative to the screen space coordinates
<DD><CODE>originY
</CODE> - the y-coordinate of the scaling and rotation origin relative to the screen space coordinates
<DD><CODE>width
</CODE> - the width in pixels
<DD><CODE>height
</CODE> - the height in pixels
<DD><CODE>scaleX
</CODE> - the scale of the rectangle around originX/originY in x
<DD><CODE>scaleY
</CODE> - the scale of the rectangle around originX/originY in y
<DD><CODE>rotation
</CODE> - the angle of counter clockwise rotation of the rectangle around originX/originY
<DD><CODE>srcX
</CODE> - the x-coordinate in texel space
<DD><CODE>srcY
</CODE> - the y-coordinate in texel space
<DD><CODE>srcWidth
</CODE> - the source with in texels
<DD><CODE>srcHeight
</CODE> - the source height in texels
<DD><CODE>flipX
</CODE> - whether to flip the sprite horizontally
<DD><CODE>flipY
</CODE> - whether to flip the sprite vertically
</DL>
</DD>
</DL>
<HR>
<A NAME="draw(com.badlogic.gdx.graphics.Texture, float, float, float, float, int, int, int, int, boolean, boolean)"><!-- --></A><H3>
draw
</H3>
<PRE>
public void
<B>draw
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float
x,
float
y,
float
width,
float
height,
int
srcX,
int
srcY,
int
srcWidth,
int
srcHeight,
boolean
flipX,
boolean
flipY)
</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>texture
</CODE> - the Texture
<DD><CODE>x
</CODE> - the x-coordinate in screen space
<DD><CODE>y
</CODE> - the y-coordinate in screen space
<DD><CODE>width
</CODE> - the width in pixels
<DD><CODE>height
</CODE> - the height in pixels
<DD><CODE>srcX
</CODE> - the x-coordinate in texel space
<DD><CODE>srcY
</CODE> - the y-coordinate in texel space
<DD><CODE>srcWidth
</CODE> - the source with in texels
<DD><CODE>srcHeight
</CODE> - the source height in texels
<DD><CODE>flipX
</CODE> - whether to flip the sprite horizontally
<DD><CODE>flipY
</CODE> - whether to flip the sprite vertically
</DL>
</DD>
</DL>
<HR>
<A NAME="draw(com.badlogic.gdx.graphics.Texture, float, float, int, int, int, int)"><!-- --></A><H3>
draw
</H3>
<PRE>
public void
<B>draw
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float
x,
float
y,
int
srcX,
int
srcY,
int
srcWidth,
int
srcHeight)
</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>texture
</CODE> - the Texture
<DD><CODE>x
</CODE> - the x-coordinate in screen space
<DD><CODE>y
</CODE> - the y-coordinate in screen space
<DD><CODE>srcX
</CODE> - the x-coordinate in texel space
<DD><CODE>srcY
</CODE> - the y-coordinate in texel space
<DD><CODE>srcWidth
</CODE> - the source with in texels
<DD><CODE>srcHeight
</CODE> - the source height in texels
</DL>
</DD>
</DL>
<HR>
<A NAME="draw(com.badlogic.gdx.graphics.Texture, float, float, float, float, float, float, float, float)"><!-- --></A><H3>
draw
</H3>
<PRE>
public void
<B>draw
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float
x,
float
y,
float
width,
float
height,
float
u,
float
v,
float
u2,
float
v2)
</PRE>
<DL>
<DD>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>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>texture
</CODE> - the Texture
<DD><CODE>x
</CODE> - the x-coordinate in screen space
<DD><CODE>y
</CODE> - the y-coordinate in screen space
<DD><CODE>width
</CODE> - the width in pixels
<DD><CODE>height
</CODE> - the height in pixels
</DL>
</DD>
</DL>
<HR>
<A NAME="draw(com.badlogic.gdx.graphics.Texture, float, float)"><!-- --></A><H3>
draw
</H3>
<PRE>
public void
<B>draw
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float
x,
float
y)
</PRE>
<DL>
<DD>Draws a rectangle with the bottom left corner at x,y having the width and height of the texture.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>texture
</CODE> - the Texture
<DD><CODE>x
</CODE> - the x-coordinate in screen space
<DD><CODE>y
</CODE> - the y-coordinate in screen space
</DL>
</DD>
</DL>
<HR>
<A NAME="draw(com.badlogic.gdx.graphics.Texture, float, float, float, float)"><!-- --></A><H3>
draw
</H3>
<PRE>
public void
<B>draw
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float
x,
float
y,
float
width,
float
height)
</PRE>
<DL>
<DD>Draws a rectangle with the bottom left corner at x,y and stretching the region to cover the given width and height.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="draw(com.badlogic.gdx.graphics.Texture, float[], int, int)"><!-- --></A><H3>
draw
</H3>
<PRE>
public void
<B>draw
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float[]
spriteVertices,
int
offset,
int
length)
</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float)"><!-- --></A><H3>
draw
</H3>
<PRE>
public void
<B>draw
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region,
float
x,
float
y)
</PRE>
<DL>
<DD>Draws a rectangle with the bottom left corner at x,y having the width and height of the region.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float)"><!-- --></A><H3>
draw
</H3>
<PRE>
public void
<B>draw
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region,
float
x,
float
y,
float
width,
float
height)
</PRE>
<DL>
<DD>Draws a rectangle with the bottom left corner at x,y and stretching the region to cover the given width and height.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float, float, float, float, float, float)"><!-- --></A><H3>
draw
</H3>
<PRE>
public void
<B>draw
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region,
float
x,
float
y,
float
originX,
float
originY,
float
width,
float
height,
float
scaleX,
float
scaleY,
float
rotation)
</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="draw(com.badlogic.gdx.graphics.g2d.TextureRegion, float, float, float, float, float, float, float, float, float, boolean)"><!-- --></A><H3>
draw
</H3>
<PRE>
public void
<B>draw
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region,
float
x,
float
y,
float
originX,
float
originY,
float
width,
float
height,
float
scaleX,
float
scaleY,
float
rotation,
boolean
clockwise)
</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="flush()"><!-- --></A><H3>
flush
</H3>
<PRE>
public void
<B>flush
</B>()
</PRE>
<DL>
<DD>Causes any pending sprites to be rendered, without ending the SpriteBatch.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="disableBlending()"><!-- --></A><H3>
disableBlending
</H3>
<PRE>
public void
<B>disableBlending
</B>()
</PRE>
<DL>
<DD>Disables blending for drawing sprites. Does not disable blending for text rendering
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="enableBlending()"><!-- --></A><H3>
enableBlending
</H3>
<PRE>
public void
<B>enableBlending
</B>()
</PRE>
<DL>
<DD>Enables blending for sprites
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setBlendFunction(int, int)"><!-- --></A><H3>
setBlendFunction
</H3>
<PRE>
public void
<B>setBlendFunction
</B>(int
srcFunc,
int
dstFunc)
</PRE>
<DL>
<DD>Sets the blending function to be used when rendering sprites.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>srcFunc
</CODE> - the source function, e.g. GL11.GL_SRC_ALPHA
<DD><CODE>dstFunc
</CODE> - the destination function, e.g. GL11.GL_ONE_MINUS_SRC_ALPHA
</DL>
</DD>
</DL>
<HR>
<A NAME="dispose()"><!-- --></A><H3>
dispose
</H3>
<PRE>
public void
<B>dispose
</B>()
</PRE>
<DL>
<DD>Disposes all resources associated with this SpriteBatch
<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>Returns the current projection matrix. Changing this will result in undefined behaviour.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:
</B><DD>the currently set projection matrix
</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>Returns the current transform matrix. Changing this will result in undefined behaviour.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:
</B><DD>the currently set transform matrix
</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> projection)
</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>projection
</CODE> - the projection matrix
</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> transform)
</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>transform
</CODE> - the transform matrix
</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> 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_texCoords0", 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 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".
</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>.
<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>
<HR>
<A NAME="isBlendingEnabled()"><!-- --></A><H3>
isBlendingEnabled
</H3>
<PRE>
public boolean
<B>isBlendingEnabled
</B>()
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:
</B><DD>whether blending for sprites is enabled
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package
</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class
</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SpriteBatch.html"><FONT CLASS="NavBarFont1"><B>Use
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help
</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
libgdx API
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/Sprite.html" title="class in com.badlogic.gdx.graphics.g2d"><B>PREV CLASS
</B></A>
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/SpriteCache.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/SpriteBatch.html" target="_top"><B>FRAMES
</B></A>
<A HREF="SpriteBatch.html" target="_top"><B>NO FRAMES
</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes
</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:
NESTED
|
<A HREF="#field_summary">FIELD
</A> |
<A HREF="#constructor_summary">CONSTR
</A> |
<A HREF="#method_summary">METHOD
</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:
<A HREF="#field_detail">FIELD
</A> |
<A HREF="#constructor_detail">CONSTR
</A> |
<A HREF="#method_detail">METHOD
</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<div style="font-size:9pt"><i>
Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)
</i></div>
</BODY>
</HTML>