pixi.js/docs/classes/WebGLBatch.html
2013-02-24 17:12:35 +00:00

1013 lines
22 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>WebGLBatch - Pixi.js API</title>
<link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
<link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
<script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="..&#x2F;classes/AssetLoader.html">AssetLoader</a></li>
<li><a href="..&#x2F;classes/BaseTexture.html">BaseTexture</a></li>
<li><a href="..&#x2F;classes/CanvasRenderer.html">CanvasRenderer</a></li>
<li><a href="..&#x2F;classes/DisplayObject.html">DisplayObject</a></li>
<li><a href="..&#x2F;classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
<li><a href="..&#x2F;classes/MovieClip.html">MovieClip</a></li>
<li><a href="..&#x2F;classes/Point.html">Point</a></li>
<li><a href="..&#x2F;classes/Rectangle.html">Rectangle</a></li>
<li><a href="..&#x2F;classes/Sprite.html">Sprite</a></li>
<li><a href="..&#x2F;classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
<li><a href="..&#x2F;classes/Stage.html">Stage</a></li>
<li><a href="..&#x2F;classes/Texture.html">Texture</a></li>
<li><a href="..&#x2F;classes/WebGLBatch.html">WebGLBatch</a></li>
<li><a href="..&#x2F;classes/WebGLRenderer.html">WebGLRenderer</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="..&#x2F;modules/PIXI.html">PIXI</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>WebGLBatch Class</h1>
<div class="box meta">
<div class="foundat">
Defined in: <a href="..&#x2F;files&#x2F;pixi_renderers_WebGLBatch.js.html#l42"><code>pixi&#x2F;renderers&#x2F;WebGLBatch.js:42</code></a>
</div>
Module: <a href="../modules/PIXI.html">PIXI</a>
</div>
<div class="box intro">
<p>A WebGLBatch Enables a group of sprites to be drawn using the same settings.
if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.</p>
</div>
<div id="classdocs" class="tabview">
<ul class="api-class-tabs">
<li class="api-class-tab index"><a href="#index">Index</a></li>
<li class="api-class-tab methods"><a href="#methods">Methods</a></li>
</ul>
<div>
<div id="index" class="api-class-tabpanel index">
<h2 class="off-left">Item Index</h2>
<div class="index-section methods">
<h3>Methods</h3>
<ul class="index-list methods">
<li class="index-item method">
<a href="#method_init">init</a>
</li>
<li class="index-item method">
<a href="#method_insertAfter">insertAfter</a>
</li>
<li class="index-item method">
<a href="#method_insertBefore">insertBefore</a>
</li>
<li class="index-item method">
<a href="#method_merge">merge</a>
</li>
<li class="index-item method">
<a href="#method_refresh">refresh</a>
</li>
<li class="index-item method">
<a href="#method_remove">remove</a>
</li>
<li class="index-item method">
<a href="#method_render">render</a>
</li>
<li class="index-item method">
<a href="#method_split">split</a>
</li>
<li class="index-item method">
<a href="#method_update">update</a>
</li>
</ul>
</div>
</div>
<div id="methods" class="api-class-tabpanel">
<h2 class="off-left">Methods</h2>
<div id="method_init" class="method item">
<h3 class="name"><code>init</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>sprite</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLBatch.js.html#l98"><code>pixi&#x2F;renderers&#x2F;WebGLBatch.js:98</code></a>
</p>
</div>
<div class="description">
<p>inits the batch's texture and blend mode based if the supplied sprite</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">sprite</code>
<span class="type"><a href="../classes/Sprite.html" class="crosslink">Sprite</a></span>
<div class="param-description">
<p>the first sprite to be added to the batch. Only sprites with the same base texture and blend mode will be allowed to be added to this batch</p>
</div>
</li>
</ul>
</div>
</div>
<div id="method_insertAfter" class="method item">
<h3 class="name"><code>insertAfter</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>sprite</code>
</li>
<li class="arg">
<code>previousSprite</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLBatch.js.html#l145"><code>pixi&#x2F;renderers&#x2F;WebGLBatch.js:145</code></a>
</p>
</div>
<div class="description">
<p>inserts a sprite after the specified sprite</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">sprite</code>
<span class="type"><a href="../classes/Sprite.html" class="crosslink">Sprite</a></span>
<div class="param-description">
<p>the sprite to be added</p>
</div>
</li>
<li class="param">
<code class="param-name">previousSprite</code>
<span class="type"><a href="../classes/Sprite.html" class="crosslink">Sprite</a></span>
<div class="param-description">
<p>the first sprite will be inserted after this sprite</p>
</div>
</li>
</ul>
</div>
</div>
<div id="method_insertBefore" class="method item">
<h3 class="name"><code>insertBefore</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>sprite</code>
</li>
<li class="arg">
<code>nextSprite</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLBatch.js.html#l117"><code>pixi&#x2F;renderers&#x2F;WebGLBatch.js:117</code></a>
</p>
</div>
<div class="description">
<p>inserts a sprite before the specified sprite</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">sprite</code>
<span class="type"><a href="../classes/Sprite.html" class="crosslink">Sprite</a></span>
<div class="param-description">
<p>the sprite to be added</p>
</div>
</li>
<li class="param">
<code class="param-name">nextSprite</code>
<span class="type">NextSprite</span>
<div class="param-description">
<p>the first sprite will be inserted before this sprite</p>
</div>
</li>
</ul>
</div>
</div>
<div id="method_merge" class="method item">
<h3 class="name"><code>merge</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>batch</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLBatch.js.html#l267"><code>pixi&#x2F;renderers&#x2F;WebGLBatch.js:267</code></a>
</p>
</div>
<div class="description">
<p>Merges two batchs together</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">batch</code>
<span class="type"><a href="../classes/WebGLBatch.html" class="crosslink">WebGLBatch</a></span>
<div class="param-description">
<p>the batch that will be merged</p>
</div>
</li>
</ul>
</div>
</div>
<div id="method_refresh" class="method item">
<h3 class="name"><code>refresh</code></h3>
<span class="paren">()</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLBatch.js.html#l345"><code>pixi&#x2F;renderers&#x2F;WebGLBatch.js:345</code></a>
</p>
</div>
<div class="description">
<p>Refresh's all the data in the batch and sync's it with the webGL buffers</p>
</div>
</div>
<div id="method_remove" class="method item">
<h3 class="name"><code>remove</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>sprite</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLBatch.js.html#l175"><code>pixi&#x2F;renderers&#x2F;WebGLBatch.js:175</code></a>
</p>
</div>
<div class="description">
<p>removes a sprite from the batch</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">sprite</code>
<span class="type"><a href="../classes/Sprite.html" class="crosslink">Sprite</a></span>
<div class="param-description">
<p>the sprite to be removed</p>
</div>
</li>
</ul>
</div>
</div>
<div id="method_render" class="method item">
<h3 class="name"><code>render</code></h3>
<span class="paren">()</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLBatch.js.html#l491"><code>pixi&#x2F;renderers&#x2F;WebGLBatch.js:491</code></a>
</p>
</div>
<div class="description">
<p>Draws the batch to the frame buffer</p>
</div>
</div>
<div id="method_split" class="method item">
<h3 class="name"><code>split</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>sprite</code>
</li>
</ul><span class="paren">)</span>
</div>
<span class="returns-inline">
<span class="type"><a href="../classes/WebGLBatch.html" class="crosslink">WebGLBatch</a></span>
</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLBatch.js.html#l218"><code>pixi&#x2F;renderers&#x2F;WebGLBatch.js:218</code></a>
</p>
</div>
<div class="description">
<p>Splits the batch into two with the specified sprite being the start of the new batch.</p>
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">sprite</code>
<span class="type"><a href="../classes/Sprite.html" class="crosslink">Sprite</a></span>
<div class="param-description">
<p>the sprite that indicates where the batch should be split</p>
</div>
</li>
</ul>
</div>
<div class="returns">
<h4>Returns:</h4>
<div class="returns-description">
<span class="type"><a href="../classes/WebGLBatch.html" class="crosslink">WebGLBatch</a></span>:
the new batch
</div>
</div>
</div>
<div id="method_update" class="method item">
<h3 class="name"><code>update</code></h3>
<span class="paren">()</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLBatch.js.html#l400"><code>pixi&#x2F;renderers&#x2F;WebGLBatch.js:400</code></a>
</p>
</div>
<div class="description">
<p>Updates all the relevant geometry and uploads the data to the GPU</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="..&#x2F;assets/js/yui-prettify.js"></script>
<script src="..&#x2F;assets/../api.js"></script>
<script src="..&#x2F;assets/js/api-filter.js"></script>
<script src="..&#x2F;assets/js/api-list.js"></script>
<script src="..&#x2F;assets/js/api-search.js"></script>
<script src="..&#x2F;assets/js/apidocs.js"></script>
</body>
</html>