<!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:46 CET 2013 -->
<title>ShapeRenderer (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="ShapeRenderer (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/ShapeRenderer.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/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils"><span class="strong">Prev Class
</span></a></li>
<li><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><span class="strong">Next Class
</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/badlogic/gdx/graphics/glutils/ShapeRenderer.html" target="_top">Frames
</a></li>
<li><a href="ShapeRenderer.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><a href="#nested_class_summary">Nested
</a> |
</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.glutils
</div>
<h2 title="Class ShapeRenderer" class="title">Class ShapeRenderer
</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object
</li>
<li>
<ul class="inheritance">
<li>com.badlogic.gdx.graphics.glutils.ShapeRenderer
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class
<span class="strong">ShapeRenderer
</span>
extends java.lang.Object
</pre>
<div class="block">Renders points, lines, rectangles, filled rectangles and boxes.
</p>
This class works with OpenGL ES 1.x and 2.0. In its base configuration a 2D orthographic projection with the origin in the
lower left corner is used. Units are given in screen pixels.
</p>
To change the projection properties use the
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#setProjectionMatrix(com.badlogic.gdx.math.Matrix4)"><code>setProjectionMatrix(Matrix4)
</code></a> method. Usually the
<a href="../../../../../com/badlogic/gdx/graphics/Camera.html#combined"><code>Camera.combined
</code></a>
matrix is set via this method. If the screen orientation or resolution changes, the projection matrix might have to be adapted
as well.
</p>
Shapes are rendered in batches to increase performance. The standard use-pattern looks as follows:
<pre>
<code>camera.update();
shapeRenderer.setProjectionMatrix(camera.combined);
shapeRenderer.begin(ShapeType.Line);
shapeRenderer.color(1, 1, 0, 1);
shapeRenderer.line(x, y, x2, y2);
shapeRenderer.rect(x, y, width, height);
shapeRenderer.circle(x, y, radius);
shapeRenderer.end();
shapeRenderer.begin(ShapeType.Filled);
shapeRenderer.color(0, 1, 0, 1);
shapeRenderer.rect(x, y, width, height);
shapeRenderer.circle(x, y, radius);
shapeRenderer.end();
</code>
</pre>
The class has a second matrix called the transformation matrix which is used to rotate, scale and translate shapes in a more
flexible manner. This mechanism works much like matrix operations in OpenGL ES 1.x. The following example shows how to rotate a
rectangle around its center using the z-axis as the rotation axis and placing it's center at (20, 12, 2):
<pre>
shapeRenderer.begin(ShapeType.Line);
shapeRenderer.identity();
shapeRenderer.translate(20, 12, 2);
shapeRenderer.rotate(0, 0, 1, 90);
shapeRenderer.rect(-width / 2, -height / 2, width, height);
shapeRenderer.end();
</pre>
Matrix operations all use postmultiplication and work just like glTranslate, glScale and glRotate. The last transformation
specified will be the first that is applied to a shape (rotate then translate in the above example).
The projection and transformation matrices are a state of the ShapeRenderer, just like the color and will be applied to all
shapes until they are changed.
</div>
<dl><dt><span class="strong">Author:
</span></dt>
<dd>mzechner, stbachmann, Nathan Sweet
</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested_class_summary">
<!-- -->
</a>
<h3>Nested Class Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes
</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type
</th>
<th class="colLast" scope="col">Class and Description
</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils">ShapeRenderer.ShapeType
</a></strong></code>
<div class="block">Shape types to be used with
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType)"><code>begin(ShapeType)
</code></a>.
</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors
</span><span class="tabEnd"> </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/glutils/ShapeRenderer.html#ShapeRenderer()">ShapeRenderer
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#ShapeRenderer(int)">ShapeRenderer
</a></strong>(int
maxVertices)
</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>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#arc(float, float, float, float, float)">arc
</a></strong>(float
x,
float
y,
float
radius,
float
start,
float
angle)
</code>
<div class="block">Calls
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#arc(float, float, float, float, float, int)"><code>arc(float, float, float, float, float, int)
</code></a> by estimating the number of segments needed for a smooth arc.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#arc(float, float, float, float, float, int)">arc
</a></strong>(float
x,
float
y,
float
radius,
float
start,
float
angle,
int
segments)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType)">begin
</a></strong>(
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils">ShapeRenderer.ShapeType
</a> type)
</code>
<div class="block">Starts a new batch of shapes.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#box(float, float, float, float, float, float)">box
</a></strong>(float
x,
float
y,
float
z,
float
width,
float
height,
float
depth)
</code>
<div class="block">Draws a box.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#circle(float, float, float)">circle
</a></strong>(float
x,
float
y,
float
radius)
</code>
<div class="block">Calls
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#circle(float, float, float, int)"><code>circle(float, float, float, int)
</code></a> by estimating the number of segments needed for a smooth circle.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#circle(float, float, float, int)">circle
</a></strong>(float
x,
float
y,
float
radius,
int
segments)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#cone(float, float, float, float, float)">cone
</a></strong>(float
x,
float
y,
float
z,
float
radius,
float
height)
</code>
<div class="block">Calls
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#cone(float, float, float, float, float, int)"><code>cone(float, float, float, float, float, int)
</code></a> by estimating the number of segments needed for a smooth
circular base.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#cone(float, float, float, float, float, int)">cone
</a></strong>(float
x,
float
y,
float
z,
float
radius,
float
height,
int
segments)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#curve(float, float, float, float, float, float, float, float, int)">curve
</a></strong>(float
x1,
float
y1,
float
cx1,
float
cy1,
float
cx2,
float
cy2,
float
x2,
float
y2,
int
segments)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#dispose()">dispose
</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/glutils/ShapeRenderer.html#ellipse(float, float, float, float)">ellipse
</a></strong>(float
x,
float
y,
float
width,
float
height)
</code>
<div class="block">Calls
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#ellipse(float, float, float, float, int)"><code>ellipse(float, float, float, float, int)
</code></a> by estimating the number of segments needed for a smooth ellipse.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#ellipse(float, float, float, float, int)">ellipse
</a></strong>(float
x,
float
y,
float
width,
float
height,
int
segments)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#end()">end
</a></strong>()
</code>
<div class="block">Finishes the batch of shapes and ensures they get rendered.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#flush()">flush
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#getColor()">getColor
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils">ShapeRenderer.ShapeType
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#getCurrentType()">getCurrentType
</a></strong>()
</code>
<div class="block">Returns the current
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> used
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#getProjectionMatrix()">getProjectionMatrix
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/graphics/glutils/ImmediateModeRenderer.html" title="interface in com.badlogic.gdx.graphics.glutils">ImmediateModeRenderer
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#getRenderer()">getRenderer
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#getTransformMatrix()">getTransformMatrix
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#identity()">identity
</a></strong>()
</code>
<div class="block">Sets the transformation matrix to identity.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#line(float, float, float, float)">line
</a></strong>(float
x,
float
y,
float
x2,
float
y2)
</code>
<div class="block">Draws a line in the x/y plane.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#line(float, float, float, float, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color)">line
</a></strong>(float
x,
float
y,
float
x2,
float
y2,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> c1,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> c2)
</code>
<div class="block">Draws a line in the x/y plane.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#line(float, float, float, float, float, float)">line
</a></strong>(float
x,
float
y,
float
z,
float
x2,
float
y2,
float
z2)
</code>
<div class="block">Draws a line.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#line(float, float, float, float, float, float, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color)">line
</a></strong>(float
x,
float
y,
float
z,
float
x2,
float
y2,
float
z2,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> c1,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> c2)
</code>
<div class="block">Draws a line.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#line(com.badlogic.gdx.math.Vector2, com.badlogic.gdx.math.Vector2)">line
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> v0,
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> v1)
</code>
<div class="block">Draws a line.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#line(com.badlogic.gdx.math.Vector3, com.badlogic.gdx.math.Vector3)">line
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> v0,
<a href="../../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> v1)
</code>
<div class="block">Draws a line.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#point(float, float, float)">point
</a></strong>(float
x,
float
y,
float
z)
</code>
<div class="block">Draws a point.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#polygon(float[])">polygon
</a></strong>(float[]
vertices)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#polygon(float[], int, int)">polygon
</a></strong>(float[]
vertices,
int
offset,
int
count)
</code>
<div class="block">Draws a polygon in the x/y plane.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#polyline(float[])">polyline
</a></strong>(float[]
vertices)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#polyline(float[], int, int)">polyline
</a></strong>(float[]
vertices,
int
offset,
int
count)
</code>
<div class="block">Draws a polyline in the x/y plane.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#rect(float, float, float, float)">rect
</a></strong>(float
x,
float
y,
float
width,
float
height)
</code>
<div class="block">Draws a rectangle in the x/y plane.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#rect(float, float, float, float, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color)">rect
</a></strong>(float
x,
float
y,
float
width,
float
height,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col1,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col2,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col3,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col4)
</code>
<div class="block">Draws a rectangle in the x/y plane.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#rect(float, float, float, float, float, float, float)">rect
</a></strong>(float
x,
float
y,
float
width,
float
height,
float
originX,
float
originY,
float
rotation)
</code>
<div class="block">Draws a rectangle in the x/y plane.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#rect(float, float, float, float, float, float, float, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color)">rect
</a></strong>(float
x,
float
y,
float
width,
float
height,
float
originX,
float
originY,
float
rotation,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col1,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col2,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col3,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col4)
</code>
<div class="block">Draws a rectangle in the x/y plane.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#rotate(float, float, float, float)">rotate
</a></strong>(float
axisX,
float
axisY,
float
axisZ,
float
angle)
</code>
<div class="block">Multiplies the current transformation matrix by a rotation matrix.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#scale(float, float, float)">scale
</a></strong>(float
scaleX,
float
scaleY,
float
scaleZ)
</code>
<div class="block">Multiplies the current transformation matrix by a scale matrix.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#setColor(com.badlogic.gdx.graphics.Color)">setColor
</a></strong>(
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> color)
</code>
<div class="block">Sets the
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics"><code>Color
</code></a> to be used by shapes.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#setColor(float, float, float, float)">setColor
</a></strong>(float
r,
float
g,
float
b,
float
a)
</code>
<div class="block">Sets the
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics"><code>Color
</code></a> to be used by shapes.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#setProjectionMatrix(com.badlogic.gdx.math.Matrix4)">setProjectionMatrix
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> matrix)
</code>
<div class="block">Sets the projection matrix to be used for rendering.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#setTransformMatrix(com.badlogic.gdx.math.Matrix4)">setTransformMatrix
</a></strong>(
<a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> matrix)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#translate(float, float, float)">translate
</a></strong>(float
x,
float
y,
float
z)
</code>
<div class="block">Multiplies the current transformation matrix by a translation matrix.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#triangle(float, float, float, float, float, float)">triangle
</a></strong>(float
x1,
float
y1,
float
x2,
float
y2,
float
x3,
float
y3)
</code>
<div class="block">Draws a triangle in x/y plane.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#triangle(float, float, float, float, float, float, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color)">triangle
</a></strong>(float
x1,
float
y1,
float
x2,
float
y2,
float
x3,
float
y3,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col1,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col2,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col3)
</code>
<div class="block">Draws a triangle in x/y plane with coloured corners.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#x(float, float, float)">x
</a></strong>(float
x,
float
y,
float
radius)
</code>
<div class="block">Draws two crossed lines.
</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="ShapeRenderer()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ShapeRenderer
</h4>
<pre>public
ShapeRenderer()
</pre>
</li>
</ul>
<a name="ShapeRenderer(int)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ShapeRenderer
</h4>
<pre>public
ShapeRenderer(int
maxVertices)
</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail
</h3>
<a name="setColor(com.badlogic.gdx.graphics.Color)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setColor
</h4>
<pre>public
void
setColor(
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> color)
</pre>
<div class="block">Sets the
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics"><code>Color
</code></a> to be used by shapes.
</div>
</li>
</ul>
<a name="setColor(float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setColor
</h4>
<pre>public
void
setColor(float
r,
float
g,
float
b,
float
a)
</pre>
<div class="block">Sets the
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics"><code>Color
</code></a> to be used by shapes.
</div>
</li>
</ul>
<a name="getColor()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getColor
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> getColor()
</pre>
</li>
</ul>
<a name="setProjectionMatrix(com.badlogic.gdx.math.Matrix4)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setProjectionMatrix
</h4>
<pre>public
void
setProjectionMatrix(
<a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> matrix)
</pre>
<div class="block">Sets the projection matrix to be used for rendering. Usually this will be set to
<a href="../../../../../com/badlogic/gdx/graphics/Camera.html#combined"><code>Camera.combined
</code></a>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>matrix
</code> -
</dd></dl>
</li>
</ul>
<a name="getProjectionMatrix()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getProjectionMatrix
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> getProjectionMatrix()
</pre>
</li>
</ul>
<a name="setTransformMatrix(com.badlogic.gdx.math.Matrix4)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setTransformMatrix
</h4>
<pre>public
void
setTransformMatrix(
<a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> matrix)
</pre>
</li>
</ul>
<a name="getTransformMatrix()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTransformMatrix
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> getTransformMatrix()
</pre>
</li>
</ul>
<a name="identity()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>identity
</h4>
<pre>public
void
identity()
</pre>
<div class="block">Sets the transformation matrix to identity.
</div>
</li>
</ul>
<a name="translate(float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>translate
</h4>
<pre>public
void
translate(float
x,
float
y,
float
z)
</pre>
<div class="block">Multiplies the current transformation matrix by a translation matrix.
</div>
</li>
</ul>
<a name="rotate(float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rotate
</h4>
<pre>public
void
rotate(float
axisX,
float
axisY,
float
axisZ,
float
angle)
</pre>
<div class="block">Multiplies the current transformation matrix by a rotation matrix.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>angle
</code> - angle in degrees
</dd></dl>
</li>
</ul>
<a name="scale(float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>scale
</h4>
<pre>public
void
scale(float
scaleX,
float
scaleY,
float
scaleZ)
</pre>
<div class="block">Multiplies the current transformation matrix by a scale matrix.
</div>
</li>
</ul>
<a name="begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>begin
</h4>
<pre>public
void
begin(
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils">ShapeRenderer.ShapeType
</a> type)
</pre>
<div class="block">Starts a new batch of shapes. All shapes within the batch have to have the type specified. E.g. if
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Point"><code>ShapeRenderer.ShapeType.Point
</code></a>
is specified, only call #point().
The call to this method must be paired with a call to
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#end()"><code>end()
</code></a>.
In case OpenGL ES 1.x is used, the projection and modelview matrix will be modified.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>type
</code> - the
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a>.
</dd></dl>
</li>
</ul>
<a name="point(float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>point
</h4>
<pre>public
void
point(float
x,
float
y,
float
z)
</pre>
<div class="block">Draws a point. The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed to begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Point"><code>ShapeRenderer.ShapeType.Point
</code></a>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>x
</code> -
</dd><dd><code>y
</code> -
</dd><dd><code>z
</code> -
</dd></dl>
</li>
</ul>
<a name="line(float, float, float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>line
</h4>
<pre>public final
void
line(float
x,
float
y,
float
z,
float
x2,
float
y2,
float
z2)
</pre>
<div class="block">Draws a line. The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed to begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Line"><code>ShapeRenderer.ShapeType.Line
</code></a>.
</div>
</li>
</ul>
<a name="line(com.badlogic.gdx.math.Vector3, com.badlogic.gdx.math.Vector3)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>line
</h4>
<pre>public final
void
line(
<a href="../../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> v0,
<a href="../../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> v1)
</pre>
<div class="block">Draws a line. The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed to begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Line"><code>ShapeRenderer.ShapeType.Line
</code></a>. Lazy method that "just" calls the
"other" method and unpacks the Vector3 for you
</div>
</li>
</ul>
<a name="line(float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>line
</h4>
<pre>public final
void
line(float
x,
float
y,
float
x2,
float
y2)
</pre>
<div class="block">Draws a line in the x/y plane. The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed to begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Line"><code>ShapeRenderer.ShapeType.Line
</code></a>.
</div>
</li>
</ul>
<a name="line(com.badlogic.gdx.math.Vector2, com.badlogic.gdx.math.Vector2)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>line
</h4>
<pre>public final
void
line(
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> v0,
<a href="../../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2
</a> v1)
</pre>
<div class="block">Draws a line. The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed to begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Line"><code>ShapeRenderer.ShapeType.Line
</code></a>. Lazy method that "just" calls the
"other" method and unpacks the Vector2 for you
</div>
</li>
</ul>
<a name="line(float, float, float, float, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>line
</h4>
<pre>public final
void
line(float
x,
float
y,
float
x2,
float
y2,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> c1,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> c2)
</pre>
<div class="block">Draws a line in the x/y plane. The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed to begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Line"><code>ShapeRenderer.ShapeType.Line
</code></a>. The line is drawn
with 2 colors interpolated between start
& end point.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>c1</code> - Color at start of the line</dd><dd><code>c2</code> - Color at end of the line</dd></dl>
</li>
</ul>
<a name="line(float, float, float, float, float, float, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>line</h4>
<pre>public void
line(float
x,
float
y,
float
z,
float
x2,
float
y2,
float
z2,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> c1,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> c2)
</pre>
<div class="block">Draws a line. The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed to begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Line"><code>ShapeRenderer.ShapeType.Line
</code></a>. The line is drawn with 2 colors
interpolated between start
& end point.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>c1</code> - Color at start of the line</dd><dd><code>c2</code> - Color at end of the line</dd></dl>
</li>
</ul>
<a name="curve(float, float, float, float, float, float, float, float, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>curve</h4>
<pre>public void
curve(float
x1,
float
y1,
float
cx1,
float
cy1,
float
cx2,
float
cy2,
float
x2,
float
y2,
int
segments)
</pre>
</li>
</ul>
<a name="triangle(float, float, float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>triangle
</h4>
<pre>public
void
triangle(float
x1,
float
y1,
float
x2,
float
y2,
float
x3,
float
y3)
</pre>
<div class="block">Draws a triangle in x/y plane.
The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed to begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Filled"><code>ShapeRenderer.ShapeType.Filled
</code></a> or
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Line"><code>ShapeRenderer.ShapeType.Line
</code></a>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>x1
</code> - x of first point
</dd><dd><code>y1
</code> - y of first point
</dd><dd><code>x2
</code> - x of second point
</dd><dd><code>y2
</code> - y of second point
</dd><dd><code>x3
</code> - x of third point
</dd><dd><code>y3
</code> - y of third point
</dd></dl>
</li>
</ul>
<a name="triangle(float, float, float, float, float, float, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>triangle
</h4>
<pre>public
void
triangle(float
x1,
float
y1,
float
x2,
float
y2,
float
x3,
float
y3,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col1,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col2,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col3)
</pre>
<div class="block">Draws a triangle in x/y plane with coloured corners.
The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed to begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Filled"><code>ShapeRenderer.ShapeType.Filled
</code></a> or
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Line"><code>ShapeRenderer.ShapeType.Line
</code></a>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>x1
</code> - x of first point
</dd><dd><code>y1
</code> - y of first point
</dd><dd><code>x2
</code> - x of second point
</dd><dd><code>y2
</code> - y of second point
</dd><dd><code>x3
</code> - x of third point
</dd><dd><code>y3
</code> - y of third point
</dd><dd><code>col1
</code> - color of the point defined by x1 and y1
</dd><dd><code>col2
</code> - color of the point defined by x2 and y2
</dd><dd><code>col3
</code> - color of the point defined by x3 and y3
</dd></dl>
</li>
</ul>
<a name="rect(float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rect
</h4>
<pre>public
void
rect(float
x,
float
y,
float
width,
float
height)
</pre>
<div class="block">Draws a rectangle in the x/y plane. The x and y coordinate specify the bottom left corner of the rectangle. The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed to begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Filled"><code>ShapeRenderer.ShapeType.Filled
</code></a> or
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Line"><code>ShapeRenderer.ShapeType.Line
</code></a>.
</div>
</li>
</ul>
<a name="rect(float, float, float, float, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rect
</h4>
<pre>public
void
rect(float
x,
float
y,
float
width,
float
height,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col1,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col2,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col3,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col4)
</pre>
<div class="block">Draws a rectangle in the x/y plane. The x and y coordinate specify the bottom left corner of the rectangle. The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed to begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Filled"><code>ShapeRenderer.ShapeType.Filled
</code></a> or
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Line"><code>ShapeRenderer.ShapeType.Line
</code></a>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>col1
</code> - The color at (x, y)
</dd><dd><code>col2
</code> - The color at (x + width, y)
</dd><dd><code>col3
</code> - The color at (x + width, y + height)
</dd><dd><code>col4
</code> - The color at (x, y + height)
</dd></dl>
</li>
</ul>
<a name="rect(float, float, float, float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rect
</h4>
<pre>public
void
rect(float
x,
float
y,
float
width,
float
height,
float
originX,
float
originY,
float
rotation)
</pre>
<div class="block">Draws a rectangle in the x/y plane. The x and y coordinate specify the bottom left corner of the rectangle. The originX and
originY specify the point about which to rotate the rectangle. The rotation is in degrees. The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed to
begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Filled"><code>ShapeRenderer.ShapeType.Filled
</code></a> or
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Line"><code>ShapeRenderer.ShapeType.Line
</code></a>.
</div>
</li>
</ul>
<a name="rect(float, float, float, float, float, float, float, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.Color)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rect
</h4>
<pre>public
void
rect(float
x,
float
y,
float
width,
float
height,
float
originX,
float
originY,
float
rotation,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col1,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col2,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col3,
<a href="../../../../../com/badlogic/gdx/graphics/Color.html" title="class in com.badlogic.gdx.graphics">Color
</a> col4)
</pre>
<div class="block">Draws a rectangle in the x/y plane. The x and y coordinate specify the bottom left corner of the rectangle. The originX and
originY specify the point about which to rotate the rectangle. The rotation is in degrees. The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed to
begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Filled"><code>ShapeRenderer.ShapeType.Filled
</code></a> or
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Line"><code>ShapeRenderer.ShapeType.Line
</code></a>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>col1
</code> - The color at (x, y)
</dd><dd><code>col2
</code> - The color at (x + width, y)
</dd><dd><code>col3
</code> - The color at (x + width, y + height)
</dd><dd><code>col4
</code> - The color at (x, y + height)
</dd></dl>
</li>
</ul>
<a name="box(float, float, float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>box
</h4>
<pre>public
void
box(float
x,
float
y,
float
z,
float
width,
float
height,
float
depth)
</pre>
<div class="block">Draws a box. The x, y and z coordinate specify the bottom left front corner of the rectangle. The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed
to begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Line"><code>ShapeRenderer.ShapeType.Line
</code></a>.
</div>
</li>
</ul>
<a name="x(float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>x
</h4>
<pre>public
void
x(float
x,
float
y,
float
radius)
</pre>
<div class="block">Draws two crossed lines.
</div>
</li>
</ul>
<a name="arc(float, float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>arc
</h4>
<pre>public
void
arc(float
x,
float
y,
float
radius,
float
start,
float
angle)
</pre>
<div class="block">Calls
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#arc(float, float, float, float, float, int)"><code>arc(float, float, float, float, float, int)
</code></a> by estimating the number of segments needed for a smooth arc.
</div>
</li>
</ul>
<a name="arc(float, float, float, float, float, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>arc
</h4>
<pre>public
void
arc(float
x,
float
y,
float
radius,
float
start,
float
angle,
int
segments)
</pre>
</li>
</ul>
<a name="circle(float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>circle
</h4>
<pre>public
void
circle(float
x,
float
y,
float
radius)
</pre>
<div class="block">Calls
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#circle(float, float, float, int)"><code>circle(float, float, float, int)
</code></a> by estimating the number of segments needed for a smooth circle.
</div>
</li>
</ul>
<a name="circle(float, float, float, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>circle
</h4>
<pre>public
void
circle(float
x,
float
y,
float
radius,
int
segments)
</pre>
</li>
</ul>
<a name="ellipse(float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ellipse
</h4>
<pre>public
void
ellipse(float
x,
float
y,
float
width,
float
height)
</pre>
<div class="block">Calls
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#ellipse(float, float, float, float, int)"><code>ellipse(float, float, float, float, int)
</code></a> by estimating the number of segments needed for a smooth ellipse.
</div>
</li>
</ul>
<a name="ellipse(float, float, float, float, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ellipse
</h4>
<pre>public
void
ellipse(float
x,
float
y,
float
width,
float
height,
int
segments)
</pre>
</li>
</ul>
<a name="cone(float, float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>cone
</h4>
<pre>public
void
cone(float
x,
float
y,
float
z,
float
radius,
float
height)
</pre>
<div class="block">Calls
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#cone(float, float, float, float, float, int)"><code>cone(float, float, float, float, float, int)
</code></a> by estimating the number of segments needed for a smooth
circular base.
</div>
</li>
</ul>
<a name="cone(float, float, float, float, float, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>cone
</h4>
<pre>public
void
cone(float
x,
float
y,
float
z,
float
radius,
float
height,
int
segments)
</pre>
</li>
</ul>
<a name="polygon(float[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>polygon
</h4>
<pre>public
void
polygon(float[]
vertices)
</pre>
<dl><dt><span class="strong">See Also:
</span></dt><dd><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#polygon(float[], int, int)"><code>polygon(float[], int, int)
</code></a></dd></dl>
</li>
</ul>
<a name="polygon(float[], int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>polygon
</h4>
<pre>public
void
polygon(float[]
vertices,
int
offset,
int
count)
</pre>
<div class="block">Draws a polygon in the x/y plane. The vertices must contain at least 3 points (6 floats x,y). The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed
to begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Line"><code>ShapeRenderer.ShapeType.Line
</code></a>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>vertices
</code> -
</dd></dl>
</li>
</ul>
<a name="polyline(float[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>polyline
</h4>
<pre>public
void
polyline(float[]
vertices)
</pre>
<dl><dt><span class="strong">See Also:
</span></dt><dd><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.html#polyline(float[], int, int)"><code>polyline(float[], int, int)
</code></a></dd></dl>
</li>
</ul>
<a name="polyline(float[], int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>polyline
</h4>
<pre>public
void
polyline(float[]
vertices,
int
offset,
int
count)
</pre>
<div class="block">Draws a polyline in the x/y plane. The vertices must contain at least 2 points (4 floats x,y). The
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> passed
to begin has to be
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html#Line"><code>ShapeRenderer.ShapeType.Line
</code></a>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>vertices
</code> -
</dd></dl>
</li>
</ul>
<a name="end()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>end
</h4>
<pre>public
void
end()
</pre>
<div class="block">Finishes the batch of shapes and ensures they get rendered.
</div>
</li>
</ul>
<a name="flush()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>flush
</h4>
<pre>public
void
flush()
</pre>
</li>
</ul>
<a name="getCurrentType()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCurrentType
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils">ShapeRenderer.ShapeType
</a> getCurrentType()
</pre>
<div class="block">Returns the current
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><code>ShapeRenderer.ShapeType
</code></a> used
</div>
</li>
</ul>
<a name="getRenderer()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRenderer
</h4>
<pre>public
<a href="../../../../../com/badlogic/gdx/graphics/glutils/ImmediateModeRenderer.html" title="interface in com.badlogic.gdx.graphics.glutils">ImmediateModeRenderer
</a> getRenderer()
</pre>
</li>
</ul>
<a name="dispose()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>dispose
</h4>
<pre>public
void
dispose()
</pre>
</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/ShapeRenderer.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/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils"><span class="strong">Prev Class
</span></a></li>
<li><a href="../../../../../com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html" title="enum in com.badlogic.gdx.graphics.glutils"><span class="strong">Next Class
</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/badlogic/gdx/graphics/glutils/ShapeRenderer.html" target="_top">Frames
</a></li>
<li><a href="ShapeRenderer.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><a href="#nested_class_summary">Nested
</a> |
</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>