<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_17) on Sun Nov 03 15:35:45 CET 2013 -->
<title>TextureRegion (libgdx API)
</title>
<meta name="date" content="2013-11-03">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="TextureRegion (libgdx API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.
</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview
</a></li>
<li><a href="package-summary.html">Package
</a></li>
<li class="navBarCell1Rev">Class
</li>
<li><a href="class-use/TextureRegion.html">Use
</a></li>
<li><a href="package-tree.html">Tree
</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated
</a></li>
<li><a href="../../../../../index-all.html">Index
</a></li>
<li><a href="../../../../../help-doc.html">Help
</a></li>
</ul>
<div class="aboutLanguage"><em>
libgdx API
<style>
body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt }
pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif }
h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%; font-weight:bold }
.TableHeadingColor { background:#EEEEFF; }
a { text-decoration:none }
a:hover { text-decoration:underline }
a:link, a:visited { color:blue }
table { border:0px }
.TableRowColor td:first-child { border-left:1px solid black }
.TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black }
hr { border:0px; border-bottom:1px solid #333366; }
</style>
</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureAtlas.TextureAtlasData.Region.html" title="class in com.badlogic.gdx.graphics.g2d"><span class="strong">Prev Class
</span></a></li>
<li>Next Class
</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/badlogic/gdx/graphics/g2d/TextureRegion.html" target="_top">Frames
</a></li>
<li><a href="TextureRegion.html" target="_top">No Frames
</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes
</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:
</li>
<li>Nested
|
</li>
<li>Field
|
</li>
<li><a href="#constructor_summary">Constr
</a> |
</li>
<li><a href="#method_summary">Method
</a></li>
</ul>
<ul class="subNavList">
<li>Detail:
</li>
<li>Field
|
</li>
<li><a href="#constructor_detail">Constr
</a> |
</li>
<li><a href="#method_detail">Method
</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.badlogic.gdx.graphics.g2d
</div>
<h2 title="Class TextureRegion" class="title">Class TextureRegion
</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object
</li>
<li>
<ul class="inheritance">
<li>com.badlogic.gdx.graphics.g2d.TextureRegion
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:
</dt>
<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>
<br>
<pre>public class
<span class="strong">TextureRegion
</span>
extends java.lang.Object
</pre>
<div class="block">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.
</div>
<dl><dt><span class="strong">Author:
</span></dt>
<dd>mzechner, Nathan Sweet
</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors
</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description
</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#TextureRegion()">TextureRegion
</a></strong>()
</code>
<div class="block">Constructs a region with no texture and no coordinates defined.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#TextureRegion(com.badlogic.gdx.graphics.Texture)">TextureRegion
</a></strong>(
<a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</a> texture)
</code>
<div class="block">Constructs a region the size of the specified texture.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#TextureRegion(com.badlogic.gdx.graphics.Texture, float, float, float, float)">TextureRegion
</a></strong>(
<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> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#TextureRegion(com.badlogic.gdx.graphics.Texture, int, int)">TextureRegion
</a></strong>(
<a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</a> texture,
int
width,
int
height)
</code> </td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#TextureRegion(com.badlogic.gdx.graphics.Texture, int, int, int, int)">TextureRegion
</a></strong>(
<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> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion)">TextureRegion
</a></strong>(
<a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</a> region)
</code>
<div class="block">Constructs a region with the same texture and coordinates of the specified region.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion, int, int, int, int)">TextureRegion
</a></strong>(
<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>
<div class="block">Constructs a region with the same texture as the specified region and sets the coordinates relative to the specified region.
</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods
</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type
</th>
<th class="colLast" scope="col">Method and Description
</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#flip(boolean, boolean)">flip
</a></strong>(boolean
x,
boolean
y)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#getRegionHeight()">getRegionHeight
</a></strong>()
</code>
<div class="block">Returns the region's height.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#getRegionWidth()">getRegionWidth
</a></strong>()
</code>
<div class="block">Returns the region's width.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#getRegionX()">getRegionX
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#getRegionY()">getRegionY
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#getTexture()">getTexture
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>float
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#getU()">getU
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>float
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#getU2()">getU2
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>float
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#getV()">getV
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>float
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#getV2()">getV2
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#isFlipX()">isFlipX
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#isFlipY()">isFlipY
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#scroll(float, float)">scroll
</a></strong>(float
xAmount,
float
yAmount)
</code>
<div class="block">Offsets the region relative to the current region.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#setRegion(float, float, float, float)">setRegion
</a></strong>(float
u,
float
v,
float
u2,
float
v2)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#setRegion(int, int, int, int)">setRegion
</a></strong>(int
x,
int
y,
int
width,
int
height)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#setRegion(com.badlogic.gdx.graphics.Texture)">setRegion
</a></strong>(
<a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</a> texture)
</code>
<div class="block">Sets the texture and sets the coordinates to the size of the specified texture.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#setRegion(com.badlogic.gdx.graphics.g2d.TextureRegion)">setRegion
</a></strong>(
<a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</a> region)
</code>
<div class="block">Sets the texture and coordinates to the specified region.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#setRegion(com.badlogic.gdx.graphics.g2d.TextureRegion, int, int, int, int)">setRegion
</a></strong>(
<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>
<div class="block">Sets the texture to that of the specified region and sets the coordinates relative to the specified region.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#setRegionHeight(int)">setRegionHeight
</a></strong>(int
height)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#setRegionWidth(int)">setRegionWidth
</a></strong>(int
width)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#setRegionX(int)">setRegionX
</a></strong>(int
x)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#setRegionY(int)">setRegionY
</a></strong>(int
y)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#setTexture(com.badlogic.gdx.graphics.Texture)">setTexture
</a></strong>(
<a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</a> texture)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#setU(float)">setU
</a></strong>(float
u)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#setU2(float)">setU2
</a></strong>(float
u2)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#setV(float)">setV
</a></strong>(float
v)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#setV2(float)">setV2
</a></strong>(float
v2)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</a>[][]
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#split(int, int)">split
</a></strong>(int
tileWidth,
int
tileHeight)
</code>
<div class="block">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.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static
<a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</a>[][]
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html#split(com.badlogic.gdx.graphics.Texture, int, int)">split
</a></strong>(
<a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</a> texture,
int
tileWidth,
int
tileHeight)
</code>
<div class="block">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.
</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class
java.lang.Object
</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail
</h3>
<a name="TextureRegion()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TextureRegion
</h4>
<pre>public
TextureRegion()
</pre>
<div class="block">Constructs a region with no texture and no coordinates defined.
</div>
</li>
</ul>
<a name="TextureRegion(com.badlogic.gdx.graphics.Texture)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TextureRegion
</h4>
<pre>public
TextureRegion(
<a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</a> texture)
</pre>
<div class="block">Constructs a region the size of the specified texture.
</div>
</li>
</ul>
<a name="TextureRegion(com.badlogic.gdx.graphics.Texture, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TextureRegion
</h4>
<pre>public
TextureRegion(
<a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</a> texture,
int
width,
int
height)
</pre>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>width
</code> - The width of the texture region. May be negative to flip the sprite when drawn.
</dd><dd><code>height
</code> - The height of the texture region. May be negative to flip the sprite when drawn.
</dd></dl>
</li>
</ul>
<a name="TextureRegion(com.badlogic.gdx.graphics.Texture, int, int, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TextureRegion
</h4>
<pre>public
TextureRegion(
<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><dt><span class="strong">Parameters:
</span></dt><dd><code>width
</code> - The width of the texture region. May be negative to flip the sprite when drawn.
</dd><dd><code>height
</code> - The height of the texture region. May be negative to flip the sprite when drawn.
</dd></dl>
</li>
</ul>
<a name="TextureRegion(com.badlogic.gdx.graphics.Texture, float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TextureRegion
</h4>
<pre>public
TextureRegion(
<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>
</li>
</ul>
<a name="TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TextureRegion
</h4>
<pre>public
TextureRegion(
<a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</a> region)
</pre>
<div class="block">Constructs a region with the same texture and coordinates of the specified region.
</div>
</li>
</ul>
<a name="TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion, int, int, int, int)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>TextureRegion
</h4>
<pre>public
TextureRegion(
<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>
<div class="block">Constructs a region with the same texture as the specified region and sets the coordinates relative to the specified region.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>width
</code> - The width of the texture region. May be negative to flip the sprite when drawn.
</dd><dd><code>height
</code> - The height of the texture region. May be negative to flip the sprite when drawn.
</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail
</h3>
<a name="setRegion(com.badlogic.gdx.graphics.Texture)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRegion
</h4>
<pre>public
void
setRegion(
<a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</a> texture)
</pre>
<div class="block">Sets the texture and sets the coordinates to the size of the specified texture.
</div>
</li>
</ul>
<a name="setRegion(int, int, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRegion
</h4>
<pre>public
void
setRegion(int
x,
int
y,
int
width,
int
height)
</pre>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>width
</code> - The width of the texture region. May be negative to flip the sprite when drawn.
</dd><dd><code>height
</code> - The height of the texture region. May be negative to flip the sprite when drawn.
</dd></dl>
</li>
</ul>
<a name="setRegion(float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRegion
</h4>
<pre>public
void
setRegion(float
u,
float
v,
float
u2,
float
v2)
</pre>
</li>
</ul>
<a name="setRegion(com.badlogic.gdx.graphics.g2d.TextureRegion)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRegion
</h4>
<pre>public
void
setRegion(
<a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</a> region)
</pre>
<div class="block">Sets the texture and coordinates to the specified region.
</div>
</li>
</ul>
<a name="setRegion(com.badlogic.gdx.graphics.g2d.TextureRegion, int, int, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRegion
</h4>
<pre>public
void
setRegion(
<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>
<div class="block">Sets the texture to that of the specified region and sets the coordinates relative to the specified region.
</div>
</li>
</ul>
<a name="getTexture()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTexture
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</a> getTexture()
</pre>
</li>
</ul>
<a name="setTexture(com.badlogic.gdx.graphics.Texture)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setTexture
</h4>
<pre>public
void
setTexture(
<a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</a> texture)
</pre>
</li>
</ul>
<a name="getU()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getU
</h4>
<pre>public
float
getU()
</pre>
</li>
</ul>
<a name="setU(float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setU
</h4>
<pre>public
void
setU(float
u)
</pre>
</li>
</ul>
<a name="getV()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getV
</h4>
<pre>public
float
getV()
</pre>
</li>
</ul>
<a name="setV(float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setV
</h4>
<pre>public
void
setV(float
v)
</pre>
</li>
</ul>
<a name="getU2()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getU2
</h4>
<pre>public
float
getU2()
</pre>
</li>
</ul>
<a name="setU2(float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setU2
</h4>
<pre>public
void
setU2(float
u2)
</pre>
</li>
</ul>
<a name="getV2()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getV2
</h4>
<pre>public
float
getV2()
</pre>
</li>
</ul>
<a name="setV2(float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setV2
</h4>
<pre>public
void
setV2(float
v2)
</pre>
</li>
</ul>
<a name="getRegionX()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRegionX
</h4>
<pre>public
int
getRegionX()
</pre>
</li>
</ul>
<a name="setRegionX(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRegionX
</h4>
<pre>public
void
setRegionX(int
x)
</pre>
</li>
</ul>
<a name="getRegionY()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRegionY
</h4>
<pre>public
int
getRegionY()
</pre>
</li>
</ul>
<a name="setRegionY(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRegionY
</h4>
<pre>public
void
setRegionY(int
y)
</pre>
</li>
</ul>
<a name="getRegionWidth()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRegionWidth
</h4>
<pre>public
int
getRegionWidth()
</pre>
<div class="block">Returns the region's width.
</div>
</li>
</ul>
<a name="setRegionWidth(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRegionWidth
</h4>
<pre>public
void
setRegionWidth(int
width)
</pre>
</li>
</ul>
<a name="getRegionHeight()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRegionHeight
</h4>
<pre>public
int
getRegionHeight()
</pre>
<div class="block">Returns the region's height.
</div>
</li>
</ul>
<a name="setRegionHeight(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRegionHeight
</h4>
<pre>public
void
setRegionHeight(int
height)
</pre>
</li>
</ul>
<a name="flip(boolean, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>flip
</h4>
<pre>public
void
flip(boolean
x,
boolean
y)
</pre>
</li>
</ul>
<a name="isFlipX()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isFlipX
</h4>
<pre>public
boolean
isFlipX()
</pre>
</li>
</ul>
<a name="isFlipY()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isFlipY
</h4>
<pre>public
boolean
isFlipY()
</pre>
</li>
</ul>
<a name="scroll(float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>scroll
</h4>
<pre>public
void
scroll(float
xAmount,
float
yAmount)
</pre>
<div class="block">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.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>xAmount
</code> - The percentage to offset horizontally.
</dd><dd><code>yAmount
</code> - The percentage to offset vertically. This is done in texture space, so up is negative.
</dd></dl>
</li>
</ul>
<a name="split(int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>split
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</a>[][]
split(int
tileWidth,
int
tileHeight)
</pre>
<div class="block">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. This will not work on texture regions returned form a TextureAtlas
that either have whitespace removed or where flipped before the region is split.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>tileWidth
</code> - a tile's width in pixels
</dd><dd><code>tileHeight
</code> - a tile's height in pixels
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>a 2D array of TextureRegions indexed by [row][column].
</dd></dl>
</li>
</ul>
<a name="split(com.badlogic.gdx.graphics.Texture, int, int)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>split
</h4>
<pre>public static
<a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureRegion.html" title="class in com.badlogic.gdx.graphics.g2d">TextureRegion
</a>[][]
split(
<a href="../../../../../com/badlogic/gdx/graphics/Texture.html" title="class in com.badlogic.gdx.graphics">Texture
</a> texture,
int
tileWidth,
int
tileHeight)
</pre>
<div class="block">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.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>texture
</code> - the Texture
</dd><dd><code>tileWidth
</code> - a tile's width in pixels
</dd><dd><code>tileHeight
</code> - a tile's height in pixels
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>a 2D array of TextureRegions indexed by [row][column].
</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview
</a></li>
<li><a href="package-summary.html">Package
</a></li>
<li class="navBarCell1Rev">Class
</li>
<li><a href="class-use/TextureRegion.html">Use
</a></li>
<li><a href="package-tree.html">Tree
</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated
</a></li>
<li><a href="../../../../../index-all.html">Index
</a></li>
<li><a href="../../../../../help-doc.html">Help
</a></li>
</ul>
<div class="aboutLanguage"><em>libgdx API
</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/badlogic/gdx/graphics/g2d/TextureAtlas.TextureAtlasData.Region.html" title="class in com.badlogic.gdx.graphics.g2d"><span class="strong">Prev Class
</span></a></li>
<li>Next Class
</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/badlogic/gdx/graphics/g2d/TextureRegion.html" target="_top">Frames
</a></li>
<li><a href="TextureRegion.html" target="_top">No Frames
</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes
</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:
</li>
<li>Nested
|
</li>
<li>Field
|
</li>
<li><a href="#constructor_summary">Constr
</a> |
</li>
<li><a href="#method_summary">Method
</a></li>
</ul>
<ul class="subNavList">
<li>Detail:
</li>
<li>Field
|
</li>
<li><a href="#constructor_detail">Constr
</a> |
</li>
<li><a href="#method_detail">Method
</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<div style="font-size:9pt"><i>
Copyright
© 2010-2013 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)
</i></div>
</small></p>
</body>
</html>