<!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>
TextureRegion (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="TextureRegion (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/TextureRegion.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/TextureAtlas.TextureAtlasData.Region.html" title="class in com.badlogic.gdx.graphics.g2d"><B>PREV CLASS
</B></A>
NEXT CLASS
</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?com/badlogic/gdx/graphics/g2d/TextureRegion.html" target="_top"><B>FRAMES
</B></A>
<A HREF="TextureRegion.html" target="_top"><B>NO FRAMES
</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes
</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:
NESTED
|
FIELD
|
<A HREF="#constructor_summary">CONSTR
</A> |
<A HREF="#method_summary">METHOD
</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:
FIELD
|
<A HREF="#constructor_detail">CONSTR
</A> |
<A HREF="#method_detail">METHOD
</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.badlogic.gdx.graphics.g2d
</FONT>
<BR>
Class TextureRegion
</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.badlogic.gdx.graphics.g2d.TextureRegion
</B>
</PRE>
<DL>
<DT><B>Direct Known Subclasses:
</B> <DD><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/Sprite.html" title="class in com.badlogic.gdx.graphics.g2d">Sprite
</A>,
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureAtlas.AtlasRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureAtlas.AtlasRegion
</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class
<B>TextureRegion
</B><DT>extends java.lang.Object
</DL>
</PRE>
<P>
Defines a rectangular area of a texture. The coordinate system used has its origin in the upper left corner with the x-axis
pointing to the right and the y axis pointing downwards.
<P>
<P>
<DL>
<DT><B>Author:
</B></DT>
<DD>mzechner, Nathan Sweet
</DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary
</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#TextureRegion()">TextureRegion
</A></B>()
</CODE>
<BR>
Constructs a region with no texture and no coordinates defined.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#TextureRegion(com.badlogic.gdx.graphics.Texture)">TextureRegion
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture)
</CODE>
<BR>
Constructs a region the size of the specified texture.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#TextureRegion(com.badlogic.gdx.graphics.Texture, float, float, float, float)">TextureRegion
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float
u,
float
v,
float
u2,
float
v2)
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#TextureRegion(com.badlogic.gdx.graphics.Texture, int, int)">TextureRegion
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
int
width,
int
height)
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#TextureRegion(com.badlogic.gdx.graphics.Texture, int, int, int, int)">TextureRegion
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
int
x,
int
y,
int
width,
int
height)
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion)">TextureRegion
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region)
</CODE>
<BR>
Constructs a region with the same texture and coordinates of the specified region.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion, int, int, int, int)">TextureRegion
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region,
int
x,
int
y,
int
width,
int
height)
</CODE>
<BR>
Constructs a region with the same texture as the specified region and sets the coordinates relative to the specified region.
</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/TextureRegion.html#flip(boolean, boolean)">flip
</A></B>(boolean
x,
boolean
y)
</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/TextureRegion.html#getRegionHeight()">getRegionHeight
</A></B>()
</CODE>
<BR>
Returns the region's height.
</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/TextureRegion.html#getRegionWidth()">getRegionWidth
</A></B>()
</CODE>
<BR>
Returns the region's width.
</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/TextureRegion.html#getRegionX()">getRegionX
</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/TextureRegion.html#getRegionY()">getRegionY
</A></B>()
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#getTexture()">getTexture
</A></B>()
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> float
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#getU()">getU
</A></B>()
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> float
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#getU2()">getU2
</A></B>()
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> float
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#getV()">getV
</A></B>()
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> float
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#getV2()">getV2
</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/TextureRegion.html#scroll(float, float)">scroll
</A></B>(float
xAmount,
float
yAmount)
</CODE>
<BR>
Offsets the region relative to the current 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/TextureRegion.html#setRegion(float, float, float, float)">setRegion
</A></B>(float
u,
float
v,
float
u2,
float
v2)
</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/TextureRegion.html#setRegion(int, int, int, int)">setRegion
</A></B>(int
x,
int
y,
int
width,
int
height)
</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/TextureRegion.html#setRegion(com.badlogic.gdx.graphics.Texture)">setRegion
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture)
</CODE>
<BR>
Sets the texture and sets the coordinates to the size of the specified 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/TextureRegion.html#setRegion(com.badlogic.gdx.graphics.g2d.TextureRegion)">setRegion
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region)
</CODE>
<BR>
Sets the texture and coordinates to the specified 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/TextureRegion.html#setRegion(com.badlogic.gdx.graphics.g2d.TextureRegion, int, int, int, int)">setRegion
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region,
int
x,
int
y,
int
width,
int
height)
</CODE>
<BR>
Sets the texture to that of the specified region and sets the coordinates relative to the specified 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/TextureRegion.html#setRegionHeight(int)">setRegionHeight
</A></B>(int
height)
</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/TextureRegion.html#setRegionWidth(int)">setRegionWidth
</A></B>(int
width)
</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/TextureRegion.html#setRegionX(int)">setRegionX
</A></B>(int
x)
</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/TextureRegion.html#setRegionY(int)">setRegionY
</A></B>(int
y)
</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/TextureRegion.html#setTexture(com.badlogic.gdx.graphics.Texture)">setTexture
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture)
</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/TextureRegion.html#setU(float)">setU
</A></B>(float
u)
</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/TextureRegion.html#setU2(float)">setU2
</A></B>(float
u2)
</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/TextureRegion.html#setV(float)">setV
</A></B>(float
v)
</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/TextureRegion.html#setV2(float)">setV2
</A></B>(float
v2)
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A>[][]
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#split(int, int)">split
</A></B>(int
tileWidth,
int
tileHeight)
</CODE>
<BR>
Helper function to create tiles out of this TextureRegion starting from the top left corner going to the left and ending at
the bottom right corner.
</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/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A>[][]
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#split(com.badlogic.gdx.graphics.Texture, int, int)">split
</A></B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
int
tileWidth,
int
tileHeight)
</CODE>
<BR>
Helper function to create tiles out of the given
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics"><CODE>Texture
</CODE></A> starting from the top left corner going to the left and
ending at the bottom right corner.
</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object
</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail
</B></FONT></TH>
</TR>
</TABLE>
<A NAME="TextureRegion()"><!-- --></A><H3>
TextureRegion
</H3>
<PRE>
public
<B>TextureRegion
</B>()
</PRE>
<DL>
<DD>Constructs a region with no texture and no coordinates defined.
<P>
</DL>
<HR>
<A NAME="TextureRegion(com.badlogic.gdx.graphics.Texture)"><!-- --></A><H3>
TextureRegion
</H3>
<PRE>
public
<B>TextureRegion
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture)
</PRE>
<DL>
<DD>Constructs a region the size of the specified texture.
<P>
</DL>
<HR>
<A NAME="TextureRegion(com.badlogic.gdx.graphics.Texture, int, int)"><!-- --></A><H3>
TextureRegion
</H3>
<PRE>
public
<B>TextureRegion
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
int
width,
int
height)
</PRE>
<DL>
<DL>
<DT><B>Parameters:
</B><DD><CODE>width
</CODE> - The width of the texture region. May be negative to flip the sprite when drawn.
<DD><CODE>height
</CODE> - The height of the texture region. May be negative to flip the sprite when drawn.
</DL>
</DL>
<HR>
<A NAME="TextureRegion(com.badlogic.gdx.graphics.Texture, int, int, int, int)"><!-- --></A><H3>
TextureRegion
</H3>
<PRE>
public
<B>TextureRegion
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
int
x,
int
y,
int
width,
int
height)
</PRE>
<DL>
<DL>
<DT><B>Parameters:
</B><DD><CODE>width
</CODE> - The width of the texture region. May be negative to flip the sprite when drawn.
<DD><CODE>height
</CODE> - The height of the texture region. May be negative to flip the sprite when drawn.
</DL>
</DL>
<HR>
<A NAME="TextureRegion(com.badlogic.gdx.graphics.Texture, float, float, float, float)"><!-- --></A><H3>
TextureRegion
</H3>
<PRE>
public
<B>TextureRegion
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
float
u,
float
v,
float
u2,
float
v2)
</PRE>
<DL>
</DL>
<HR>
<A NAME="TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion)"><!-- --></A><H3>
TextureRegion
</H3>
<PRE>
public
<B>TextureRegion
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region)
</PRE>
<DL>
<DD>Constructs a region with the same texture and coordinates of the specified region.
<P>
</DL>
<HR>
<A NAME="TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion, int, int, int, int)"><!-- --></A><H3>
TextureRegion
</H3>
<PRE>
public
<B>TextureRegion
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region,
int
x,
int
y,
int
width,
int
height)
</PRE>
<DL>
<DD>Constructs a region with the same texture as the specified region and sets the coordinates relative to the specified region.
<P>
<DL>
<DT><B>Parameters:
</B><DD><CODE>width
</CODE> - The width of the texture region. May be negative to flip the sprite when drawn.
<DD><CODE>height
</CODE> - The height of the texture region. May be negative to flip the sprite when drawn.
</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="setRegion(com.badlogic.gdx.graphics.Texture)"><!-- --></A><H3>
setRegion
</H3>
<PRE>
public void
<B>setRegion
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture)
</PRE>
<DL>
<DD>Sets the texture and sets the coordinates to the size of the specified texture.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setRegion(int, int, int, int)"><!-- --></A><H3>
setRegion
</H3>
<PRE>
public void
<B>setRegion
</B>(int
x,
int
y,
int
width,
int
height)
</PRE>
<DL>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>width
</CODE> - The width of the texture region. May be negative to flip the sprite when drawn.
<DD><CODE>height
</CODE> - The height of the texture region. May be negative to flip the sprite when drawn.
</DL>
</DD>
</DL>
<HR>
<A NAME="setRegion(float, float, float, float)"><!-- --></A><H3>
setRegion
</H3>
<PRE>
public void
<B>setRegion
</B>(float
u,
float
v,
float
u2,
float
v2)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setRegion(com.badlogic.gdx.graphics.g2d.TextureRegion)"><!-- --></A><H3>
setRegion
</H3>
<PRE>
public void
<B>setRegion
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region)
</PRE>
<DL>
<DD>Sets the texture and coordinates to the specified region.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setRegion(com.badlogic.gdx.graphics.g2d.TextureRegion, int, int, int, int)"><!-- --></A><H3>
setRegion
</H3>
<PRE>
public void
<B>setRegion
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A> region,
int
x,
int
y,
int
width,
int
height)
</PRE>
<DL>
<DD>Sets the texture to that of the specified region and sets the coordinates relative to the specified region.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getTexture()"><!-- --></A><H3>
getTexture
</H3>
<PRE>
public
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> <B>getTexture
</B>()
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setTexture(com.badlogic.gdx.graphics.Texture)"><!-- --></A><H3>
setTexture
</H3>
<PRE>
public void
<B>setTexture
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getU()"><!-- --></A><H3>
getU
</H3>
<PRE>
public float
<B>getU
</B>()
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setU(float)"><!-- --></A><H3>
setU
</H3>
<PRE>
public void
<B>setU
</B>(float
u)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getV()"><!-- --></A><H3>
getV
</H3>
<PRE>
public float
<B>getV
</B>()
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setV(float)"><!-- --></A><H3>
setV
</H3>
<PRE>
public void
<B>setV
</B>(float
v)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getU2()"><!-- --></A><H3>
getU2
</H3>
<PRE>
public float
<B>getU2
</B>()
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setU2(float)"><!-- --></A><H3>
setU2
</H3>
<PRE>
public void
<B>setU2
</B>(float
u2)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getV2()"><!-- --></A><H3>
getV2
</H3>
<PRE>
public float
<B>getV2
</B>()
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setV2(float)"><!-- --></A><H3>
setV2
</H3>
<PRE>
public void
<B>setV2
</B>(float
v2)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getRegionX()"><!-- --></A><H3>
getRegionX
</H3>
<PRE>
public int
<B>getRegionX
</B>()
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setRegionX(int)"><!-- --></A><H3>
setRegionX
</H3>
<PRE>
public void
<B>setRegionX
</B>(int
x)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getRegionY()"><!-- --></A><H3>
getRegionY
</H3>
<PRE>
public int
<B>getRegionY
</B>()
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setRegionY(int)"><!-- --></A><H3>
setRegionY
</H3>
<PRE>
public void
<B>setRegionY
</B>(int
y)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getRegionWidth()"><!-- --></A><H3>
getRegionWidth
</H3>
<PRE>
public int
<B>getRegionWidth
</B>()
</PRE>
<DL>
<DD>Returns the region's width. May be negative if the texture region is flipped horizontally.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setRegionWidth(int)"><!-- --></A><H3>
setRegionWidth
</H3>
<PRE>
public void
<B>setRegionWidth
</B>(int
width)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getRegionHeight()"><!-- --></A><H3>
getRegionHeight
</H3>
<PRE>
public int
<B>getRegionHeight
</B>()
</PRE>
<DL>
<DD>Returns the region's height. May be negative if the texture region is flipped horizontally.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setRegionHeight(int)"><!-- --></A><H3>
setRegionHeight
</H3>
<PRE>
public void
<B>setRegionHeight
</B>(int
height)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="flip(boolean, boolean)"><!-- --></A><H3>
flip
</H3>
<PRE>
public void
<B>flip
</B>(boolean
x,
boolean
y)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="scroll(float, float)"><!-- --></A><H3>
scroll
</H3>
<PRE>
public void
<B>scroll
</B>(float
xAmount,
float
yAmount)
</PRE>
<DL>
<DD>Offsets the region relative to the current region. Generally the region's size should be the entire size of the texture in
the direction(s) it is scrolled.
<P>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>xAmount
</CODE> - The percentage to offset horizontally.
<DD><CODE>yAmount
</CODE> - The percentage to offset vertically. This is done in texture space, so up is negative.
</DL>
</DD>
</DL>
<HR>
<A NAME="split(int, int)"><!-- --></A><H3>
split
</H3>
<PRE>
public
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A>[][]
<B>split
</B>(int
tileWidth,
int
tileHeight)
</PRE>
<DL>
<DD>Helper function to create tiles out of this TextureRegion starting from the top left corner going to the left and ending at
the bottom right corner. Only complete tiles will be returned so if the region's width or height are not a multiple of the
tile width and height not all of the region will be used.
<P>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>tileWidth
</CODE> - a tile's width in pixels
<DD><CODE>tileHeight
</CODE> - a tile's height in pixels
<DT><B>Returns:
</B><DD>a 2D array of TextureRegions indexed by [row][column].
</DL>
</DD>
</DL>
<HR>
<A NAME="split(com.badlogic.gdx.graphics.Texture, int, int)"><!-- --></A><H3>
split
</H3>
<PRE>
public static
<A HREF="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</A>[][]
<B>split
</B>(
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</A> texture,
int
tileWidth,
int
tileHeight)
</PRE>
<DL>
<DD>Helper function to create tiles out of the given
<A HREF="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics"><CODE>Texture
</CODE></A> starting from the top left corner going to the left and
ending at the bottom right corner. Only complete tiles will be returned so if the texture's width or height are not a
multiple of the tile width and height not all of the texture will be used.
<P>
<DD><DL>
<DT><B>Parameters:
</B><DD><CODE>texture
</CODE> - the Texture
<DD><CODE>tileWidth
</CODE> - a tile's width in pixels
<DD><CODE>tileHeight
</CODE> - a tile's height in pixels
<DT><B>Returns:
</B><DD>a 2D array of TextureRegions indexed by [row][column].
</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/TextureRegion.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/TextureAtlas.TextureAtlasData.Region.html" title="class in com.badlogic.gdx.graphics.g2d"><B>PREV CLASS
</B></A>
NEXT CLASS
</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?com/badlogic/gdx/graphics/g2d/TextureRegion.html" target="_top"><B>FRAMES
</B></A>
<A HREF="TextureRegion.html" target="_top"><B>NO FRAMES
</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes
</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:
NESTED
|
FIELD
|
<A HREF="#constructor_summary">CONSTR
</A> |
<A HREF="#method_summary">METHOD
</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:
FIELD
|
<A HREF="#constructor_detail">CONSTR
</A> |
<A HREF="#method_detail">METHOD
</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<div style="font-size:9pt"><i>
Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)
</i></div>
</BODY>
</HTML>