<!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:39 CET 2013 -->
<title>ScissorStack (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="ScissorStack (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/ScissorStack.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/scenes/scene2d/utils/NinePatchDrawable.html" title="class in com.badlogic.gdx.scenes.scene2d.utils"><span class="strong">Prev Class
</span></a></li>
<li><a href="../../../../../../com/badlogic/gdx/scenes/scene2d/utils/SpriteDrawable.html" title="class in com.badlogic.gdx.scenes.scene2d.utils"><span class="strong">Next Class
</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/badlogic/gdx/scenes/scene2d/utils/ScissorStack.html" target="_top">Frames
</a></li>
<li><a href="ScissorStack.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.scenes.scene2d.utils
</div>
<h2 title="Class ScissorStack" class="title">Class ScissorStack
</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object
</li>
<li>
<ul class="inheritance">
<li>com.badlogic.gdx.scenes.scene2d.utils.ScissorStack
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class
<span class="strong">ScissorStack
</span>
extends java.lang.Object
</pre>
<div class="block">A stack of
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math"><code>Rectangle
</code></a> objects to be used for clipping via
<a href="../../../../../../com/badlogic/gdx/graphics/GLCommon.html#glScissor(int, int, int, int)"><code>GLCommon.glScissor(int, int, int, int)
</code></a>. When a new
Rectangle is pushed onto the stack, it will be merged with the current top of stack. The minimum area of overlap is then set as
the real top of the stack.
</div>
<dl><dt><span class="strong">Author:
</span></dt>
<dd>mzechner
</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== 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/scenes/scene2d/utils/ScissorStack.html#ScissorStack()">ScissorStack
</a></strong>()
</code> </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>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../../com/badlogic/gdx/scenes/scene2d/utils/ScissorStack.html#calculateScissors(com.badlogic.gdx.graphics.Camera, float, float, float, float, com.badlogic.gdx.math.Matrix4, com.badlogic.gdx.math.Rectangle, com.badlogic.gdx.math.Rectangle)">calculateScissors
</a></strong>(
<a href="../../../../../../com/badlogic/gdx/graphics/Camera.html" title="class in com.badlogic.gdx.graphics">Camera
</a> camera,
float
viewportX,
float
viewportY,
float
viewportWidth,
float
viewportHeight,
<a href="../../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> batchTransform,
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math">Rectangle
</a> area,
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math">Rectangle
</a> scissor)
</code>
<div class="block">Calculates a scissor rectangle in OpenGL ES window coordinates from a
<a href="../../../../../../com/badlogic/gdx/graphics/Camera.html" title="class in com.badlogic.gdx.graphics"><code>Camera
</code></a>, a transformation
<a href="../../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math"><code>Matrix4
</code></a> and
an axis aligned
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math"><code>Rectangle
</code></a>.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math">Rectangle
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../com/badlogic/gdx/scenes/scene2d/utils/ScissorStack.html#getViewport()">getViewport
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math">Rectangle
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../com/badlogic/gdx/scenes/scene2d/utils/ScissorStack.html#popScissors()">popScissors
</a></strong>()
</code>
<div class="block">Pops the current scissor rectangle from the stack and sets the new scissor area to the new top of stack rectangle.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static boolean
</code></td>
<td class="colLast"><code><strong><a href="../../../../../../com/badlogic/gdx/scenes/scene2d/utils/ScissorStack.html#pushScissors(com.badlogic.gdx.math.Rectangle)">pushScissors
</a></strong>(
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math">Rectangle
</a> scissor)
</code>
<div class="block">Pushes a new scissor
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math"><code>Rectangle
</code></a> onto the stack, merging it with the current top of the stack.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../../com/badlogic/gdx/scenes/scene2d/utils/ScissorStack.html#toWindowCoordinates(com.badlogic.gdx.graphics.Camera, com.badlogic.gdx.math.Matrix4, com.badlogic.gdx.math.Vector2)">toWindowCoordinates
</a></strong>(
<a href="../../../../../../com/badlogic/gdx/graphics/Camera.html" title="class in com.badlogic.gdx.graphics">Camera
</a> camera,
<a href="../../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> transformMatrix,
<a href="../../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> point)
</code>
<div class="block">Transforms a point to real window coordinates (as oposed to OpenGL ES window coordinates), where the origin is in the top
left and the the y-axis is pointing downwards
</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="ScissorStack()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ScissorStack
</h4>
<pre>public
ScissorStack()
</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail
</h3>
<a name="pushScissors(com.badlogic.gdx.math.Rectangle)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>pushScissors
</h4>
<pre>public static
boolean
pushScissors(
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math">Rectangle
</a> scissor)
</pre>
<div class="block">Pushes a new scissor
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math"><code>Rectangle
</code></a> onto the stack, merging it with the current top of the stack. The minimal area of
overlap between the top of stack rectangle and the provided rectangle is pushed onto the stack. This will invoke
<a href="../../../../../../com/badlogic/gdx/graphics/GLCommon.html#glScissor(int, int, int, int)"><code>GLCommon.glScissor(int, int, int, int)
</code></a> with the final top of stack rectangle. In case no scissor is yet on the stack
this will also enable
<a href="../../../../../../com/badlogic/gdx/graphics/GL10.html#GL_SCISSOR_TEST"><code>GL10.GL_SCISSOR_TEST
</code></a> automatically.
</div>
<dl><dt><span class="strong">Returns:
</span></dt><dd>true if the scissors were pushed. false if the scissor area was zero, in this case the scissors were not pushed and
no drawing should occur.
</dd></dl>
</li>
</ul>
<a name="popScissors()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>popScissors
</h4>
<pre>public static
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math">Rectangle
</a> popScissors()
</pre>
<div class="block">Pops the current scissor rectangle from the stack and sets the new scissor area to the new top of stack rectangle. In case
no more rectangles are on the stack,
<a href="../../../../../../com/badlogic/gdx/graphics/GL10.html#GL_SCISSOR_TEST"><code>GL10.GL_SCISSOR_TEST
</code></a> is disabled.
</div>
</li>
</ul>
<a name="calculateScissors(com.badlogic.gdx.graphics.Camera, float, float, float, float, com.badlogic.gdx.math.Matrix4, com.badlogic.gdx.math.Rectangle, com.badlogic.gdx.math.Rectangle)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>calculateScissors
</h4>
<pre>public static
void
calculateScissors(
<a href="../../../../../../com/badlogic/gdx/graphics/Camera.html" title="class in com.badlogic.gdx.graphics">Camera
</a> camera,
float
viewportX,
float
viewportY,
float
viewportWidth,
float
viewportHeight,
<a href="../../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> batchTransform,
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math">Rectangle
</a> area,
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math">Rectangle
</a> scissor)
</pre>
<div class="block">Calculates a scissor rectangle in OpenGL ES window coordinates from a
<a href="../../../../../../com/badlogic/gdx/graphics/Camera.html" title="class in com.badlogic.gdx.graphics"><code>Camera
</code></a>, a transformation
<a href="../../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math"><code>Matrix4
</code></a> and
an axis aligned
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math"><code>Rectangle
</code></a>. The rectangle will get transformed by the camera and transform matrices and is then
projected to screen coordinates. Note that only axis aligned rectangles will work with this method. If either the Camera or
the Matrix4 have rotational components, the output of this method will not be suitable for
<a href="../../../../../../com/badlogic/gdx/graphics/GLCommon.html#glScissor(int, int, int, int)"><code>GLCommon.glScissor(int, int, int, int)
</code></a>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>camera
</code> - the
<a href="../../../../../../com/badlogic/gdx/graphics/Camera.html" title="class in com.badlogic.gdx.graphics"><code>Camera
</code></a></dd><dd><code>batchTransform
</code> - the transformation
<a href="../../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math"><code>Matrix4
</code></a></dd><dd><code>area
</code> - the
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math"><code>Rectangle
</code></a> to transform to window coordinates
</dd><dd><code>scissor
</code> - the Rectangle to store the result in
</dd></dl>
</li>
</ul>
<a name="getViewport()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getViewport
</h4>
<pre>public static
<a href="../../../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math">Rectangle
</a> getViewport()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the current viewport in OpenGL ES window coordinates based on the currently applied scissor
</dd></dl>
</li>
</ul>
<a name="toWindowCoordinates(com.badlogic.gdx.graphics.Camera, com.badlogic.gdx.math.Matrix4, com.badlogic.gdx.math.Vector2)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toWindowCoordinates
</h4>
<pre>public static
void
toWindowCoordinates(
<a href="../../../../../../com/badlogic/gdx/graphics/Camera.html" title="class in com.badlogic.gdx.graphics">Camera
</a> camera,
<a href="../../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> transformMatrix,
<a href="../../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> point)
</pre>
<div class="block">Transforms a point to real window coordinates (as oposed to OpenGL ES window coordinates), where the origin is in the top
left and the the y-axis is pointing downwards
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>camera
</code> - the
<a href="../../../../../../com/badlogic/gdx/graphics/Camera.html" title="class in com.badlogic.gdx.graphics"><code>Camera
</code></a></dd><dd><code>transformMatrix
</code> - the transformation
<a href="../../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math"><code>Matrix4
</code></a></dd><dd><code>point
</code> - the point to be transformed.
</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/ScissorStack.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/scenes/scene2d/utils/NinePatchDrawable.html" title="class in com.badlogic.gdx.scenes.scene2d.utils"><span class="strong">Prev Class
</span></a></li>
<li><a href="../../../../../../com/badlogic/gdx/scenes/scene2d/utils/SpriteDrawable.html" title="class in com.badlogic.gdx.scenes.scene2d.utils"><span class="strong">Next Class
</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/badlogic/gdx/scenes/scene2d/utils/ScissorStack.html" target="_top">Frames
</a></li>
<li><a href="ScissorStack.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>