Documentation first draft

This commit is contained in:
Mat Groves 2013-02-24 17:12:35 +00:00
parent 5786d33f94
commit 0558060de2
65 changed files with 2106 additions and 423 deletions

View file

@ -11,10 +11,12 @@
<target name="run">
<jscomp compilationLevel="simple" debug="false" output="../../Flash vs HTML/js/pixi.js">
<!-- <jscomp compilationLevel="simple" debug="false" output="../../Run Pixie Run/js/pixi.js"> -->
<sources dir="../src/pixi/">
<file name="Pixi.js"/>
<file name="Point.js"/>
<file name="Rectangle.js"/>
<file name="utils/Utils.js"/>

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>AssetLoader - The Foo API</title>
<title>AssetLoader - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -138,7 +138,7 @@
<div class="box intro">
<p>A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
<p>A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrame(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
When all items have been loaded this class will dispatch a 'loaded' event
As each individual item is loaded this class will dispatch a 'progress' event</p>
</div>
@ -245,6 +245,8 @@ As each individual item is loaded this class will dispatch a 'progress' event</p
<li class="api-class-tab events"><a href="#events">Events</a></li>
</ul>
<div>
@ -273,6 +275,28 @@ As each individual item is loaded this class will dispatch a 'progress' event</p
<div class="index-section events">
<h3>Events</h3>
<ul class="index-list events extends">
<li class="index-item event">
<a href="#event_onComplete">onComplete</a>
</li>
<li class="index-item event">
<a href="#event_onProgress">onProgress</a>
</li>
</ul>
</div>
</div>
@ -305,7 +329,7 @@ As each individual item is loaded this class will dispatch a 'progress' event</p
<a href="..&#x2F;files&#x2F;pixi_loaders_AssetLoader.js.html#l19"><code>pixi&#x2F;loaders&#x2F;AssetLoader.js:19</code></a>
<a href="..&#x2F;files&#x2F;pixi_loaders_AssetLoader.js.html#l18"><code>pixi&#x2F;loaders&#x2F;AssetLoader.js:18</code></a>
</p>
@ -332,6 +356,98 @@ As each individual item is loaded this class will dispatch a 'progress' event</p
<div id="events" class="api-class-tabpanel">
<h2 class="off-left">Events</h2>
<div id="event_onComplete" class="events item">
<h3 class="name"><code>onComplete</code></h3>
<span class="type"></span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_loaders_AssetLoader.js.html#l33"><code>pixi&#x2F;loaders&#x2F;AssetLoader.js:33</code></a>
</p>
</div>
<div class="description">
<p>Fired when all the assets have loaded</p>
</div>
</div>
<div id="event_onProgress" class="events item">
<h3 class="name"><code>onProgress</code></h3>
<span class="type"></span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_loaders_AssetLoader.js.html#l28"><code>pixi&#x2F;loaders&#x2F;AssetLoader.js:28</code></a>
</p>
</div>
<div class="description">
<p>Fired when an item has loaded</p>
</div>
</div>
</div>
</div>
</div>

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>BaseTexture - The Foo API</title>
<title>BaseTexture - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>CanvasRenderer - The Foo API</title>
<title>CanvasRenderer - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -134,7 +134,7 @@
<div class="box intro">
<p>the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
<p>the CanvasRenderer draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
Dont forget to add the view to your DOM or you will not see anything :)</p>
</div>
@ -265,7 +265,7 @@ Dont forget to add the view to your DOM or you will not see anything :)</p>
<a href="..&#x2F;files&#x2F;pixi_renderers_CanvasRenderer.js.html#l54"><code>pixi&#x2F;renderers&#x2F;CanvasRenderer.js:54</code></a>
<a href="..&#x2F;files&#x2F;pixi_renderers_CanvasRenderer.js.html#l53"><code>pixi&#x2F;renderers&#x2F;CanvasRenderer.js:53</code></a>
</p>
@ -341,7 +341,7 @@ Dont forget to add the view to your DOM or you will not see anything :)</p>
<a href="..&#x2F;files&#x2F;pixi_renderers_CanvasRenderer.js.html#l43"><code>pixi&#x2F;renderers&#x2F;CanvasRenderer.js:43</code></a>
<a href="..&#x2F;files&#x2F;pixi_renderers_CanvasRenderer.js.html#l42"><code>pixi&#x2F;renderers&#x2F;CanvasRenderer.js:42</code></a>
</p>

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>DisplayObject - The Foo API</title>
<title>DisplayObject - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>DisplayObjectContainer - The Foo API</title>
<title>DisplayObjectContainer - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Point - The Foo API</title>
<title>Point - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Rectangle - The Foo API</title>
<title>Rectangle - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Sprite - The Foo API</title>
<title>Sprite - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>SpriteSheetLoader - The Foo API</title>
<title>SpriteSheetLoader - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Stage - The Foo API</title>
<title>Stage - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -148,7 +148,17 @@
<h3 class="name"><code>Stage</code></h3>
<span class="paren">()</span>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>backgroundColor</code>
</li>
</ul><span class="paren">)</span>
</div>
@ -191,6 +201,29 @@
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">backgroundColor</code>
<span class="type">Number</span>
<div class="param-description">
<p>the background color of the stage</p>
</div>
</li>
</ul>
</div>
@ -224,20 +257,6 @@
<ul class="index-list methods extends">
<li class="index-item method">
<a href="#method___addChild">__addChild</a>
</li>
<li class="index-item method">
<a href="#method___removeChild">__removeChild</a>
</li>
<li class="index-item method inherited">
<a href="#method_addChild">addChild</a>
@ -257,6 +276,13 @@
</li>
<li class="index-item method">
<a href="#method_setBackgroundColor">setBackgroundColor</a>
</li>
<li class="index-item method">
@ -346,114 +372,6 @@
<h2 class="off-left">Methods</h2>
<div id="method___addChild" class="method item">
<h3 class="name"><code>__addChild</code></h3>
<span class="paren">()</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_Stage.js.html#l44"><code>pixi&#x2F;Stage.js:44</code></a>
</p>
</div>
<div class="description">
</div>
</div>
<div id="method___removeChild" class="method item">
<h3 class="name"><code>__removeChild</code></h3>
<span class="paren">()</span>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_Stage.js.html#l63"><code>pixi&#x2F;Stage.js:63</code></a>
</p>
</div>
<div class="description">
</div>
</div>
<div id="method_addChild" class="method item inherited">
<h3 class="name"><code>addChild</code></h3>
@ -724,6 +642,93 @@
</div>
<div id="method_setBackgroundColor" class="method item">
<h3 class="name"><code>setBackgroundColor</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>backgroundColor</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_Stage.js.html#l44"><code>pixi&#x2F;Stage.js:44</code></a>
</p>
</div>
<div class="description">
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">backgroundColor</code>
<span class="type">Number</span>
<div class="param-description">
</div>
</li>
</ul>
</div>
</div>
@ -759,7 +764,7 @@
<a href="..&#x2F;files&#x2F;pixi_Stage.js.html#l26"><code>pixi&#x2F;Stage.js:26</code></a>
<a href="..&#x2F;files&#x2F;pixi_Stage.js.html#l30"><code>pixi&#x2F;Stage.js:30</code></a>
</p>

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Texture - The Foo API</title>
<title>Texture - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -286,7 +286,7 @@
</li>
<li class="index-item method">
<a href="#method_fromFrameId">fromFrameId</a>
<a href="#method_fromFrame">fromFrame</a>
@ -461,8 +461,8 @@
</div>
<div id="method_fromFrameId" class="method item">
<h3 class="name"><code>fromFrameId</code></h3>
<div id="method_fromFrame" class="method item">
<h3 class="name"><code>fromFrame</code></h3>
<div class="args">

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>WebGLBatch - The Foo API</title>
<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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>WebGLRenderer - The Foo API</title>
<title>WebGLRenderer - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -139,6 +139,117 @@ Dont forget to add the view to your DOM or you will not see anything :)</p>
</div>
<div class="constructor">
<h2>Constructor</h2>
<div id="method_WebGLRenderer" class="method item">
<h3 class="name"><code>WebGLRenderer</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>width</code>
</li>
<li class="arg">
<code>height</code>
</li>
</ul><span class="paren">)</span>
</div>
<div class="meta">
<p>
Defined in
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLRenderer.js.html#l7"><code>pixi&#x2F;renderers&#x2F;WebGLRenderer.js:7</code></a>
</p>
</div>
<div class="description">
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">width</code>
<span class="type">Number</span>
<div class="param-description">
<p>the width of the canvas view</p>
</div>
</li>
<li class="param">
<code class="param-name">height</code>
<span class="type">Number</span>
<div class="param-description">
<p>the height of the canvas view</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<div id="classdocs" class="tabview">
<ul class="api-class-tabs">
@ -234,7 +345,7 @@ Dont forget to add the view to your DOM or you will not see anything :)</p>
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLRenderer.js.html#l156"><code>pixi&#x2F;renderers&#x2F;WebGLRenderer.js:156</code></a>
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLRenderer.js.html#l157"><code>pixi&#x2F;renderers&#x2F;WebGLRenderer.js:157</code></a>
</p>
@ -327,7 +438,7 @@ Dont forget to add the view to your DOM or you will not see anything :)</p>
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLRenderer.js.html#l525"><code>pixi&#x2F;renderers&#x2F;WebGLRenderer.js:525</code></a>
<a href="..&#x2F;files&#x2F;pixi_renderers_WebGLRenderer.js.html#l526"><code>pixi&#x2F;renderers&#x2F;WebGLRenderer.js:526</code></a>
</p>

View file

@ -1,9 +1,10 @@
{
"project": {
"name": "The Foo API",
"name": "Pixi.js API",
"logo": "../logo_small.png",
"description": "The Foo API: a library for doing X, Y, and Z",
"version": "1.2.1",
"url": "http://example.com/"
"version": "0.9",
"url": "http://goodboydigital.com/"
},
"files": {
"pixi/extras/Rope.js": {
@ -223,7 +224,7 @@
"module": "PIXI",
"file": "pixi/loaders/AssetLoader.js",
"line": 5,
"description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event",
"description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrame(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event",
"is_constructor": 1,
"extends": "EventTarget",
"params": [
@ -267,7 +268,7 @@
"module": "PIXI",
"file": "pixi/renderers/CanvasRenderer.js",
"line": 5,
"description": "the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)",
"description": "the CanvasRenderer draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDont forget to add the view to your DOM or you will not see anything :)",
"params": [
{
"name": "width",
@ -316,6 +317,7 @@
"file": "pixi/renderers/WebGLRenderer.js",
"line": 7,
"description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)",
"is_constructor": 1,
"params": [
{
"name": "width",
@ -420,6 +422,7 @@
"file": "pixi/MovieClip.js",
"line": 5,
"description": "A MovieClip is a simple way to display an animation depicted by a list of textures.",
"extends": "Sprite",
"is_constructor": 1,
"params": [
{
@ -530,7 +533,14 @@
"line": 5,
"description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered",
"extends": "DisplayObjectContainer",
"is_constructor": 1
"is_constructor": 1,
"params": [
{
"name": "backgroundColor",
"description": "the background color of the stage",
"type": "Number"
}
]
}
},
"classitems": [
@ -549,12 +559,12 @@
{
"file": "pixi/loaders/AssetLoader.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "AssetLoader"
},
{
"file": "pixi/loaders/AssetLoader.js",
"line": 19,
"line": 18,
"description": "The array of asset URLs that are going to be loaded",
"itemtype": "property",
"name": "assetURLs",
@ -563,14 +573,30 @@
},
{
"file": "pixi/loaders/AssetLoader.js",
"line": 32,
"line": 28,
"description": "Fired when an item has loaded",
"itemtype": "event",
"name": "onProgress",
"class": "AssetLoader"
},
{
"file": "pixi/loaders/AssetLoader.js",
"line": 33,
"description": "Fired when all the assets have loaded",
"itemtype": "event",
"name": "onComplete",
"class": "AssetLoader"
},
{
"file": "pixi/loaders/AssetLoader.js",
"line": 41,
"description": "This will begin loading the assets sequentially",
"class": "AssetLoader"
},
{
"file": "pixi/loaders/SpriteSheetLoader.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "SpriteSheetLoader"
},
{
@ -582,7 +608,7 @@
{
"file": "pixi/renderers/CanvasRenderer.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "CanvasRenderer"
},
{
@ -616,7 +642,7 @@
},
{
"file": "pixi/renderers/CanvasRenderer.js",
"line": 43,
"line": 42,
"description": "The canvas context that the everything is drawn to",
"itemtype": "property",
"name": "context",
@ -625,7 +651,7 @@
},
{
"file": "pixi/renderers/CanvasRenderer.js",
"line": 54,
"line": 53,
"description": "Renders the stage to its canvas view",
"itemtype": "method",
"name": "render",
@ -640,7 +666,7 @@
},
{
"file": "pixi/renderers/CanvasRenderer.js",
"line": 78,
"line": 81,
"description": "resizes the canvas view to the specified width and height",
"params": [
{
@ -656,21 +682,21 @@
},
{
"file": "pixi/renderers/CanvasRenderer.js",
"line": 92,
"line": 95,
"access": "private",
"tagname": "",
"class": "CanvasRenderer"
},
{
"file": "pixi/renderers/CanvasRenderer.js",
"line": 162,
"line": 165,
"access": "private",
"tagname": "",
"class": "CanvasRenderer"
},
{
"file": "pixi/renderers/CanvasRenderer.js",
"line": 197,
"line": 200,
"access": "private",
"tagname": "",
"class": "CanvasRenderer"
@ -678,7 +704,7 @@
{
"file": "pixi/renderers/WebGLBatch.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "WebGLBatch"
},
{
@ -846,26 +872,26 @@
{
"file": "pixi/renderers/WebGLRenderer.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "WebGLRenderer"
},
{
"file": "pixi/renderers/WebGLRenderer.js",
"line": 63,
"line": 64,
"access": "private",
"tagname": "",
"class": "WebGLRenderer"
},
{
"file": "pixi/renderers/WebGLRenderer.js",
"line": 102,
"line": 103,
"access": "private",
"tagname": "",
"class": "WebGLRenderer"
},
{
"file": "pixi/renderers/WebGLRenderer.js",
"line": 156,
"line": 157,
"description": "Renders the stage to its webGL view",
"itemtype": "method",
"name": "render",
@ -880,28 +906,28 @@
},
{
"file": "pixi/renderers/WebGLRenderer.js",
"line": 222,
"line": 223,
"access": "private",
"tagname": "",
"class": "WebGLRenderer"
},
{
"file": "pixi/renderers/WebGLRenderer.js",
"line": 251,
"line": 252,
"access": "private",
"tagname": "",
"class": "WebGLRenderer"
},
{
"file": "pixi/renderers/WebGLRenderer.js",
"line": 447,
"line": 448,
"access": "private",
"tagname": "",
"class": "WebGLRenderer"
},
{
"file": "pixi/renderers/WebGLRenderer.js",
"line": 525,
"line": 526,
"description": "resizes the webGL view to the specified width and height",
"itemtype": "method",
"name": "resize",
@ -921,28 +947,28 @@
},
{
"file": "pixi/renderers/WebGLRenderer.js",
"line": 546,
"line": 547,
"access": "private",
"tagname": "",
"class": "WebGLRenderer"
},
{
"file": "pixi/renderers/WebGLRenderer.js",
"line": 574,
"line": 575,
"access": "private",
"tagname": "",
"class": "WebGLRenderer"
},
{
"file": "pixi/renderers/WebGLRenderer.js",
"line": 652,
"line": 653,
"access": "private",
"tagname": "",
"class": "WebGLRenderer"
},
{
"file": "pixi/renderers/WebGLRenderer.js",
"line": 661,
"line": 662,
"access": "private",
"tagname": "",
"class": "WebGLRenderer"
@ -950,13 +976,13 @@
{
"file": "pixi/renderers/WebGLShaders.js",
"line": 2,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "BaseTexture"
},
{
"file": "pixi/textures/BaseTexture.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "BaseTexture"
},
{
@ -998,7 +1024,7 @@
{
"file": "pixi/textures/Texture.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "Texture"
},
{
@ -1058,7 +1084,7 @@
"line": 112,
"description": "Helper function that returns a texture based on a frame id\n If the frame id is not in the texture cache an error will be thrown",
"itemtype": "method",
"name": "fromFrameId",
"name": "fromFrame",
"params": [
{
"name": "frameId",
@ -1109,7 +1135,7 @@
{
"file": "pixi/utils/Detector.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "DisplayObject"
},
{
@ -1148,7 +1174,7 @@
{
"file": "pixi/DisplayObject.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "DisplayObject"
},
{
@ -1224,7 +1250,7 @@
{
"file": "pixi/DisplayObjectContainer.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "DisplayObjectContainer"
},
{
@ -1296,12 +1322,12 @@
{
"file": "pixi/MovieClip.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "MovieClip"
},
{
"file": "pixi/MovieClip.js",
"line": 15,
"line": 16,
"description": "The array of textures that make up the animation",
"itemtype": "property",
"name": "textures",
@ -1310,7 +1336,7 @@
},
{
"file": "pixi/MovieClip.js",
"line": 22,
"line": 23,
"description": "[read only] The index MovieClips current frame (this may not have to be a whole number)",
"itemtype": "property",
"name": "currentFrame",
@ -1319,7 +1345,7 @@
},
{
"file": "pixi/MovieClip.js",
"line": 29,
"line": 30,
"description": "The speed that the MovieClip will play at. Higher is faster, lower is slower",
"itemtype": "property",
"name": "animationSpeed",
@ -1328,7 +1354,7 @@
},
{
"file": "pixi/MovieClip.js",
"line": 36,
"line": 37,
"description": "[read only] indicates if the MovieClip is currently playing",
"itemtype": "property",
"name": "playing",
@ -1337,7 +1363,7 @@
},
{
"file": "pixi/MovieClip.js",
"line": 48,
"line": 49,
"description": "Stops the MovieClip",
"itemtype": "method",
"name": "stop",
@ -1345,7 +1371,7 @@
},
{
"file": "pixi/MovieClip.js",
"line": 57,
"line": 58,
"description": "Plays the MovieClip",
"itemtype": "method",
"name": "play",
@ -1353,7 +1379,7 @@
},
{
"file": "pixi/MovieClip.js",
"line": 66,
"line": 67,
"description": "Stops the MovieClip and goes to a specific frame",
"itemtype": "method",
"name": "gotoAndStop",
@ -1368,7 +1394,7 @@
},
{
"file": "pixi/MovieClip.js",
"line": 79,
"line": 80,
"description": "Goes to a specific frame and begins playing the MovieClip",
"itemtype": "method",
"name": "gotoAndPlay",
@ -1384,13 +1410,13 @@
{
"file": "pixi/Pixi.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "Point"
},
{
"file": "pixi/Point.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "Point",
"module": "PIXI"
},
@ -1486,7 +1512,7 @@
{
"file": "pixi/Sprite.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "Sprite",
"module": "PIXI"
},
@ -1607,15 +1633,16 @@
{
"file": "pixi/Stage.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/",
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "Stage",
"module": "PIXI"
},
{
"file": "pixi/Stage.js",
"line": 26,
"line": 30,
"itemtype": "method",
"name": "updateTransform",
"internal": "",
"class": "Stage",
"module": "PIXI"
},
@ -1623,15 +1650,14 @@
"file": "pixi/Stage.js",
"line": 44,
"itemtype": "method",
"name": "__addChild",
"class": "Stage",
"module": "PIXI"
},
"name": "setBackgroundColor",
"params": [
{
"file": "pixi/Stage.js",
"line": 63,
"itemtype": "method",
"name": "__removeChild",
"name": "backgroundColor",
"description": "",
"type": "Number"
}
],
"class": "Stage",
"module": "PIXI"
}
@ -1641,6 +1667,10 @@
"message": "unknown tag: methos",
"line": " pixi/renderers/WebGLBatch.js:292"
},
{
"message": "unknown tag: internal",
"line": " pixi/Stage.js:30"
},
{
"message": "Missing item type",
"line": " pixi/extras/Rope.js:1"
@ -1655,7 +1685,7 @@
},
{
"message": "Missing item type\nThis will begin loading the assets sequentially",
"line": " pixi/loaders/AssetLoader.js:32"
"line": " pixi/loaders/AssetLoader.js:41"
},
{
"message": "Missing item type",
@ -1671,19 +1701,19 @@
},
{
"message": "Missing item type\nresizes the canvas view to the specified width and height",
"line": " pixi/renderers/CanvasRenderer.js:78"
"line": " pixi/renderers/CanvasRenderer.js:81"
},
{
"message": "Missing item type",
"line": " pixi/renderers/CanvasRenderer.js:92"
"line": " pixi/renderers/CanvasRenderer.js:95"
},
{
"message": "Missing item type",
"line": " pixi/renderers/CanvasRenderer.js:162"
"line": " pixi/renderers/CanvasRenderer.js:165"
},
{
"message": "Missing item type",
"line": " pixi/renderers/CanvasRenderer.js:197"
"line": " pixi/renderers/CanvasRenderer.js:200"
},
{
"message": "Missing item type",
@ -1715,39 +1745,39 @@
},
{
"message": "Missing item type",
"line": " pixi/renderers/WebGLRenderer.js:63"
"line": " pixi/renderers/WebGLRenderer.js:64"
},
{
"message": "Missing item type",
"line": " pixi/renderers/WebGLRenderer.js:102"
"line": " pixi/renderers/WebGLRenderer.js:103"
},
{
"message": "Missing item type",
"line": " pixi/renderers/WebGLRenderer.js:222"
"line": " pixi/renderers/WebGLRenderer.js:223"
},
{
"message": "Missing item type",
"line": " pixi/renderers/WebGLRenderer.js:251"
"line": " pixi/renderers/WebGLRenderer.js:252"
},
{
"message": "Missing item type",
"line": " pixi/renderers/WebGLRenderer.js:447"
"line": " pixi/renderers/WebGLRenderer.js:448"
},
{
"message": "Missing item type",
"line": " pixi/renderers/WebGLRenderer.js:546"
"line": " pixi/renderers/WebGLRenderer.js:547"
},
{
"message": "Missing item type",
"line": " pixi/renderers/WebGLRenderer.js:574"
"line": " pixi/renderers/WebGLRenderer.js:575"
},
{
"message": "Missing item type",
"line": " pixi/renderers/WebGLRenderer.js:652"
"line": " pixi/renderers/WebGLRenderer.js:653"
},
{
"message": "Missing item type",
"line": " pixi/renderers/WebGLRenderer.js:661"
"line": " pixi/renderers/WebGLRenderer.js:662"
},
{
"message": "Missing item type",

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;DisplayObject.js - The Foo API</title>
<title>pixi&#x2F;DisplayObject.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -115,7 +115,7 @@
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;
&#x2F;**

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;DisplayObjectContainer.js - The Foo API</title>
<title>pixi&#x2F;DisplayObjectContainer.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -115,7 +115,7 @@
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;MovieClip.js - The Foo API</title>
<title>pixi&#x2F;MovieClip.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -115,12 +115,13 @@
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;
&#x2F;**
* A MovieClip is a simple way to display an animation depicted by a list of textures.
* @class MovieClip
* @extends Sprite
* @constructor
* @param textures {Array} an array of {Texture} objects that make up the animation
*&#x2F;

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;Pixi.js - The Foo API</title>
<title>pixi&#x2F;Pixi.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -115,7 +115,7 @@
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;
&#x2F;**

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;Point.js - The Foo API</title>
<title>pixi&#x2F;Point.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -115,7 +115,7 @@
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;
&#x2F;**

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;Rectangle.js - The Foo API</title>
<title>pixi&#x2F;Rectangle.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;Sprite.js - The Foo API</title>
<title>pixi&#x2F;Sprite.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -115,7 +115,7 @@
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;
PIXI.blendModes = {};

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;Stage.js - The Foo API</title>
<title>pixi&#x2F;Stage.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -115,7 +115,7 @@
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;
&#x2F;**
@ -123,15 +123,19 @@ A Stage represents the root of the display tree. Everything connected to the sta
@class Stage
@extends DisplayObjectContainer
@constructor
@param backgroundColor {Number} the background color of the stage
*&#x2F;
PIXI.Stage = function()
PIXI.Stage = function(backgroundColor)
{
PIXI.DisplayObjectContainer.call( this );
this.worldTransform = mat3.identity();
this.__childrenAdded = [];
this.__childrenRemoved = [];
this.childIndex = 0;
this.stage= this;
this.setBackgroundColor(backgroundColor);
}
&#x2F;&#x2F; constructor
@ -141,6 +145,7 @@ PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
&#x2F;**
@method updateTransform
@internal
*&#x2F;
PIXI.Stage.prototype.updateTransform = function()
{
@ -151,15 +156,18 @@ PIXI.Stage.prototype.updateTransform = function()
this.children[i].updateTransform();
}
}
&#x2F;*
PIXI.Stage.prototype.setFilter = function(filters)
{
this.filters = filters;
}*&#x2F;
&#x2F;**
@method __addChild
* @method setBackgroundColor
* @param backgroundColor {Number}
*&#x2F;
PIXI.Stage.prototype.setBackgroundColor = function(backgroundColor)
{
this.backgroundColor = backgroundColor ? backgroundColor : 0x000000;
this.backgroundColorSplit = HEXtoRGB(this.backgroundColor);
this.backgroundColorString = &quot;#&quot; + this.backgroundColor.toString(16);
}
PIXI.Stage.prototype.__addChild = function(child)
{
&#x2F;&#x2F;this.__childrenAdded.push(child);
@ -176,9 +184,7 @@ PIXI.Stage.prototype.__addChild = function(child)
}
&#x2F;**
@method __removeChild
*&#x2F;
PIXI.Stage.prototype.__removeChild = function(child)
{
this.__childrenRemoved.push(child);

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;extras&#x2F;Rope.js - The Foo API</title>
<title>pixi&#x2F;extras&#x2F;Rope.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;extras&#x2F;Strip.js - The Foo API</title>
<title>pixi&#x2F;extras&#x2F;Strip.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;loaders&#x2F;AssetLoader.js - The Foo API</title>
<title>pixi&#x2F;loaders&#x2F;AssetLoader.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -115,11 +115,11 @@
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;
&#x2F;**
* A Class that loads a bunch of images &#x2F; sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
* A Class that loads a bunch of images &#x2F; sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrame(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
* When all items have been loaded this class will dispatch a &#x27;loaded&#x27; event
* As each individual item is loaded this class will dispatch a &#x27;progress&#x27; event
* @class AssetLoader
@ -131,7 +131,6 @@ PIXI.AssetLoader = function(assetURLs)
{
PIXI.EventTarget.call( this );
&#x2F;**
* The array of asset URLs that are going to be loaded
* @property assetURLs
@ -142,6 +141,16 @@ PIXI.AssetLoader = function(assetURLs)
this.assets = [];
}
&#x2F;**
Fired when an item has loaded
@event onProgress
**&#x2F;
&#x2F;**
Fired when all the assets have loaded
@event onComplete
**&#x2F;
&#x2F;&#x2F; constructor
PIXI.AssetLoader.constructor = PIXI.AssetLoader;
@ -160,7 +169,7 @@ PIXI.AssetLoader.prototype.load = function()
var filename = this.assetURLs[i];
var fileType = filename.split(&#x27;.&#x27;).pop().toLowerCase();
&#x2F;&#x2F; what are we loading?
var type;
var type = null;
for (var j=0; j &lt; imageTypes.length; j++)
{
@ -171,7 +180,7 @@ PIXI.AssetLoader.prototype.load = function()
}
}
if(!type)
if(type != &quot;img&quot;)
{
for (var j=0; j &lt; spriteSheetTypes.length; j++)
{
@ -185,6 +194,7 @@ PIXI.AssetLoader.prototype.load = function()
if(type == &quot;img&quot;)
{
var texture = PIXI.Texture.fromImage(filename);
if(!texture.hasLoaded)
{
@ -232,11 +242,13 @@ PIXI.AssetLoader.prototype.load = function()
PIXI.AssetLoader.prototype.onAssetLoaded = function()
{
this.loadCount--;
this.dispatchEvent( { type: &#x27;progress&#x27;, content: this } );
this.dispatchEvent( { type: &#x27;onProgress&#x27;, content: this } );
if(this.onProgress)this.onProgress();
if(this.loadCount == 0)
{
this.dispatchEvent( { type: &#x27;loaded&#x27;, content: this } );
this.dispatchEvent( { type: &#x27;onComplete&#x27;, content: this } );
if(this.onComplete)this.onComplete();
}
}

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;loaders&#x2F;SpriteSheetLoader.js - The Foo API</title>
<title>pixi&#x2F;loaders&#x2F;SpriteSheetLoader.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -115,7 +115,7 @@
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;
&#x2F;**

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;renderers&#x2F;CanvasRenderer.js - The Foo API</title>
<title>pixi&#x2F;renderers&#x2F;CanvasRenderer.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -115,11 +115,11 @@
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;
&#x2F;**
* the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
* the CanvasRenderer draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
* Dont forget to add the view to your DOM or you will not see anything :)
* @class CanvasRenderer
* @param width {Number} the width of the canvas view
@ -153,7 +153,6 @@ PIXI.CanvasRenderer = function(width, height)
this.view.width = this.width;
this.view.height = this.height;
this.view.background = &quot;#FF0000&quot;;
this.count = 0;
&#x2F;**
@ -187,6 +186,10 @@ PIXI.CanvasRenderer.prototype.render = function(stage)
stage.updateTransform();
this.context.setTransform(1,0,0,1,0,0);
&#x2F;&#x2F; update the background color
if(this.view.style.backgroundColor!=stage.backgroundColorString)this.view.style.backgroundColor = stage.backgroundColorString;
this.context.clearRect(0, 0, this.width, this.height)
this.renderDisplayObject(stage);
}

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;renderers&#x2F;WebGLBatch.js - The Foo API</title>
<title>pixi&#x2F;renderers&#x2F;WebGLBatch.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -115,7 +115,7 @@
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;
PIXI._batchs = [];

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;renderers&#x2F;WebGLRenderer.js - The Foo API</title>
<title>pixi&#x2F;renderers&#x2F;WebGLRenderer.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -115,7 +115,7 @@
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;
PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
@ -124,6 +124,7 @@ PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
* the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch&#x27;s or Sprite Cloud&#x27;s
* Dont forget to add the view to your DOM or you will not see anything :)
* @class WebGLRenderer
* @constructor
* @param width {Number} the width of the canvas view
* @default 0
* @param height {Number} the height of the canvas view
@ -310,7 +311,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
gl.clear(gl.COLOR_BUFFER_BIT)
gl.clearColor(0, 0, 0, 1.0);
gl.clearColor(stage.backgroundColorSplit[0], stage.backgroundColorSplit[1], stage.backgroundColorSplit[2], 1.0);
&#x2F;&#x2F; set the correct blend mode!
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
@ -618,7 +619,7 @@ PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
if(this.batchs[index-1] instanceof PIXI.WebGLBatch &amp;&amp; this.batchs[index+1] instanceof PIXI.WebGLBatch)
{
if(this.batchs[index-1].texture == this.batchs[index+1].texture)
if(this.batchs[index-1].texture == this.batchs[index+1].texture &amp;&amp; this.batchs[index-1].blendMode == this.batchs[index+1].blendMode)
{
&#x2F;&#x2F;console.log(&quot;MERGE&quot;)
this.batchs[index-1].merge(this.batchs[index+1]);

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;renderers&#x2F;WebGLShaders.js - The Foo API</title>
<title>pixi&#x2F;renderers&#x2F;WebGLShaders.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -116,7 +116,7 @@
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;
PIXI.shaderFragmentSrc = [ &quot;precision mediump float;&quot;,

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;textures&#x2F;BaseTexture.js - The Foo API</title>
<title>pixi&#x2F;textures&#x2F;BaseTexture.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -115,7 +115,7 @@
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;
PIXI.BaseTextureCache = {};
@ -158,7 +158,7 @@ PIXI.BaseTexture = function(imageUrl)
scope.dispatchEvent( { type: &#x27;loaded&#x27;, content: scope } );
}
$.proxy(this.onImageLoaded, this);
&#x2F;&#x2F;$.proxy(this.onImageLoaded, this);
this.image.src = imageUrl;
&#x2F;**

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;textures&#x2F;Texture.js - The Foo API</title>
<title>pixi&#x2F;textures&#x2F;Texture.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -115,7 +115,7 @@
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;
PIXI.TextureCache = {};
@ -229,11 +229,11 @@ PIXI.Texture.fromImage = function(imageUrl)
*
* Helper function that returns a texture based on a frame id
* If the frame id is not in the texture cache an error will be thrown
* @method fromFrameId
* @method fromFrame
* @param frameId {String} The frame id of the texture
* @return Texture
*&#x2F;
PIXI.Texture.fromFrameId = function(frameId)
PIXI.Texture.fromFrame = function(frameId)
{
var texture = PIXI.TextureCache[frameId];
if(!texture)throw new Error(&quot;The frameId &#x27;&quot;+ frameId +&quot;&#x27; does not exist in the texture cache &quot; + this);

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;utils&#x2F;Detector.js - The Foo API</title>
<title>pixi&#x2F;utils&#x2F;Detector.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -115,7 +115,7 @@
<div class="file">
<pre class="code prettyprint linenums">
&#x2F;**
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F;
* @author Mat Groves http:&#x2F;&#x2F;matgroves.com&#x2F; @Doormat23
*&#x2F;
&#x2F;**

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;utils&#x2F;EventTarget.js - The Foo API</title>
<title>pixi&#x2F;utils&#x2F;EventTarget.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>pixi&#x2F;utils&#x2F;Utils.js - The Foo API</title>
<title>pixi&#x2F;utils&#x2F;Utils.js - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">
@ -128,6 +128,10 @@ window.requestAnimFrame = (function() {
};
})();
function HEXtoRGB(hex) {
return [(hex &gt;&gt; 16 &amp; 0xFF) &#x2F; 255, ( hex &gt;&gt; 8 &amp; 0xFF) &#x2F; 255, (hex &amp; 0xFF)&#x2F; 255];
}
var AjaxRequest = function()
{
var activexmodes = [&quot;Msxml2.XMLHTTP&quot;, &quot;Microsoft.XMLHTTP&quot;] &#x2F;&#x2F;activeX versions to check for in IE

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>The Foo API</title>
<title>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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src=".&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">

BIN
docs/logo_small.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>PIXI - The Foo API</title>
<title>PIXI - 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">
@ -15,11 +15,11 @@
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="..&#x2F;assets/css/logo.png" title="The Foo API"></h1>
<h1><img src="..&#x2F;logo_small.png" title="Pixi.js API"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.2.1</em>
<em>API Docs for: 0.9</em>
</div>
</div>
<div id="bd" class="yui3-g">

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

View file

@ -0,0 +1,57 @@
<!DOCTYPE HTML>
<html>
<head>
<title>pixi.js example 1</title>
<style>
body {
margin: 0;
padding: 0;
background-color: #000000;
}
</style>
<script src="pixi.js"></script>
</head>
<body>
<script>
// create an new instance of a pixi stage
var stage = new PIXI.Stage(0x66FF99);
// create a renderer instance.
var renderer = PIXI.autoDetectRenderer(400, 300);
// add the renderer view element to the DOM
document.body.appendChild(renderer.view);
requestAnimFrame( animate );
// create a texture from an image path
var texture = PIXI.Texture.fromImage("bunny.png");
// create a new Sprite using the texture
var bunny = new PIXI.Sprite(texture);
// center the sprites anchor point
bunny.anchor.x = 0.5;
bunny.anchor.y = 0.5;
// move the sprite t the center of the screen
bunny.position.x = 200;
bunny.position.y = 150;
stage.addChild(bunny);
function animate() {
requestAnimFrame( animate );
// just for fun, lets rotate mr rabbit a little
bunny.rotation += 0.1;
// render the stage
renderer.render(stage);
}
</script>
</body>
</html>

111
examples/example 1/pixi.js Normal file
View file

@ -0,0 +1,111 @@
var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();function HEXtoRGB(b){return[(b>>16&255)/255,(b>>8&255)/255,(b&255)/255]}
var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c<b.length;c++)try{return new ActiveXObject(b[c])}catch(f){}else return window.XMLHttpRequest?new XMLHttpRequest:!1};PIXI.EventTarget=function(){var b={};this.addEventListener=function(c,f){void 0===b[c]&&(b[c]=[]);-1===b[c].indexOf(f)&&b[c].push(f)};this.dispatchEvent=function(c){for(var f in b[c.type])b[c.type][f](c)};this.removeEventListener=function(c,f){var e=b[c].indexOf(f);-1!==e&&b[c].splice(e,1)}};(function(b,c){"object"===typeof exports?module.exports=c(global):"function"===typeof define&&define.amd?define([],function(){return c(b)}):c(b)})(this,function(b){function c(a){return k=a}function f(){return k="undefined"!==typeof Float32Array?Float32Array:Array}var e={};if("undefined"!=typeof Float32Array){var g=new Float32Array(1),j=new Int32Array(g.buffer);e.invsqrt=function(a){g[0]=a;j[0]=1597463007-(j[0]>>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)};
var k=null;f();var n={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,l){var b=new k(3);b[0]=a;b[1]=d;b[2]=l;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,l){if(!l||a===l)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;l[0]=a[0]+d[0];l[1]=a[1]+d[1];l[2]=a[2]+d[2];return l},subtract:function(a,
d,l){if(!l||a===l)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;l[0]=a[0]-d[0];l[1]=a[1]-d[1];l[2]=a[2]-d[2];return l},multiply:function(a,d,l){if(!l||a===l)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;l[0]=a[0]*d[0];l[1]=a[1]*d[1];l[2]=a[2]*d[2];return l},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,l){if(!l||a===l)return a[0]*=d,a[1]*=d,a[2]*=d,a;l[0]=a[0]*d;l[1]=a[1]*d;l[2]=a[2]*d;return l},normalize:function(a,d){d||(d=a);var l=a[0],b=a[1],c=a[2],e=Math.sqrt(l*
l+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=l,d[1]=b,d[2]=c,d;e=1/e;d[0]=l*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,l){l||(l=a);var b=a[0],c=a[1];a=a[2];var e=d[0],h=d[1];d=d[2];l[0]=c*d-a*h;l[1]=a*e-b*d;l[2]=b*h-c*e;return l},length:function(a){var d=a[0],l=a[1];a=a[2];return Math.sqrt(d*d+l*l+a*a)},squaredLength:function(a){var d=a[0],l=a[1];a=a[2];return d*d+l*l+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,l){l||(l=a);var b=
a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return l[0]=0,l[1]=0,l[2]=0,l;d=1/d;l[0]=b*d;l[1]=c*d;l[2]=a*d;return l},lerp:function(a,d,l,b){b||(b=a);b[0]=a[0]+l*(d[0]-a[0]);b[1]=a[1]+l*(d[1]-a[1]);b[2]=a[2]+l*(d[2]-a[2]);return b},dist:function(a,d){var l=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(l*l+b*b+c*c)}},p=null,q=new k(4);n.unproject=function(a,d,l,b,c){c||(c=a);p||(p=u.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1;
u.multiply(l,d,e);if(!u.inverse(e))return null;u.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=n.createFrom(1,0,0),E=n.createFrom(0,1,0),t=n.createFrom(0,0,1),x=n.create();n.rotationTo=function(a,d,l){l||(l=m.create());var b=n.dot(a,d);if(1<=b)m.set(F,l);else if(-0.999999>b)n.cross(C,a,x),1E-6>n.length(x)&&n.cross(E,a,x),1E-6>n.length(x)&&n.cross(t,a,x),n.normalize(x),m.fromAngleAxis(Math.PI,x,l);else{var b=Math.sqrt(2*(1+b)),c=1/b;n.cross(a,
d,x);l[0]=x[0]*c;l[1]=x[1]*c;l[2]=x[2]*c;l[3]=0.5*b;m.normalize(l)}1<l[3]?l[3]=1:-1>l[3]&&(l[3]=-1);return l};n.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var y={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,l,b,c,e,h,f,D){var s=new k(9);s[0]=a;s[1]=d;s[2]=l;s[3]=b;s[4]=c;s[5]=e;s[6]=h;s[7]=f;s[8]=D;return s},determinant:function(a){var d=
a[3],l=a[4],b=a[5],c=a[6],e=a[7],h=a[8];return a[0]*(h*l-b*e)+a[1]*(-h*d+b*c)+a[2]*(e*d-l*c)},inverse:function(a,d){var l=a[0],b=a[1],c=a[2],e=a[3],h=a[4],f=a[5],D=a[6],s=a[7],g=a[8],j=g*h-f*s,k=-g*e+f*D,m=s*e-h*D,r=l*j+b*k+c*m;if(!r)return null;r=1/r;d||(d=y.create());d[0]=j*r;d[1]=(-g*b+c*s)*r;d[2]=(f*b-c*h)*r;d[3]=k*r;d[4]=(g*l-c*D)*r;d[5]=(-f*l+c*e)*r;d[6]=m*r;d[7]=(-s*l+b*D)*r;d[8]=(h*l-b*e)*r;return d},multiply:function(a,d,l){l||(l=a);var b=a[0],c=a[1],e=a[2],h=a[3],f=a[4],D=a[5],s=a[6],g=
a[7];a=a[8];var j=d[0],k=d[1],m=d[2],r=d[3],n=d[4],v=d[5],q=d[6],w=d[7];d=d[8];l[0]=j*b+k*h+m*s;l[1]=j*c+k*f+m*g;l[2]=j*e+k*D+m*a;l[3]=r*b+n*h+v*s;l[4]=r*c+n*f+v*g;l[5]=r*e+n*D+v*a;l[6]=q*b+w*h+d*s;l[7]=q*c+w*f+d*g;l[8]=q*e+w*D+d*a;return l},multiplyVec2:function(a,d,l){l||(l=d);var b=d[0];d=d[1];l[0]=b*a[0]+d*a[3]+a[6];l[1]=b*a[1]+d*a[4]+a[7];return l},multiplyVec3:function(a,d,l){l||(l=d);var b=d[0],c=d[1];d=d[2];l[0]=b*a[0]+c*a[3]+d*a[6];l[1]=b*a[1]+c*a[4]+d*a[7];l[2]=b*a[2]+c*a[5]+d*a[8];return l},
set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a,
d){if(!d||a===d){var l=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=l;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=u.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+
a[8]+"]"}},u={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,l,b,c,e,h,f,D,s,g,j,m,n,r,q){var v=new k(16);v[0]=a;v[1]=d;v[2]=l;v[3]=b;v[4]=c;v[5]=e;v[6]=h;v[7]=f;v[8]=D;v[9]=s;v[10]=g;v[11]=j;v[12]=m;v[13]=n;v[14]=r;v[15]=q;return v},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];
d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]-
d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=u.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var l=a[1],b=a[2],c=a[3],e=a[6],h=a[7],f=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=l;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=h;a[14]=f;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12];
d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],l=a[1],b=a[2],c=a[3],e=a[4],h=a[5],f=a[6],D=a[7],s=a[8],g=a[9],j=a[10],k=a[11],m=a[12],r=a[13],n=a[14];a=a[15];return m*g*f*c-s*r*f*c-m*h*j*c+e*r*j*c+s*h*n*c-e*g*n*c-m*g*b*D+s*r*b*D+m*l*j*D-d*r*j*D-s*l*n*D+d*g*n*D+m*h*b*k-e*r*b*k-m*l*f*k+d*r*f*k+e*l*n*k-d*h*n*k-s*h*b*a+e*g*b*a+s*l*f*a-d*g*f*a-e*l*j*a+d*h*j*a},inverse:function(a,
d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],h=a[4],g=a[5],D=a[6],s=a[7],j=a[8],k=a[9],m=a[10],n=a[11],r=a[12],q=a[13],v=a[14],t=a[15],w=b*g-c*h,H=b*D-e*h,z=b*s-f*h,A=c*D-e*g,u=c*s-f*g,p=e*s-f*D,x=j*q-k*r,y=j*v-m*r,B=j*t-n*r,C=k*v-m*q,E=k*t-n*q,F=m*t-n*v,G=w*F-H*E+z*C+A*B-u*y+p*x;if(!G)return null;G=1/G;d[0]=(g*F-D*E+s*C)*G;d[1]=(-c*F+e*E-f*C)*G;d[2]=(q*p-v*u+t*A)*G;d[3]=(-k*p+m*u-n*A)*G;d[4]=(-h*F+D*B-s*y)*G;d[5]=(b*F-e*B+f*y)*G;d[6]=(-r*p+v*z-t*H)*G;d[7]=(j*p-m*z+n*H)*G;d[8]=(h*E-g*B+s*x)*G;d[9]=
(-b*E+c*B-f*x)*G;d[10]=(r*u-q*z+t*w)*G;d[11]=(-j*u+k*z-n*w)*G;d[12]=(-h*C+g*y-D*x)*G;d[13]=(b*C-c*y+e*x)*G;d[14]=(-r*A+q*H-v*w)*G;d[15]=(j*A-k*H+m*w)*G;return d},toRotationMat:function(a,d){d||(d=u.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=y.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10];
return d},toInverseMat3:function(a,d){var b=a[0],c=a[1],e=a[2],f=a[4],h=a[5],g=a[6],j=a[8],s=a[9],k=a[10],m=k*h-g*s,n=-k*f+g*j,q=s*f-h*j,r=b*m+c*n+e*q;if(!r)return null;r=1/r;d||(d=y.create());d[0]=m*r;d[1]=(-k*c+e*s)*r;d[2]=(g*c-e*h)*r;d[3]=n*r;d[4]=(k*b-e*j)*r;d[5]=(-g*b+e*f)*r;d[6]=q*r;d[7]=(-s*b+c*j)*r;d[8]=(h*b-c*f)*r;return d},multiply:function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2],h=a[3],g=a[4],j=a[5],s=a[6],k=a[7],m=a[8],n=a[9],q=a[10],r=a[11],t=a[12],v=a[13],u=a[14];a=a[15];var w=d[0],
p=d[1],z=d[2],A=d[3];b[0]=w*c+p*g+z*m+A*t;b[1]=w*e+p*j+z*n+A*v;b[2]=w*f+p*s+z*q+A*u;b[3]=w*h+p*k+z*r+A*a;w=d[4];p=d[5];z=d[6];A=d[7];b[4]=w*c+p*g+z*m+A*t;b[5]=w*e+p*j+z*n+A*v;b[6]=w*f+p*s+z*q+A*u;b[7]=w*h+p*k+z*r+A*a;w=d[8];p=d[9];z=d[10];A=d[11];b[8]=w*c+p*g+z*m+A*t;b[9]=w*e+p*j+z*n+A*v;b[10]=w*f+p*s+z*q+A*u;b[11]=w*h+p*k+z*r+A*a;w=d[12];p=d[13];z=d[14];A=d[15];b[12]=w*c+p*g+z*m+A*t;b[13]=w*e+p*j+z*n+A*v;b[14]=w*f+p*s+z*q+A*u;b[15]=w*h+p*k+z*r+A*a;return b},multiplyVec3:function(a,d,b){b||(b=d);
var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,h,g,j,s,k,m,n,p,r,q,v;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+
a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];h=a[1];g=a[2];j=a[3];s=a[4];k=a[5];m=a[6];n=a[7];p=a[8];r=a[9];q=a[10];v=a[11];b[0]=f;b[1]=h;b[2]=g;b[3]=j;b[4]=s;b[5]=k;b[6]=m;b[7]=n;b[8]=p;b[9]=r;b[10]=q;b[11]=v;b[12]=f*c+s*e+p*d+a[12];b[13]=h*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=j*c+n*e+v*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*=
d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var h=Math.sqrt(e*e+f*f+b*b),g,j,k,m,n,p,q,r,t,v,u,w,x,z,A,y,B,C,E,F;if(!h)return null;1!==h&&(h=1/h,e*=h,f*=h,b*=h);g=Math.sin(d);j=Math.cos(d);k=1-j;d=a[0];h=a[1];m=a[2];n=a[3];p=a[4];q=a[5];r=a[6];t=a[7];v=a[8];u=a[9];w=
a[10];x=a[11];z=e*e*k+j;A=f*e*k+b*g;y=b*e*k-f*g;B=e*f*k-b*g;C=f*f*k+j;E=b*f*k+e*g;F=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+j;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*z+p*A+v*y;c[1]=h*z+q*A+u*y;c[2]=m*z+r*A+w*y;c[3]=n*z+t*A+x*y;c[4]=d*B+p*C+v*E;c[5]=h*B+q*C+u*E;c[6]=m*B+r*C+w*E;c[7]=n*B+t*C+x*E;c[8]=d*F+p*e+v*f;c[9]=h*F+q*e+u*f;c[10]=m*F+r*e+w*f;c[11]=n*F+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],h=a[6],g=a[7],j=a[8],k=a[9],m=a[10],
n=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+j*c;b[5]=f*d+k*c;b[6]=h*d+m*c;b[7]=g*d+n*c;b[8]=e*-c+j*d;b[9]=f*-c+k*d;b[10]=h*-c+m*d;b[11]=g*-c+n*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],h=a[2],g=a[3],j=a[8],k=a[9],m=a[10],n=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+j*-c;b[1]=f*d+k*-c;b[2]=h*d+m*-c;b[3]=g*
d+n*-c;b[8]=e*c+j*d;b[9]=f*c+k*d;b[10]=h*c+m*d;b[11]=g*c+n*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],h=a[2],g=a[3],j=a[4],k=a[5],m=a[6],n=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+j*c;b[1]=f*d+k*c;b[2]=h*d+m*c;b[3]=g*d+n*c;b[4]=e*-c+j*d;b[5]=f*-c+k*d;b[6]=h*-c+m*d;b[7]=g*-c+n*d;return b},frustum:function(a,d,b,c,e,f,h){h||(h=u.create());var g=d-a,j=c-b,k=f-e;h[0]=2*e/g;h[1]=0;
h[2]=0;h[3]=0;h[4]=0;h[5]=2*e/j;h[6]=0;h[7]=0;h[8]=(d+a)/g;h[9]=(c+b)/j;h[10]=-(f+e)/k;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*f*e)/k;h[15]=0;return h},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return u.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,h){h||(h=u.create());var g=d-a,j=c-b,k=f-e;h[0]=2/g;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/j;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/k;h[11]=0;h[12]=-(a+d)/g;h[13]=-(c+b)/j;h[14]=-(f+e)/k;h[15]=1;return h},lookAt:function(a,d,b,c){c||
(c=u.create());var e,f,h,g,j,k,m,n,p=a[0],q=a[1];a=a[2];h=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return u.identity(c);d=p-m;b=q-b;m=a-e;n=1/Math.sqrt(d*d+b*b+m*m);d*=n;b*=n;m*=n;e=g*m-f*b;f=f*d-h*m;h=h*b-g*d;(n=Math.sqrt(e*e+f*f+h*h))?(n=1/n,e*=n,f*=n,h*=n):h=f=e=0;g=b*h-m*f;j=m*e-d*h;k=d*f-b*e;(n=Math.sqrt(g*g+j*j+k*k))?(n=1/n,g*=n,j*=n,k*=n):k=j=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=j;c[6]=b;c[7]=0;c[8]=h;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+h*a);c[13]=-(g*p+j*q+
k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=u.create());var c=a[0],e=a[1],f=a[2],h=a[3],g=c+c,j=e+e,k=f+f;a=c*g;var m=c*j,c=c*k,n=e*j,e=e*k,f=f*k,g=h*g,j=h*j,h=h*k;b[0]=1-(n+f);b[1]=m+h;b[2]=c-j;b[3]=0;b[4]=m-h;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+j;b[9]=e-g;b[10]=1-(a+n);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+
a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create());
a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},F=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b;
return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],h=Math.sqrt(b*b+c*c+e*e+f*f);if(0===h)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;h=1/h;d[0]=b*h;d[1]=c*h;d[2]=e*h;d[3]=f*h;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+=
d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var h=d[0],g=d[1],j=d[2];d=d[3];b[0]=c*d+a*h+e*j-f*g;b[1]=e*d+a*g+f*h-c*j;b[2]=f*d+a*j+c*g-e*h;b[3]=a*d-c*h-e*g-f*j;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*e,k=a*e+g*c-d*f,m=a*f+d*e-h*c,c=-d*c-h*e-g*f;b[0]=j*a+c*-d+k*-g-m*-h;b[1]=k*a+c*-h+m*-d-j*-g;b[2]=m*a+c*-g+j*-h-k*-d;
return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=y.create());var b=a[0],c=a[1],e=a[2],f=a[3],h=b+b,g=c+c,j=e+e,k=b*h,m=b*g,b=b*j,n=c*g,c=c*j,e=e*j,h=f*h,g=f*g,f=f*j;d[0]=1-(n+e);d[1]=m+f;d[2]=b-g;d[3]=m-f;d[4]=1-(k+e);d[5]=c+h;d[6]=b+g;d[7]=c-h;d[8]=1-(k+n);return d};m.toMat4=function(a,d){d||(d=u.create());var b=a[0],c=a[1],e=a[2],f=a[3],h=b+b,g=c+c,j=e+e,k=b*h,m=b*g,b=b*
j,n=c*g,c=c*j,e=e*j,h=f*h,g=f*g,f=f*j;d[0]=1-(n+e);d[1]=m+f;d[2]=b-g;d[3]=0;d[4]=m-f;d[5]=1-(k+e);d[6]=c+h;d[7]=0;d[8]=b+g;d[9]=c-h;d[10]=1-(k+n);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+
0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0<b)c=Math.sqrt(b+1),d[3]=0.5*c,c=0.5/c,d[0]=(a[7]-a[5])*c,d[1]=(a[2]-a[6])*c,d[2]=(a[3]-a[1])*c;else{c=m.fromRotationMatrix.s_iNext=m.fromRotationMatrix.s_iNext||[1,2,0];b=0;a[4]>a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c=
0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};y.toQuat4=m.fromRotationMatrix;var B=y.create();m.fromAxes=function(a,b,c,e){B[0]=b[0];B[3]=b[1];B[6]=b[2];B[1]=c[0];B[4]=c[1];B[7]=c[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,e)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,b,c){c||(c=m.create());a*=0.5;var e=Math.sin(a);c[3]=Math.cos(a);c[0]=e*b[0];c[1]=e*b[1];c[2]=e*b[2];
return c};m.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0<c?(b[3]=2*Math.acos(a[3]),c=e.invsqrt(c),b[0]=a[0]*c,b[1]=a[1]*c,b[2]=a[2]*c):(b[3]=0,b[0]=1,b[1]=0,b[2]=0);return b};m.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"};var J={create:function(a){var b=new k(2);a?(b[0]=a[0],b[1]=a[1]):(b[0]=0,b[1]=0);return b},createFrom:function(a,b){var c=new k(2);c[0]=a;c[1]=b;return c},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];return c},subtract:function(a,
b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];return c},multiply:function(a,b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;return c},dist:function(a,b){var c=b[0]-a[0],e=b[1]-a[1];return Math.sqrt(c*c+e*e)},set:function(a,b){b[0]=a[0];b[1]=a[1];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a);
b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0<c?(c=Math.sqrt(c),b[0]=a[0]/c,b[1]=a[1]/c):b[0]=b[1]=0;return b},cross:function(a,b,c){a=a[0]*b[1]-a[1]*b[0];if(!c)return a;c[0]=c[1]=0;c[2]=a;return c},length:function(a){var b=a[0];a=a[1];return Math.sqrt(b*b+a*a)},squaredLength:function(a){var b=a[0];a=a[1];return b*b+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]},direction:function(a,b,c){c||(c=a);var e=a[0]-b[0];a=a[1]-b[1];b=e*e+a*a;if(!b)return c[0]=
0,c[1]=0,c[2]=0,c;b=1/Math.sqrt(b);c[0]=e*b;c[1]=a*b;return c},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);return e},str:function(a){return"["+a[0]+", "+a[1]+"]"}},I={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>
Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=I.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a,
b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]=
g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},K={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a,
b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b||
(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType=
f,b.glMath=e,b.vec2=J,b.vec3=n,b.vec4=K,b.mat2=I,b.mat3=y,b.mat4=u,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:J,vec3:n,vec4:K,mat2:I,mat3:y,mat4:u,quat4:m}});PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"];
PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"];
PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;e<c.length;e++)f+=c[e];e=b.createShader(b.VERTEX_SHADER);b.shaderSource(e,f);b.compileShader(e);return!b.getShaderParameter(e,b.COMPILE_STATUS)?(alert(b.getShaderInfoLog(e)),null):e};PIXI.CompileFragmentShader=function(b,c){for(var f="",e=0;e<c.length;e++)f+=c[e];e=b.createShader(b.FRAGMENT_SHADER);b.shaderSource(e,f);b.compileShader(e);return!b.getShaderParameter(e,b.COMPILE_STATUS)?(alert(b.getShaderInfoLog(e)),null):e};PIXI._defaultFrame=new PIXI.Rectangle(0,0,1,1);
PIXI.WebGLRenderer=function(b,c){this.width=b?b:800;this.height=c?c:600;this.view=document.createElement("canvas");this.view.width=this.width;this.view.height=this.height;this.view.background="#FF0000";var f=this;this.view.addEventListener("webglcontextlost",function(b){f.handleContextLost(b)},!1);this.view.addEventListener("webglcontextrestored",function(b){f.handleContextRestored(b)},!1);this.batchs=[];try{this.gl=this.view.getContext("experimental-webgl",{alpha:!1})}catch(e){throw Error(" This browser does not support webGL. Try using the canvas renderer"+
this);}this.initShaders();var g=this.gl;this.batch=new PIXI.WebGLBatch(g);g.disable(g.DEPTH_TEST);g.enable(g.BLEND);g.colorMask(!0,!0,!0,!1);this.projectionMatrix=mat4.create();this.resize(this.width,this.height);this.contextLost=!1};PIXI.WebGLRenderer.constructor=PIXI.WebGLRenderer;
PIXI.WebGLRenderer.prototype.initShaders=function(){var b=this.gl,c=PIXI.CompileFragmentShader(b,PIXI.shaderFragmentSrc),f=PIXI.CompileVertexShader(b,PIXI.shaderVertexSrc),e=this.shaderProgram=b.createProgram();b.attachShader(e,f);b.attachShader(e,c);b.linkProgram(e);b.getProgramParameter(e,b.LINK_STATUS)||alert("Could not initialise shaders");b.useProgram(e);e.vertexPositionAttribute=b.getAttribLocation(e,"aVertexPosition");b.enableVertexAttribArray(e.vertexPositionAttribute);e.textureCoordAttribute=
b.getAttribLocation(e,"aTextureCoord");b.enableVertexAttribArray(e.textureCoordAttribute);e.colorAttribute=b.getAttribLocation(e,"aColor");b.enableVertexAttribArray(e.colorAttribute);e.mvMatrixUniform=b.getUniformLocation(e,"uMVMatrix");e.samplerUniform=b.getUniformLocation(e,"uSampler");PIXI.shaderProgram=this.shaderProgram};
PIXI.WebGLRenderer.prototype.checkVisibility=function(b,c){for(var f=b.children,e=0;e<f.length;e++){var g=f[e],j=g.visible&&c;g.textureChange&&(g.textureChange=!1,j&&(this.removeDisplayObject(g),this.addDisplayObject(g)));g.cacheVisible!=j&&(g.cacheVisible=j,g.cacheVisible?this.addDisplayObject(g):this.removeDisplayObject(g));0<g.children.length&&this.checkVisibility(g,j)}};
PIXI.WebGLRenderer.prototype.render=function(b){if(!this.contextLost){for(var c=0;c<b.__childrenRemoved.length;c++)this.removeDisplayObject(b.__childrenRemoved[c]);for(c=0;c<PIXI.texturesToUpdate.length;c++)this.updateTexture(PIXI.texturesToUpdate[c]);b.__childrenRemoved=[];b.__childrenAdded=[];PIXI.texturesToUpdate=[];this.checkVisibility(b,!0);b.updateTransform();c=this.gl;c.clear(c.COLOR_BUFFER_BIT);c.clearColor(b.backgroundColorSplit[0],b.backgroundColorSplit[1],b.backgroundColorSplit[2],1);c.blendFunc(c.ONE,
c.ONE_MINUS_SRC_ALPHA);c.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,this.projectionMatrix);for(c=0;c<this.batchs.length;c++)b=this.batchs[c],b instanceof PIXI.WebGLBatch?this.batchs[c].render():b instanceof PIXI.Strip&&b.visible&&this.renderStrip(b)}};
PIXI.WebGLRenderer.prototype.updateTexture=function(b){var c=this.gl;b._glTexture||(b._glTexture=c.createTexture());b.hasLoaded&&(c.bindTexture(c.TEXTURE_2D,b._glTexture),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,b.image),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,
c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),c.bindTexture(c.TEXTURE_2D,null));this.refreshBatchs=!0};
PIXI.WebGLRenderer.prototype.addDisplayObject=function(b){if(b.stage&&!b.__inWebGL&&(b.batch=null,b.renderable)){b.__inWebGL=!0;var c=b;do{if(0==c.childIndex)c=c.parent;else for(c=c.parent.children[c.childIndex-1];0!=c.children.length;)c=c.children[c.children.length-1];if(c==b.stage)break}while(!c.renderable||!c.__inWebGL);var f=b;do{if(0==f.children.length){for(;f.childIndex==f.parent.children.length-1;)if(f=f.parent,f==b.stage){f=null;break}f&&(f=f.parent.children[f.childIndex+1])}else f=f.children[0];
if(!f)break}while(!f.renderable||!f.__inWebGL);if(b instanceof PIXI.Sprite){var e;if(c instanceof PIXI.Sprite){if((e=c.batch)&&e.texture==b.texture.baseTexture&&e.blendMode==b.blendMode){e.insertAfter(b,c);return}}else e=c;if(f&&f instanceof PIXI.Sprite&&(c=f.batch)){if(c.texture==b.texture.baseTexture&&c.blendMode==b.blendMode){c.insertBefore(b,f);return}if(c==e){f=e.split(f);c=PIXI._getBatch(this.gl);e=this.batchs.indexOf(e);c.init(b);this.batchs.splice(e+1,0,c,f);return}}c=PIXI._getBatch(this.gl);
c.init(b);e?(e=this.batchs.indexOf(e),this.batchs.splice(e+1,0,c)):this.batchs.push(c)}else b instanceof PIXI.Strip&&(this.initStrip(b),this.batchs.push(b));this.batchUpdate=!0}};
PIXI.WebGLRenderer.prototype.removeDisplayObject=function(b){b.cacheVisible=!1;if(b.renderable){b.__inWebGL=!1;var c;if(b instanceof PIXI.Sprite){var f=b.batch;if(!f)return;f.remove(b);0==f.size&&(c=f)}else c=b;c&&(b=this.batchs.indexOf(c),-1!=b&&(!(0==b||b==this.batchs.length-1)&&this.batchs[b-1]instanceof PIXI.WebGLBatch&&this.batchs[b+1]instanceof PIXI.WebGLBatch&&this.batchs[b-1].texture==this.batchs[b+1].texture&&this.batchs[b-1].blendMode==this.batchs[b+1].blendMode?(this.batchs[b-1].merge(this.batchs[b+
1]),c instanceof PIXI.WebGLBatch&&PIXI._returnBatch(c),PIXI._returnBatch(this.batchs[b+1]),this.batchs.splice(b,2)):(this.batchs.splice(b,1),c instanceof PIXI.WebGLBatch&&PIXI._returnBatch(c))))}};
PIXI.WebGLRenderer.prototype.resize=function(b,c){this.width=b;this.height=c;this.view.width=b;this.view.height=c;this.gl.viewport(0,0,this.width,this.height);mat4.identity(this.projectionMatrix);mat4.scale(this.projectionMatrix,[2/this.width,-2/this.height,1]);mat4.translate(this.projectionMatrix,[-this.width/2,-this.height/2,0])};
PIXI.WebGLRenderer.prototype.initStrip=function(b){var c=this.gl;b._vertexBuffer=c.createBuffer();b._indexBuffer=c.createBuffer();b._uvBuffer=c.createBuffer();b._colorBuffer=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,b._vertexBuffer);c.bufferData(c.ARRAY_BUFFER,b.verticies,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,b._uvBuffer);c.bufferData(c.ARRAY_BUFFER,b.uvs,c.STATIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,b._colorBuffer);c.bufferData(c.ARRAY_BUFFER,b.colors,c.STATIC_DRAW);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,
b._indexBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,b.indices,c.STATIC_DRAW)};
PIXI.WebGLRenderer.prototype.renderStrip=function(b){var c=this.gl,f=this.shaderProgram,e=mat3.toMat4(b.worldTransform);mat4.transpose(e);mat4.multiply(this.projectionMatrix,e,e);c.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,e);b.blendMode==PIXI.blendModes.NORMAL?c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA):c.blendFunc(c.ONE,c.ONE_MINUS_SRC_COLOR);b.dirty?(b.dirty=!1,c.bindBuffer(c.ARRAY_BUFFER,b._vertexBuffer),c.bufferData(c.ARRAY_BUFFER,b.verticies,c.STATIC_DRAW),c.vertexAttribPointer(f.vertexPositionAttribute,
2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,b._uvBuffer),c.bufferData(c.ARRAY_BUFFER,b.uvs,c.STATIC_DRAW),c.vertexAttribPointer(f.textureCoordAttribute,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,b.texture.baseTexture._glTexture),c.bindBuffer(c.ARRAY_BUFFER,b._colorBuffer),c.bufferData(c.ARRAY_BUFFER,b.colors,c.STATIC_DRAW),c.vertexAttribPointer(f.colorAttribute,1,c.FLOAT,!1,0,0),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,b._indexBuffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,
b.indices,c.STATIC_DRAW)):(c.bindBuffer(c.ARRAY_BUFFER,b._vertexBuffer),c.bufferSubData(c.ARRAY_BUFFER,0,b.verticies),c.vertexAttribPointer(f.vertexPositionAttribute,2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,b._uvBuffer),c.vertexAttribPointer(f.textureCoordAttribute,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,b.texture.baseTexture._glTexture),c.bindBuffer(c.ARRAY_BUFFER,b._colorBuffer),c.vertexAttribPointer(f.colorAttribute,1,c.FLOAT,!1,0,0),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,
b._indexBuffer));c.drawElements(c.TRIANGLE_STRIP,b.indices.length,c.UNSIGNED_SHORT,0);c.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,this.projectionMatrix)};PIXI.WebGLRenderer.prototype.handleContextLost=function(b){b.preventDefault();this.contextLost=!0};
PIXI.WebGLRenderer.prototype.handleContextRestored=function(){this.gl=this.view.getContext("experimental-webgl",{alpha:!0});this.initShaders();for(var b=0;b<PIXI.TextureCache.length;b++)this.updateTexture(PIXI.TextureCache[b]);for(b=0;b<this.batchs.length;b++)this.batchs[b].restoreLostContext(this.gl),this.batchs[b].dirty=!0;PIXI._restoreBatchs(this.gl);this.contextLost=!1};PIXI._batchs=[];PIXI._getBatch=function(b){return 0==PIXI._batchs.length?new PIXI.WebGLBatch(b):PIXI._batchs.pop()};PIXI._returnBatch=function(b){b.clean();PIXI._batchs.push(b)};PIXI._restoreBatchs=function(b){for(var c=0;c<PIXI._batchs.length;c++)PIXI._batchs[c].restoreLostContext(b)};
PIXI.WebGLBatch=function(b){this.gl=b;this.size=0;this.vertexBuffer=b.createBuffer();this.indexBuffer=b.createBuffer();this.uvBuffer=b.createBuffer();this.colorBuffer=b.createBuffer();this.blendMode=PIXI.blendModes.NORMAL;this.dynamicSize=1};PIXI.WebGLBatch.constructor=PIXI.WebGLBatch;PIXI.WebGLBatch.prototype.clean=function(){this.verticies=[];this.uvs=[];this.indices=[];this.colors=[];this.dynamicSize=1;this.last=this.texture=null;this.size=0;this.head;this.tail};
PIXI.WebGLBatch.prototype.restoreLostContext=function(b){this.gl=b;this.vertexBuffer=b.createBuffer();this.indexBuffer=b.createBuffer();this.uvBuffer=b.createBuffer();this.colorBuffer=b.createBuffer()};PIXI.WebGLBatch.prototype.init=function(b){b.batch=this;this.dirty=!0;this.blendMode=b.blendMode;this.texture=b.texture.baseTexture;this.tail=this.head=b;this.size=1;this.growBatch()};
PIXI.WebGLBatch.prototype.insertBefore=function(b,c){this.size++;b.batch=this;this.dirty=!0;var f=c.__prev;c.__prev=b;b.__next=c;f?(b.__prev=f,f.__next=b):this.head=b};PIXI.WebGLBatch.prototype.insertAfter=function(b,c){this.size++;b.batch=this;this.dirty=!0;var f=c.__next;c.__next=b;b.__prev=c;f?(b.__next=f,f.__prev=b):this.tail=b};
PIXI.WebGLBatch.prototype.remove=function(b){this.size--;0==this.size?(b.batch=null,b.__prev=null,b.__next=null):(b.__prev?b.__prev.__next=b.__next:(this.head=b.__next,this.head.__prev=null),b.__next?b.__next.__prev=b.__prev:(this.tail=b.__prev,this.tail.__next=null),b.batch=null,b.__next=null,b.__prev=null,this.dirty=!0)};
PIXI.WebGLBatch.prototype.split=function(b){this.dirty=!0;var c=new PIXI.WebGLBatch(this.gl);c.init(b);c.tail=this.tail;this.tail=b.__prev;this.tail.__next=null;b.__prev=null;for(var f=0;b;)f++,b.batch=c,b=b.__next;c.size=f;this.size-=f;return c};PIXI.WebGLBatch.prototype.merge=function(b){this.dirty=!0;this.tail.__next=b.head;b.head.__prev=this.tail;this.size+=b.size;this.tail=b.tail;for(b=b.head;b;)b.batch=this,b=b.__next};
PIXI.WebGLBatch.prototype.growBatch=function(){var b=this.gl;this.dynamicSize=1==this.size?1:1.5*this.size;this.verticies=new Float32Array(8*this.dynamicSize);b.bindBuffer(b.ARRAY_BUFFER,this.vertexBuffer);b.bufferData(b.ARRAY_BUFFER,this.verticies,b.DYNAMIC_DRAW);this.uvs=new Float32Array(8*this.dynamicSize);b.bindBuffer(b.ARRAY_BUFFER,this.uvBuffer);b.bufferData(b.ARRAY_BUFFER,this.uvs,b.DYNAMIC_DRAW);this.dirtyUVS=!0;this.colors=new Float32Array(4*this.dynamicSize);b.bindBuffer(b.ARRAY_BUFFER,
this.colorBuffer);b.bufferData(b.ARRAY_BUFFER,this.colors,b.DYNAMIC_DRAW);this.dirtyColors=!0;this.indices=new Uint16Array(6*this.dynamicSize);for(var c=this.indices.length/6,f=0;f<c;f++){var e=6*f,g=4*f;this.indices[e+0]=g+0;this.indices[e+1]=g+1;this.indices[e+2]=g+2;this.indices[e+3]=g+0;this.indices[e+4]=g+2;this.indices[e+5]=g+3}b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.indexBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER,this.indices,b.STATIC_DRAW)};
PIXI.WebGLBatch.prototype.refresh=function(){this.dynamicSize<this.size&&this.growBatch();for(var b=0,c,f=this.head;f;){c=8*b;var e=f.texture,g=e.frame,j=e.baseTexture.width,e=e.baseTexture.height;this.uvs[c+0]=g.x/j;this.uvs[c+1]=g.y/e;this.uvs[c+2]=(g.x+g.width)/j;this.uvs[c+3]=g.y/e;this.uvs[c+4]=(g.x+g.width)/j;this.uvs[c+5]=(g.y+g.height)/e;this.uvs[c+6]=g.x/j;this.uvs[c+7]=(g.y+g.height)/e;f.updateFrame=!1;colorIndex=4*b;this.colors[colorIndex]=this.colors[colorIndex+1]=this.colors[colorIndex+
2]=this.colors[colorIndex+3]=f.worldAlpha;f=f.__next;b++}this.dirtyColors=this.dirtyUVS=!0};
PIXI.WebGLBatch.prototype.update=function(){for(var b,c,f,e,g,j,k,n,p,q,C,E=0,t=this.head;t;)c=t.width,f=t.height,e=t.anchor.x-t.texture.trim.x,g=t.anchor.y-t.texture.trim.y,j=c*(1-e),c*=-e,e=f*(1-g),g=f*-g,f=8*E,b=t.worldTransform,k=b[0],n=b[3],p=b[1],q=b[4],C=b[2],b=b[5],this.verticies[f+0]=k*c+p*g+C,this.verticies[f+1]=q*g+n*c+b,this.verticies[f+2]=k*j+p*g+C,this.verticies[f+3]=q*g+n*j+b,this.verticies[f+4]=k*j+p*e+C,this.verticies[f+5]=q*e+n*j+b,this.verticies[f+6]=k*c+p*e+C,this.verticies[f+
7]=q*e+n*c+b,t.updateFrame&&(this.dirtyUVS=!0,e=t.texture,j=e.frame,c=e.baseTexture.width,e=e.baseTexture.height,this.uvs[f+0]=j.x/c,this.uvs[f+1]=j.y/e,this.uvs[f+2]=(j.x+j.width)/c,this.uvs[f+3]=j.y/e,this.uvs[f+4]=(j.x+j.width)/c,this.uvs[f+5]=(j.y+j.height)/e,this.uvs[f+6]=j.x/c,this.uvs[f+7]=(j.y+j.height)/e,t.updateFrame=!1),t.cacheAlpha!=t.worldAlpha&&(t.cacheAlpha=t.worldAlpha,j=4*E,this.colors[j]=this.colors[j+1]=this.colors[j+2]=this.colors[j+3]=t.worldAlpha,this.dirtyColors=!0),E++,t=t.__next};
PIXI.WebGLBatch.prototype.render=function(){this.dirty&&(this.refresh(),this.dirty=!1);if(0!=this.size){this.update();var b=this.gl;this.blendMode==PIXI.blendModes.NORMAL?b.blendFunc(b.ONE,b.ONE_MINUS_SRC_ALPHA):b.blendFunc(b.ONE,b.ONE_MINUS_SRC_COLOR);var c=PIXI.shaderProgram;b.bindBuffer(b.ARRAY_BUFFER,this.vertexBuffer);b.bufferSubData(b.ARRAY_BUFFER,0,this.verticies);b.vertexAttribPointer(c.vertexPositionAttribute,2,b.FLOAT,!1,0,0);b.bindBuffer(b.ARRAY_BUFFER,this.uvBuffer);this.dirtyUVS&&(this.dirtyUVS=
!1,b.bufferSubData(b.ARRAY_BUFFER,0,this.uvs));b.vertexAttribPointer(c.textureCoordAttribute,2,b.FLOAT,!1,0,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,this.texture._glTexture);b.bindBuffer(b.ARRAY_BUFFER,this.colorBuffer);this.dirtyColors&&(this.dirtyColors=!1,b.bufferSubData(b.ARRAY_BUFFER,0,this.colors));b.vertexAttribPointer(c.colorAttribute,1,b.FLOAT,!1,0,0);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.indexBuffer);b.drawElements(b.TRIANGLES,6*this.size,b.UNSIGNED_SHORT,0)}};PIXI.CanvasRenderer=function(b,c){this.width=b?b:800;this.height=c?c:600;this.refresh=!0;this.view=document.createElement("canvas");this.view.width=this.width;this.view.height=this.height;this.count=0;this.context=this.view.getContext("2d")};PIXI.CanvasRenderer.constructor=PIXI.CanvasRenderer;
PIXI.CanvasRenderer.prototype.render=function(b){b.__childrenAdded=[];b.__childrenRemoved=[];PIXI.texturesToUpdate=[];this.context.setTransform(1,0,0,1,0,0);b.updateTransform();this.context.setTransform(1,0,0,1,0,0);this.view.style.backgroundColor!=b.backgroundColorString&&(this.view.style.backgroundColor=b.backgroundColorString);this.context.clearRect(0,0,this.width,this.height);this.renderDisplayObject(b)};
PIXI.CanvasRenderer.prototype.resize=function(b,c){this.width=b;this.height=c;this.view.width=b;this.view.height=c};
PIXI.CanvasRenderer.prototype.renderDisplayObject=function(b){var c=b.worldTransform,f=this.context;f.globalCompositeOperation="source-over";if(b.visible){if(b instanceof PIXI.Sprite){var e=b.texture.frame;e&&(f.globalAlpha=b.worldAlpha,0==b.rotation?(this.context.setTransform(1,0,0,1,0,0),f.drawImage(b.texture.baseTexture.image,e.x,e.y,e.width,e.height,c[2]+(b.anchor.x-b.texture.trim.x)*-e.width*c[0],c[5]+(b.anchor.y-b.texture.trim.y)*-e.height*c[4],b.width*c[0],b.height*c[4])):(f.setTransform(c[0],
c[3],c[1],c[4],c[2],c[5]),f.drawImage(b.texture.baseTexture.image,e.x,e.y,e.width,e.height,(b.anchor.x-b.texture.trim.x)*-e.width,(b.anchor.y-b.texture.trim.y)*-e.height,b.width,b.height)))}else b instanceof PIXI.Strip&&(f.setTransform(c[0],c[3],c[1],c[4],c[2],c[5]),this.renderStrip(b));for(c=0;c<b.children.length;c++)this.renderDisplayObject(b.children[c])}};
PIXI.CanvasRenderer.prototype.renderStripFlat=function(b){var c=this.context;b=b.verticies;var f=b.length/2;this.count++;c.beginPath();for(var e=1;e<f-2;e++){var g=2*e,j=b[g+2],k=b[g+4],n=b[g+3],p=b[g+5];c.moveTo(b[g],b[g+1]);c.lineTo(j,n);c.lineTo(k,p)}c.fillStyle="#FF0000";c.fill();c.closePath()};
PIXI.CanvasRenderer.prototype.renderStrip=function(b){var c=this.context,f=b.verticies,e=b.uvs,g=f.length/2;this.count++;for(var j=1;j<g-2;j++){var k=2*j,n=f[k],p=f[k+2],q=f[k+4],C=f[k+1],E=f[k+3],t=f[k+5],x=e[k]*b.texture.width,y=e[k+2]*b.texture.width,u=e[k+4]*b.texture.width,m=e[k+1]*b.texture.height,F=e[k+3]*b.texture.height,k=e[k+5]*b.texture.height;c.save();c.beginPath();c.moveTo(n,C);c.lineTo(p,E);c.lineTo(q,t);c.closePath();c.clip();var B=x*F+m*u+y*k-F*u-m*y-x*k;c.transform((n*F+m*q+p*k-F*
q-m*p-n*k)/B,(C*F+m*t+E*k-F*t-m*E-C*k)/B,(x*p+n*u+y*q-p*u-n*y-x*q)/B,(x*E+C*u+y*t-E*u-C*y-x*t)/B,(x*F*q+m*p*u+n*y*k-n*F*u-m*y*q-x*p*k)/B,(x*F*t+m*E*u+C*y*k-C*F*u-m*y*t-x*E*k)/B);c.drawImage(b.texture.baseTexture.image,0,0);c.restore()}};PIXI.DisplayObject=function(){this.position=new PIXI.Point;this.scale=new PIXI.Point(1,1);this.rotation=0;this.alpha=1;this.visible=!0;this.cacheVisible=!1;this.stage=this.parent=null;this.worldAlpha=1;this.color=[];this.worldTransform=mat3.identity();this.localTransform=mat3.identity();this.dynamic=!0;this._sr=0;this._cr=1;this.renderable=!1};PIXI.DisplayObject.constructor=PIXI.DisplayObject;
PIXI.DisplayObject.prototype.updateTransform=function(){this.rotation!=this.rotationCache&&(this.rotationCach=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation));this.localTransform[0]=this._cr*this.scale.x;this.localTransform[1]=-this._sr*this.scale.y;this.localTransform[3]=this._sr*this.scale.x;this.localTransform[4]=this._cr*this.scale.y;this.localTransform[2]=this.position.x;this.localTransform[5]=this.position.y;mat3.multiply(this.localTransform,this.parent.worldTransform,
this.worldTransform);this.worldAlpha=this.alpha*this.parent.worldAlpha};PIXI.DisplayObjectContainer=function(){PIXI.DisplayObject.call(this);this.children=[];this.renderable=!1};PIXI.DisplayObjectContainer.constructor=PIXI.DisplayObjectContainer;PIXI.DisplayObjectContainer.prototype=Object.create(PIXI.DisplayObject.prototype);PIXI.DisplayObjectContainer.prototype.addChild=function(b){void 0!=b.parent&&b.parent.removeChild(b);b.parent=this;b.childIndex=this.children.length;this.children.push(b);this.stage&&this.stage.__addChild(b)};
PIXI.DisplayObjectContainer.prototype.addChildAt=function(b,c){if(0<=c&&c<=this.children.length){void 0!=b.parent&&b.parent.removeChild(b);c==this.children.length?this.children.push(b):this.children.splice(c,0,b);b.parent=this;b.childIndex=c;for(var f=this.children.length,e=c;e<f;e++)this.children[e].childIndex=e;this.stage&&this.stage.__addChild(b)}else throw Error(b+" The index "+c+" supplied is out of bounds "+this.children.length);};
PIXI.DisplayObjectContainer.prototype.removeChild=function(b){var c=this.children.indexOf(b);if(-1!==c){this.stage&&this.stage.__removeChild(b);b.parent=void 0;this.children.splice(c,1);b=c;for(c=this.children.length;b<c;b++)this.children[b].childIndex-=1}else throw Error(b+" The supplied DisplayObject must be a child of the caller "+this);};
PIXI.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible){PIXI.DisplayObject.prototype.updateTransform.call(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateTransform()}};PIXI.Stage=function(b){PIXI.DisplayObjectContainer.call(this);this.worldTransform=mat3.identity();this.__childrenAdded=[];this.__childrenRemoved=[];this.childIndex=0;this.stage=this;this.setBackgroundColor(b)};PIXI.Stage.constructor=PIXI.Stage;PIXI.Stage.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateTransform()};
PIXI.Stage.prototype.setBackgroundColor=function(b){this.backgroundColor=b?b:0;this.backgroundColorSplit=HEXtoRGB(this.backgroundColor);this.backgroundColorString="#"+this.backgroundColor.toString(16)};PIXI.Stage.prototype.__addChild=function(b){b.stage=this;if(b.children)for(var c=0;c<b.children.length;c++)this.__addChild(b.children[c])};PIXI.Stage.prototype.__removeChild=function(b){this.__childrenRemoved.push(b);b.stage=void 0;if(b.children)for(var c=0,f=b.children.length;c<f;c++)this.__removeChild(b.children[c])};PIXI.blendModes={};PIXI.blendModes.NORMAL=0;PIXI.blendModes.SCREEN=1;PIXI.Sprite=function(b){PIXI.DisplayObjectContainer.call(this);this.anchor=new PIXI.Point;this.texture=b;this.blendMode=PIXI.blendModes.NORMAL;this.height=this.width=1;b.baseTexture.hasLoaded?(this.width=this.texture.frame.width,this.height=this.texture.frame.height,this.updateFrame=!0):(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind));this.renderable=!0};
PIXI.Sprite.constructor=PIXI.Sprite;PIXI.Sprite.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.Sprite.prototype.setTexture=function(b){this.texture.baseTexture!=b.baseTexture&&(this.textureChange=!0);this.texture=b;this.width=b.frame.width;this.height=b.frame.height;this.updateFrame=!0};PIXI.Sprite.prototype.onTextureUpdate=function(){this.width=this.texture.frame.width;this.height=this.texture.frame.height;this.updateFrame=!0};
PIXI.Sprite.fromFrame=function(b){var c=PIXI.TextureCache[b];if(!c)throw Error("The frameId '"+b+"' does not exist in the texture cache"+this);return new PIXI.Sprite(c)};PIXI.Sprite.fromImage=function(b){b=PIXI.Texture.fromImage(b);return new PIXI.Sprite(b)};PIXI.Strip=function(b,c,f){PIXI.DisplayObjectContainer.call(this);this.texture=b;this.blendMode=PIXI.blendModes.NORMAL;try{this.uvs=new Float32Array([0,1,1,1,1,0,0,1]),this.verticies=new Float32Array([0,0,0,0,0,0,0,0,0]),this.colors=new Float32Array([1,1,1,1]),this.indices=new Uint16Array([0,1,2,3])}catch(e){this.uvs=[0,1,1,1,1,0,0,1],this.verticies=[0,0,0,0,0,0,0,0,0],this.colors=[1,1,1,1],this.indices=[0,1,2,3]}this.width=c;this.height=f;b.baseTexture.hasLoaded?(this.width=this.texture.frame.width,
this.height=this.texture.frame.height,this.updateFrame=!0):(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind));this.renderable=!0};PIXI.Strip.constructor=PIXI.Strip;PIXI.Strip.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.Strip.prototype.setTexture=function(b){this.texture=b;this.width=b.frame.width;this.height=b.frame.height;this.updateFrame=!0};
PIXI.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0};PIXI.Rope=function(b,c){PIXI.Strip.call(this,b);this.points=c;try{this.verticies=new Float32Array(4*c.length),this.uvs=new Float32Array(4*c.length),this.colors=new Float32Array(2*c.length),this.indices=new Uint16Array(2*c.length)}catch(f){this.verticies=verticies,this.uvs=uvs,this.colors=colors,this.indices=indices}this.refresh()};PIXI.Rope.constructor=PIXI.Rope;PIXI.Rope.prototype=Object.create(PIXI.Strip.prototype);
PIXI.Rope.prototype.refresh=function(){var b=this.points;if(!(1>b.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;g<b;g++){var j=4*g,k=g/(b-1);c[j]=k;c[j+1]=0;c[j+2]=k;c[j+3]=1;j=2*g;e[j]=1;e[j+1]=1;j=2*g;f[j]=j;f[j+1]=j+1}}};
PIXI.Rope.prototype.updateTransform=function(){var b=this.points;if(!(1>b.length)){var c=this.verticies,f=b[0],e,g=e=0,j=b[0];this.count-=0.2;c[0]=j.x+e;c[1]=j.y+g;c[2]=j.x-e;c[3]=j.y-g;for(var k=b.length,n=1;n<k;n++){var j=b[n],p=4*n;e=n<b.length-1?b[n+1]:j;g=-(e.x-f.x);e=e.y-f.y;var f=Math.sqrt(e*e+g*g),q=this.texture.height/2;e/=f;g/=f;e*=q;g*=q;c[p]=j.x+e;c[p+1]=j.y+g;c[p+2]=j.x-e;c[p+3]=j.y-g;f=j}PIXI.DisplayObjectContainer.prototype.updateTransform.call(this)}};
PIXI.Rope.prototype.setTexture=function(b){this.texture=b;this.updateFrame=!0};PIXI.MovieClip=function(b){PIXI.Sprite.call(this,b[0]);this.textures=b;this.currentFrame=0;this.animationSpeed=1};PIXI.MovieClip.constructor=PIXI.MovieClip;PIXI.MovieClip.prototype=Object.create(PIXI.Sprite.prototype);PIXI.MovieClip.prototype.stop=function(){this.playing=!1};PIXI.MovieClip.prototype.play=function(){this.playing=!0};PIXI.MovieClip.prototype.gotoAndStop=function(b){this.playing=!1;this.currentFrame=b;this.setTexture(this.textures[(this.currentFrame+0.5|0)%this.textures.length])};
PIXI.MovieClip.prototype.gotoAndPlay=function(b){this.currentFrame=b;this.playing=!0};PIXI.MovieClip.prototype.updateTransform=function(){PIXI.Sprite.prototype.updateTransform.call(this);this.playing&&(this.currentFrame+=this.animationSpeed,this.setTexture(this.textures[(this.currentFrame+0.5|0)%this.textures.length]))};PIXI.BaseTextureCache={};PIXI.texturesToUpdate=[];PIXI.BaseTexture=function(b){PIXI.EventTarget.call(this);this.imageUrl=b;this.image=new Image;var c=this;this.image.onload=function(){c.hasLoaded=!0;c.width=c.image.width;c.height=c.image.height;PIXI.texturesToUpdate.push(c);c.dispatchEvent({type:"loaded",content:c})};this.image.src=b;this.height=this.width=100;PIXI.BaseTextureCache[b]=this};PIXI.BaseTexture.constructor=PIXI.BaseTexture;PIXI.TextureCache={};PIXI.FrameCache={};PIXI.Texture=function(b,c){PIXI.EventTarget.call(this);c||(this.noFrame=!0,c=new PIXI.Rectangle(0,0,1,1));this.trim=new PIXI.Point;this.baseTexture=b;this.frame=c;this.scope=this;if(b.hasLoaded)c||(c=new PIXI.Rectangle(0,0,b.width,b.height)),this.setFrame(c);else{var f=this;b.addEventListener("loaded",function(){f.onBaseTextureLoaded()})}};PIXI.Texture.constructor=PIXI.Texture;
PIXI.Texture.prototype.onBaseTextureLoaded=function(){var b=this.baseTexture;b.removeEventListener("loaded",this.onLoaded);this.noFrame&&(this.frame=new PIXI.Rectangle(0,0,b.width,b.height));this.noFrame=!1;this.width=this.frame.width;this.height=this.frame.height;this.scope.dispatchEvent({type:"update",content:this})};PIXI.Texture.prototype.setFrame=function(b){this.frame=b;this.width=b.width;this.height=b.height};
PIXI.Texture.fromImage=function(b){var c=PIXI.TextureCache[b];c||((c=PIXI.BaseTextureCache[b])||(c=new PIXI.BaseTexture(b)),c=new PIXI.Texture(c),PIXI.TextureCache[b]=c);return c};PIXI.Texture.fromFrameId=function(b){var c=PIXI.TextureCache[b];if(!c)throw Error("The frameId '"+b+"' does not exist in the texture cache "+this);return c};PIXI.Texture.addTextureToCache=function(b,c){PIXI.TextureCache[c]=b};PIXI.Texture.removeTextureFromCache=function(b){PIXI.TextureCache[b]=texture};PIXI.autoDetectRenderer=function(b,c){b||(b=800);c||(c=600);var f;try{f=!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(e){f=!1}return f?new PIXI.WebGLRenderer(b,c):new PIXI.CanvasRenderer(b,c)};PIXI.SpriteSheetLoader=function(b){PIXI.EventTarget.call(this);this.url=b;this.baseUrl=b.replace(/[^\/]*$/,"");this.texture;this.frames={}};PIXI.SpriteSheetLoader.constructor=PIXI.SpriteSheetLoader;PIXI.SpriteSheetLoader.prototype.load=function(){this.ajaxRequest=new AjaxRequest;var b=this;this.ajaxRequest.onreadystatechange=function(){b.onLoaded()};this.ajaxRequest.open("GET",this.url,!0);this.ajaxRequest.send(null)};
PIXI.SpriteSheetLoader.prototype.onLoaded=function(){if(4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))){var b=eval("("+this.ajaxRequest.responseText+")");this.texture=PIXI.Texture.fromImage(this.baseUrl+b.meta.image).baseTexture;var b=b.frames,c;for(c in b){var f=b[c].frame;PIXI.TextureCache[c]=new PIXI.Texture(this.texture,{x:f.x,y:f.y,width:f.w,height:f.h});b[c].trimmed&&(PIXI.TextureCache[c].realSize=b[c].spriteSourceSize,PIXI.TextureCache[c].trim.x=
0)}if(this.texture.hasLoaded)this.dispatchEvent({type:"loaded",content:this});else{var e=this;this.texture.addEventListener("loaded",function(){e.dispatchEvent({type:"loaded",content:e})})}}};PIXI.AssetLoader=function(b){PIXI.EventTarget.call(this);this.assetURLs=b;this.assets=[]};PIXI.AssetLoader.constructor=PIXI.AssetLoader;
PIXI.AssetLoader.prototype.load=function(){this.loadCount=this.assetURLs.length;for(var b=["jpeg","jpg","png","gif"],c=["json"],f=0;f<this.assetURLs.length;f++){for(var e=this.assetURLs[f],g=e.split(".").pop().toLowerCase(),j=null,k=0;k<b.length;k++)if(g==b[k]){j="img";break}if("img"!=j)for(k=0;k<c.length;k++)if(g==c[k]){j="atlas";break}if("img"==j)if(e=PIXI.Texture.fromImage(e),e.hasLoaded)this.loadCount--;else{var n=this;e.baseTexture.addEventListener("loaded",function(){n.onAssetLoaded()});this.assets.push(e)}else if("atlas"==
j)e=new PIXI.SpriteSheetLoader(e),this.assets.push(e),n=this,e.addEventListener("loaded",function(){n.onAssetLoaded()}),e.load();else throw Error(e+" is an unsupported file type "+this);}};PIXI.AssetLoader.prototype.onAssetLoaded=function(){this.loadCount--;this.dispatchEvent({type:"progress",content:this});0==this.loadCount&&this.dispatchEvent({type:"loaded",content:this})};

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

View file

@ -0,0 +1,68 @@
<!DOCTYPE HTML>
<html>
<head>
<title>pixi.js example 1</title>
<style>
body {
margin: 0;
padding: 0;
background-color: #000000;
}
</style>
<script src="pixi.js"></script>
</head>
<body>
<script>
// create a new loader
var imagesToLoad = [ "img/stretched_hyper_tile.jpg"];
loader = new PIXI.AssetLoader(imagesToLoad);
loader.onComplete = onAssetsLoaded
loader.load();
function onAssetsLoaded()
{
// create an new instance of a pixi stage
var stage = new PIXI.Stage(0x66FF99);
// create a renderer instance.
var renderer = PIXI.autoDetectRenderer(400, 300);
// add the renderer view element to the DOM
document.body.appendChild(renderer.view);
requestAnimFrame( animate );
// create a new Sprite using an image path..
var bunny = PIXI.Sprite.fromImage("bunny.png");
// center the sprites anchor point
bunny.anchor.x = 0.5;
bunny.anchor.y = 0.5;
// move the sprite t the center of the screen
bunny.position.x = 200;
bunny.position.y = 150;
stage.addChild(bunny);
}
function animate() {
requestAnimFrame( animate );
// just for fun, lets rotate mr rabbit a little
bunny.rotation += 0.1;
// render the stage
renderer.render(stage);
}
</script>
</body>
</html>

111
examples/example 2/pixi.js Normal file
View file

@ -0,0 +1,111 @@
var PIXI=PIXI||{};PIXI.Point=function(b,c){this.x=b?b:0;this.y=c?c:0};PIXI.Point.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.constructor=PIXI.Point;PIXI.Rectangle=function(b,c,f,e){this.x=b?b:0;this.y=c?c:0;this.width=f?f:0;this.height=e?e:0};PIXI.Point.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.constructor=PIXI.Rectangle;window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}();function HEXtoRGB(b){return[(b>>16&255)/255,(b>>8&255)/255,(b&255)/255]}
var AjaxRequest=function(){var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP"];if(window.ActiveXObject)for(var c=0;c<b.length;c++)try{return new ActiveXObject(b[c])}catch(f){}else return window.XMLHttpRequest?new XMLHttpRequest:!1};PIXI.EventTarget=function(){var b={};this.addEventListener=function(c,f){void 0===b[c]&&(b[c]=[]);-1===b[c].indexOf(f)&&b[c].push(f)};this.dispatchEvent=function(c){for(var f in b[c.type])b[c.type][f](c)};this.removeEventListener=function(c,f){var e=b[c].indexOf(f);-1!==e&&b[c].splice(e,1)}};(function(b,c){"object"===typeof exports?module.exports=c(global):"function"===typeof define&&define.amd?define([],function(){return c(b)}):c(b)})(this,function(b){function c(a){return k=a}function f(){return k="undefined"!==typeof Float32Array?Float32Array:Array}var e={};if("undefined"!=typeof Float32Array){var g=new Float32Array(1),j=new Int32Array(g.buffer);e.invsqrt=function(a){g[0]=a;j[0]=1597463007-(j[0]>>1);var d=g[0];return d*(1.5-0.5*a*d*d)}}else e.invsqrt=function(a){return 1/Math.sqrt(a)};
var k=null;f();var n={create:function(a){var d=new k(3);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2]):d[0]=d[1]=d[2]=0;return d},createFrom:function(a,d,l){var b=new k(3);b[0]=a;b[1]=d;b[2]=l;return b},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])},add:function(a,d,l){if(!l||a===l)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a;l[0]=a[0]+d[0];l[1]=a[1]+d[1];l[2]=a[2]+d[2];return l},subtract:function(a,
d,l){if(!l||a===l)return a[0]-=d[0],a[1]-=d[1],a[2]-=d[2],a;l[0]=a[0]-d[0];l[1]=a[1]-d[1];l[2]=a[2]-d[2];return l},multiply:function(a,d,l){if(!l||a===l)return a[0]*=d[0],a[1]*=d[1],a[2]*=d[2],a;l[0]=a[0]*d[0];l[1]=a[1]*d[1];l[2]=a[2]*d[2];return l},negate:function(a,d){d||(d=a);d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d},scale:function(a,d,l){if(!l||a===l)return a[0]*=d,a[1]*=d,a[2]*=d,a;l[0]=a[0]*d;l[1]=a[1]*d;l[2]=a[2]*d;return l},normalize:function(a,d){d||(d=a);var l=a[0],b=a[1],c=a[2],e=Math.sqrt(l*
l+b*b+c*c);if(!e)return d[0]=0,d[1]=0,d[2]=0,d;if(1===e)return d[0]=l,d[1]=b,d[2]=c,d;e=1/e;d[0]=l*e;d[1]=b*e;d[2]=c*e;return d},cross:function(a,d,l){l||(l=a);var b=a[0],c=a[1];a=a[2];var e=d[0],h=d[1];d=d[2];l[0]=c*d-a*h;l[1]=a*e-b*d;l[2]=b*h-c*e;return l},length:function(a){var d=a[0],l=a[1];a=a[2];return Math.sqrt(d*d+l*l+a*a)},squaredLength:function(a){var d=a[0],l=a[1];a=a[2];return d*d+l*l+a*a},dot:function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]},direction:function(a,d,l){l||(l=a);var b=
a[0]-d[0],c=a[1]-d[1];a=a[2]-d[2];d=Math.sqrt(b*b+c*c+a*a);if(!d)return l[0]=0,l[1]=0,l[2]=0,l;d=1/d;l[0]=b*d;l[1]=c*d;l[2]=a*d;return l},lerp:function(a,d,l,b){b||(b=a);b[0]=a[0]+l*(d[0]-a[0]);b[1]=a[1]+l*(d[1]-a[1]);b[2]=a[2]+l*(d[2]-a[2]);return b},dist:function(a,d){var l=d[0]-a[0],b=d[1]-a[1],c=d[2]-a[2];return Math.sqrt(l*l+b*b+c*c)}},p=null,q=new k(4);n.unproject=function(a,d,l,b,c){c||(c=a);p||(p=u.create());var e=p;q[0]=2*(a[0]-b[0])/b[2]-1;q[1]=2*(a[1]-b[1])/b[3]-1;q[2]=2*a[2]-1;q[3]=1;
u.multiply(l,d,e);if(!u.inverse(e))return null;u.multiplyVec4(e,q);if(0===q[3])return null;c[0]=q[0]/q[3];c[1]=q[1]/q[3];c[2]=q[2]/q[3];return c};var C=n.createFrom(1,0,0),E=n.createFrom(0,1,0),t=n.createFrom(0,0,1),x=n.create();n.rotationTo=function(a,d,l){l||(l=m.create());var b=n.dot(a,d);if(1<=b)m.set(F,l);else if(-0.999999>b)n.cross(C,a,x),1E-6>n.length(x)&&n.cross(E,a,x),1E-6>n.length(x)&&n.cross(t,a,x),n.normalize(x),m.fromAngleAxis(Math.PI,x,l);else{var b=Math.sqrt(2*(1+b)),c=1/b;n.cross(a,
d,x);l[0]=x[0]*c;l[1]=x[1]*c;l[2]=x[2]*c;l[3]=0.5*b;m.normalize(l)}1<l[3]?l[3]=1:-1>l[3]&&(l[3]=-1);return l};n.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var y={create:function(a){var d=new k(9);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8]):d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=0;return d},createFrom:function(a,d,l,b,c,e,h,f,D){var s=new k(9);s[0]=a;s[1]=d;s[2]=l;s[3]=b;s[4]=c;s[5]=e;s[6]=h;s[7]=f;s[8]=D;return s},determinant:function(a){var d=
a[3],l=a[4],b=a[5],c=a[6],e=a[7],h=a[8];return a[0]*(h*l-b*e)+a[1]*(-h*d+b*c)+a[2]*(e*d-l*c)},inverse:function(a,d){var l=a[0],b=a[1],c=a[2],e=a[3],h=a[4],f=a[5],D=a[6],s=a[7],g=a[8],j=g*h-f*s,k=-g*e+f*D,m=s*e-h*D,r=l*j+b*k+c*m;if(!r)return null;r=1/r;d||(d=y.create());d[0]=j*r;d[1]=(-g*b+c*s)*r;d[2]=(f*b-c*h)*r;d[3]=k*r;d[4]=(g*l-c*D)*r;d[5]=(-f*l+c*e)*r;d[6]=m*r;d[7]=(-s*l+b*D)*r;d[8]=(h*l-b*e)*r;return d},multiply:function(a,d,l){l||(l=a);var b=a[0],c=a[1],e=a[2],h=a[3],f=a[4],D=a[5],s=a[6],g=
a[7];a=a[8];var j=d[0],k=d[1],m=d[2],r=d[3],n=d[4],v=d[5],q=d[6],w=d[7];d=d[8];l[0]=j*b+k*h+m*s;l[1]=j*c+k*f+m*g;l[2]=j*e+k*D+m*a;l[3]=r*b+n*h+v*s;l[4]=r*c+n*f+v*g;l[5]=r*e+n*D+v*a;l[6]=q*b+w*h+d*s;l[7]=q*c+w*f+d*g;l[8]=q*e+w*D+d*a;return l},multiplyVec2:function(a,d,l){l||(l=d);var b=d[0];d=d[1];l[0]=b*a[0]+d*a[3]+a[6];l[1]=b*a[1]+d*a[4]+a[7];return l},multiplyVec3:function(a,d,l){l||(l=d);var b=d[0],c=d[1];d=d[2];l[0]=b*a[0]+c*a[3]+d*a[6];l[1]=b*a[1]+c*a[4]+d*a[7];l[2]=b*a[2]+c*a[5]+d*a[8];return l},
set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])},identity:function(a){a||(a=y.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=1;a[5]=0;a[6]=0;a[7]=0;a[8]=1;return a},transpose:function(a,
d){if(!d||a===d){var l=a[1],b=a[2],c=a[5];a[1]=a[3];a[2]=a[6];a[3]=l;a[5]=a[7];a[6]=b;a[7]=c;return a}d[0]=a[0];d[1]=a[3];d[2]=a[6];d[3]=a[1];d[4]=a[4];d[5]=a[7];d[6]=a[2];d[7]=a[5];d[8]=a[8];return d},toMat4:function(a,d){d||(d=u.create());d[15]=1;d[14]=0;d[13]=0;d[12]=0;d[11]=0;d[10]=a[8];d[9]=a[7];d[8]=a[6];d[7]=0;d[6]=a[5];d[5]=a[4];d[4]=a[3];d[3]=0;d[2]=a[2];d[1]=a[1];d[0]=a[0];return d},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+
a[8]+"]"}},u={create:function(a){var d=new k(16);a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],d[4]=a[4],d[5]=a[5],d[6]=a[6],d[7]=a[7],d[8]=a[8],d[9]=a[9],d[10]=a[10],d[11]=a[11],d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d},createFrom:function(a,d,l,b,c,e,h,f,D,s,g,j,m,n,r,q){var v=new k(16);v[0]=a;v[1]=d;v[2]=l;v[3]=b;v[4]=c;v[5]=e;v[6]=h;v[7]=f;v[8]=D;v[9]=s;v[10]=g;v[11]=j;v[12]=m;v[13]=n;v[14]=r;v[15]=q;return v},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];
d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=a[12];d[13]=a[13];d[14]=a[14];d[15]=a[15];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])&&1E-6>Math.abs(a[4]-d[4])&&1E-6>Math.abs(a[5]-d[5])&&1E-6>Math.abs(a[6]-d[6])&&1E-6>Math.abs(a[7]-d[7])&&1E-6>Math.abs(a[8]-d[8])&&1E-6>Math.abs(a[9]-d[9])&&1E-6>Math.abs(a[10]-d[10])&&1E-6>Math.abs(a[11]-d[11])&&1E-6>Math.abs(a[12]-
d[12])&&1E-6>Math.abs(a[13]-d[13])&&1E-6>Math.abs(a[14]-d[14])&&1E-6>Math.abs(a[15]-d[15])},identity:function(a){a||(a=u.create());a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a},transpose:function(a,d){if(!d||a===d){var l=a[1],b=a[2],c=a[3],e=a[6],h=a[7],f=a[11];a[1]=a[4];a[2]=a[8];a[3]=a[12];a[4]=l;a[6]=a[9];a[7]=a[13];a[8]=b;a[9]=e;a[11]=a[14];a[12]=c;a[13]=h;a[14]=f;return a}d[0]=a[0];d[1]=a[4];d[2]=a[8];d[3]=a[12];
d[4]=a[1];d[5]=a[5];d[6]=a[9];d[7]=a[13];d[8]=a[2];d[9]=a[6];d[10]=a[10];d[11]=a[14];d[12]=a[3];d[13]=a[7];d[14]=a[11];d[15]=a[15];return d},determinant:function(a){var d=a[0],l=a[1],b=a[2],c=a[3],e=a[4],h=a[5],f=a[6],D=a[7],s=a[8],g=a[9],j=a[10],k=a[11],m=a[12],r=a[13],n=a[14];a=a[15];return m*g*f*c-s*r*f*c-m*h*j*c+e*r*j*c+s*h*n*c-e*g*n*c-m*g*b*D+s*r*b*D+m*l*j*D-d*r*j*D-s*l*n*D+d*g*n*D+m*h*b*k-e*r*b*k-m*l*f*k+d*r*f*k+e*l*n*k-d*h*n*k-s*h*b*a+e*g*b*a+s*l*f*a-d*g*f*a-e*l*j*a+d*h*j*a},inverse:function(a,
d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],h=a[4],g=a[5],D=a[6],s=a[7],j=a[8],k=a[9],m=a[10],n=a[11],r=a[12],q=a[13],v=a[14],t=a[15],w=b*g-c*h,H=b*D-e*h,z=b*s-f*h,A=c*D-e*g,u=c*s-f*g,p=e*s-f*D,x=j*q-k*r,y=j*v-m*r,B=j*t-n*r,C=k*v-m*q,E=k*t-n*q,F=m*t-n*v,G=w*F-H*E+z*C+A*B-u*y+p*x;if(!G)return null;G=1/G;d[0]=(g*F-D*E+s*C)*G;d[1]=(-c*F+e*E-f*C)*G;d[2]=(q*p-v*u+t*A)*G;d[3]=(-k*p+m*u-n*A)*G;d[4]=(-h*F+D*B-s*y)*G;d[5]=(b*F-e*B+f*y)*G;d[6]=(-r*p+v*z-t*H)*G;d[7]=(j*p-m*z+n*H)*G;d[8]=(h*E-g*B+s*x)*G;d[9]=
(-b*E+c*B-f*x)*G;d[10]=(r*u-q*z+t*w)*G;d[11]=(-j*u+k*z-n*w)*G;d[12]=(-h*C+g*y-D*x)*G;d[13]=(b*C-c*y+e*x)*G;d[14]=(-r*A+q*H-v*w)*G;d[15]=(j*A-k*H+m*w)*G;return d},toRotationMat:function(a,d){d||(d=u.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];d[4]=a[4];d[5]=a[5];d[6]=a[6];d[7]=a[7];d[8]=a[8];d[9]=a[9];d[10]=a[10];d[11]=a[11];d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d},toMat3:function(a,d){d||(d=y.create());d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[4];d[4]=a[5];d[5]=a[6];d[6]=a[8];d[7]=a[9];d[8]=a[10];
return d},toInverseMat3:function(a,d){var b=a[0],c=a[1],e=a[2],f=a[4],h=a[5],g=a[6],j=a[8],s=a[9],k=a[10],m=k*h-g*s,n=-k*f+g*j,q=s*f-h*j,r=b*m+c*n+e*q;if(!r)return null;r=1/r;d||(d=y.create());d[0]=m*r;d[1]=(-k*c+e*s)*r;d[2]=(g*c-e*h)*r;d[3]=n*r;d[4]=(k*b-e*j)*r;d[5]=(-g*b+e*f)*r;d[6]=q*r;d[7]=(-s*b+c*j)*r;d[8]=(h*b-c*f)*r;return d},multiply:function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2],h=a[3],g=a[4],j=a[5],s=a[6],k=a[7],m=a[8],n=a[9],q=a[10],r=a[11],t=a[12],v=a[13],u=a[14];a=a[15];var w=d[0],
p=d[1],z=d[2],A=d[3];b[0]=w*c+p*g+z*m+A*t;b[1]=w*e+p*j+z*n+A*v;b[2]=w*f+p*s+z*q+A*u;b[3]=w*h+p*k+z*r+A*a;w=d[4];p=d[5];z=d[6];A=d[7];b[4]=w*c+p*g+z*m+A*t;b[5]=w*e+p*j+z*n+A*v;b[6]=w*f+p*s+z*q+A*u;b[7]=w*h+p*k+z*r+A*a;w=d[8];p=d[9];z=d[10];A=d[11];b[8]=w*c+p*g+z*m+A*t;b[9]=w*e+p*j+z*n+A*v;b[10]=w*f+p*s+z*q+A*u;b[11]=w*h+p*k+z*r+A*a;w=d[12];p=d[13];z=d[14];A=d[15];b[12]=w*c+p*g+z*m+A*t;b[13]=w*e+p*j+z*n+A*v;b[14]=w*f+p*s+z*q+A*u;b[15]=w*h+p*k+z*r+A*a;return b},multiplyVec3:function(a,d,b){b||(b=d);
var c=d[0],e=d[1];d=d[2];b[0]=a[0]*c+a[4]*e+a[8]*d+a[12];b[1]=a[1]*c+a[5]*e+a[9]*d+a[13];b[2]=a[2]*c+a[6]*e+a[10]*d+a[14];return b},multiplyVec4:function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=d[3];b[0]=a[0]*c+a[4]*e+a[8]*f+a[12]*d;b[1]=a[1]*c+a[5]*e+a[9]*f+a[13]*d;b[2]=a[2]*c+a[6]*e+a[10]*f+a[14]*d;b[3]=a[3]*c+a[7]*e+a[11]*f+a[15]*d;return b},translate:function(a,d,b){var c=d[0],e=d[1];d=d[2];var f,h,g,j,s,k,m,n,p,r,q,v;if(!b||a===b)return a[12]=a[0]*c+a[4]*e+a[8]*d+a[12],a[13]=a[1]*c+a[5]*e+
a[9]*d+a[13],a[14]=a[2]*c+a[6]*e+a[10]*d+a[14],a[15]=a[3]*c+a[7]*e+a[11]*d+a[15],a;f=a[0];h=a[1];g=a[2];j=a[3];s=a[4];k=a[5];m=a[6];n=a[7];p=a[8];r=a[9];q=a[10];v=a[11];b[0]=f;b[1]=h;b[2]=g;b[3]=j;b[4]=s;b[5]=k;b[6]=m;b[7]=n;b[8]=p;b[9]=r;b[10]=q;b[11]=v;b[12]=f*c+s*e+p*d+a[12];b[13]=h*c+k*e+r*d+a[13];b[14]=g*c+m*e+q*d+a[14];b[15]=j*c+n*e+v*d+a[15];return b},scale:function(a,d,b){var c=d[0],e=d[1];d=d[2];if(!b||a===b)return a[0]*=c,a[1]*=c,a[2]*=c,a[3]*=c,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=d,a[9]*=
d,a[10]*=d,a[11]*=d,a;b[0]=a[0]*c;b[1]=a[1]*c;b[2]=a[2]*c;b[3]=a[3]*c;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[7]=a[7]*e;b[8]=a[8]*d;b[9]=a[9]*d;b[10]=a[10]*d;b[11]=a[11]*d;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b},rotate:function(a,d,b,c){var e=b[0],f=b[1];b=b[2];var h=Math.sqrt(e*e+f*f+b*b),g,j,k,m,n,p,q,r,t,v,u,w,x,z,A,y,B,C,E,F;if(!h)return null;1!==h&&(h=1/h,e*=h,f*=h,b*=h);g=Math.sin(d);j=Math.cos(d);k=1-j;d=a[0];h=a[1];m=a[2];n=a[3];p=a[4];q=a[5];r=a[6];t=a[7];v=a[8];u=a[9];w=
a[10];x=a[11];z=e*e*k+j;A=f*e*k+b*g;y=b*e*k-f*g;B=e*f*k-b*g;C=f*f*k+j;E=b*f*k+e*g;F=e*b*k+f*g;e=f*b*k-e*g;f=b*b*k+j;c?a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a;c[0]=d*z+p*A+v*y;c[1]=h*z+q*A+u*y;c[2]=m*z+r*A+w*y;c[3]=n*z+t*A+x*y;c[4]=d*B+p*C+v*E;c[5]=h*B+q*C+u*E;c[6]=m*B+r*C+w*E;c[7]=n*B+t*C+x*E;c[8]=d*F+p*e+v*f;c[9]=h*F+q*e+u*f;c[10]=m*F+r*e+w*f;c[11]=n*F+t*e+x*f;return c},rotateX:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[4],f=a[5],h=a[6],g=a[7],j=a[8],k=a[9],m=a[10],
n=a[11];b?a!==b&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[4]=e*d+j*c;b[5]=f*d+k*c;b[6]=h*d+m*c;b[7]=g*d+n*c;b[8]=e*-c+j*d;b[9]=f*-c+k*d;b[10]=h*-c+m*d;b[11]=g*-c+n*d;return b},rotateY:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],h=a[2],g=a[3],j=a[8],k=a[9],m=a[10],n=a[11];b?a!==b&&(b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+j*-c;b[1]=f*d+k*-c;b[2]=h*d+m*-c;b[3]=g*
d+n*-c;b[8]=e*c+j*d;b[9]=f*c+k*d;b[10]=h*c+m*d;b[11]=g*c+n*d;return b},rotateZ:function(a,d,b){var c=Math.sin(d);d=Math.cos(d);var e=a[0],f=a[1],h=a[2],g=a[3],j=a[4],k=a[5],m=a[6],n=a[7];b?a!==b&&(b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]):b=a;b[0]=e*d+j*c;b[1]=f*d+k*c;b[2]=h*d+m*c;b[3]=g*d+n*c;b[4]=e*-c+j*d;b[5]=f*-c+k*d;b[6]=h*-c+m*d;b[7]=g*-c+n*d;return b},frustum:function(a,d,b,c,e,f,h){h||(h=u.create());var g=d-a,j=c-b,k=f-e;h[0]=2*e/g;h[1]=0;
h[2]=0;h[3]=0;h[4]=0;h[5]=2*e/j;h[6]=0;h[7]=0;h[8]=(d+a)/g;h[9]=(c+b)/j;h[10]=-(f+e)/k;h[11]=-1;h[12]=0;h[13]=0;h[14]=-(2*f*e)/k;h[15]=0;return h},perspective:function(a,d,b,c,e){a=b*Math.tan(a*Math.PI/360);d*=a;return u.frustum(-d,d,-a,a,b,c,e)},ortho:function(a,d,b,c,e,f,h){h||(h=u.create());var g=d-a,j=c-b,k=f-e;h[0]=2/g;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=2/j;h[6]=0;h[7]=0;h[8]=0;h[9]=0;h[10]=-2/k;h[11]=0;h[12]=-(a+d)/g;h[13]=-(c+b)/j;h[14]=-(f+e)/k;h[15]=1;return h},lookAt:function(a,d,b,c){c||
(c=u.create());var e,f,h,g,j,k,m,n,p=a[0],q=a[1];a=a[2];h=b[0];g=b[1];f=b[2];m=d[0];b=d[1];e=d[2];if(p===m&&q===b&&a===e)return u.identity(c);d=p-m;b=q-b;m=a-e;n=1/Math.sqrt(d*d+b*b+m*m);d*=n;b*=n;m*=n;e=g*m-f*b;f=f*d-h*m;h=h*b-g*d;(n=Math.sqrt(e*e+f*f+h*h))?(n=1/n,e*=n,f*=n,h*=n):h=f=e=0;g=b*h-m*f;j=m*e-d*h;k=d*f-b*e;(n=Math.sqrt(g*g+j*j+k*k))?(n=1/n,g*=n,j*=n,k*=n):k=j=g=0;c[0]=e;c[1]=g;c[2]=d;c[3]=0;c[4]=f;c[5]=j;c[6]=b;c[7]=0;c[8]=h;c[9]=k;c[10]=m;c[11]=0;c[12]=-(e*p+f*q+h*a);c[13]=-(g*p+j*q+
k*a);c[14]=-(d*p+b*q+m*a);c[15]=1;return c},fromRotationTranslation:function(a,d,b){b||(b=u.create());var c=a[0],e=a[1],f=a[2],h=a[3],g=c+c,j=e+e,k=f+f;a=c*g;var m=c*j,c=c*k,n=e*j,e=e*k,f=f*k,g=h*g,j=h*j,h=h*k;b[0]=1-(n+f);b[1]=m+h;b[2]=c-j;b[3]=0;b[4]=m-h;b[5]=1-(a+f);b[6]=e+g;b[7]=0;b[8]=c+j;b[9]=e-g;b[10]=1-(a+n);b[11]=0;b[12]=d[0];b[13]=d[1];b[14]=d[2];b[15]=1;return b},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+
a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"}},m={create:function(a){var d=new k(4);a?(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]):d[0]=d[1]=d[2]=d[3]=0;return d},createFrom:function(a,d,b,c){var e=new k(4);e[0]=a;e[1]=d;e[2]=b;e[3]=c;return e},set:function(a,d){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d},equal:function(a,d){return a===d||1E-6>Math.abs(a[0]-d[0])&&1E-6>Math.abs(a[1]-d[1])&&1E-6>Math.abs(a[2]-d[2])&&1E-6>Math.abs(a[3]-d[3])},identity:function(a){a||(a=m.create());
a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a}},F=m.identity();m.calculateW=function(a,d){var b=a[0],c=a[1],e=a[2];if(!d||a===d)return a[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e)),a;d[0]=b;d[1]=c;d[2]=e;d[3]=-Math.sqrt(Math.abs(1-b*b-c*c-e*e));return d};m.dot=function(a,d){return a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3]};m.inverse=function(a,d){var b=a[0],c=a[1],e=a[2],f=a[3],b=(b=b*b+c*c+e*e+f*f)?1/b:0;if(!d||a===d)return a[0]*=-b,a[1]*=-b,a[2]*=-b,a[3]*=b,a;d[0]=-a[0]*b;d[1]=-a[1]*b;d[2]=-a[2]*b;d[3]=a[3]*b;
return d};m.conjugate=function(a,d){if(!d||a===d)return a[0]*=-1,a[1]*=-1,a[2]*=-1,a;d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=a[3];return d};m.length=function(a){var d=a[0],b=a[1],c=a[2];a=a[3];return Math.sqrt(d*d+b*b+c*c+a*a)};m.normalize=function(a,d){d||(d=a);var b=a[0],c=a[1],e=a[2],f=a[3],h=Math.sqrt(b*b+c*c+e*e+f*f);if(0===h)return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d;h=1/h;d[0]=b*h;d[1]=c*h;d[2]=e*h;d[3]=f*h;return d};m.add=function(a,d,b){if(!b||a===b)return a[0]+=d[0],a[1]+=d[1],a[2]+=d[2],a[3]+=
d[3],a;b[0]=a[0]+d[0];b[1]=a[1]+d[1];b[2]=a[2]+d[2];b[3]=a[3]+d[3];return b};m.multiply=function(a,d,b){b||(b=a);var c=a[0],e=a[1],f=a[2];a=a[3];var h=d[0],g=d[1],j=d[2];d=d[3];b[0]=c*d+a*h+e*j-f*g;b[1]=e*d+a*g+f*h-c*j;b[2]=f*d+a*j+c*g-e*h;b[3]=a*d-c*h-e*g-f*j;return b};m.multiplyVec3=function(a,d,b){b||(b=d);var c=d[0],e=d[1],f=d[2];d=a[0];var h=a[1],g=a[2];a=a[3];var j=a*c+h*f-g*e,k=a*e+g*c-d*f,m=a*f+d*e-h*c,c=-d*c-h*e-g*f;b[0]=j*a+c*-d+k*-g-m*-h;b[1]=k*a+c*-h+m*-d-j*-g;b[2]=m*a+c*-g+j*-h-k*-d;
return b};m.scale=function(a,d,b){if(!b||a===b)return a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a;b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[3]=a[3]*d;return b};m.toMat3=function(a,d){d||(d=y.create());var b=a[0],c=a[1],e=a[2],f=a[3],h=b+b,g=c+c,j=e+e,k=b*h,m=b*g,b=b*j,n=c*g,c=c*j,e=e*j,h=f*h,g=f*g,f=f*j;d[0]=1-(n+e);d[1]=m+f;d[2]=b-g;d[3]=m-f;d[4]=1-(k+e);d[5]=c+h;d[6]=b+g;d[7]=c-h;d[8]=1-(k+n);return d};m.toMat4=function(a,d){d||(d=u.create());var b=a[0],c=a[1],e=a[2],f=a[3],h=b+b,g=c+c,j=e+e,k=b*h,m=b*g,b=b*
j,n=c*g,c=c*j,e=e*j,h=f*h,g=f*g,f=f*j;d[0]=1-(n+e);d[1]=m+f;d[2]=b-g;d[3]=0;d[4]=m-f;d[5]=1-(k+e);d[6]=c+h;d[7]=0;d[8]=b+g;d[9]=c-h;d[10]=1-(k+n);d[11]=0;d[12]=0;d[13]=0;d[14]=0;d[15]=1;return d};m.slerp=function(a,d,b,c){c||(c=a);var e=a[0]*d[0]+a[1]*d[1]+a[2]*d[2]+a[3]*d[3],f,g;if(1<=Math.abs(e))return c!==a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3]),c;f=Math.acos(e);g=Math.sqrt(1-e*e);if(0.0010>Math.abs(g))return c[0]=0.5*a[0]+0.5*d[0],c[1]=0.5*a[1]+0.5*d[1],c[2]=0.5*a[2]+0.5*d[2],c[3]=0.5*a[3]+
0.5*d[3],c;e=Math.sin((1-b)*f)/g;b=Math.sin(b*f)/g;c[0]=a[0]*e+d[0]*b;c[1]=a[1]*e+d[1]*b;c[2]=a[2]*e+d[2]*b;c[3]=a[3]*e+d[3]*b;return c};m.fromRotationMatrix=function(a,d){d||(d=m.create());var b=a[0]+a[4]+a[8],c;if(0<b)c=Math.sqrt(b+1),d[3]=0.5*c,c=0.5/c,d[0]=(a[7]-a[5])*c,d[1]=(a[2]-a[6])*c,d[2]=(a[3]-a[1])*c;else{c=m.fromRotationMatrix.s_iNext=m.fromRotationMatrix.s_iNext||[1,2,0];b=0;a[4]>a[0]&&(b=1);a[8]>a[3*b+b]&&(b=2);var e=c[b],f=c[e];c=Math.sqrt(a[3*b+b]-a[3*e+e]-a[3*f+f]+1);d[b]=0.5*c;c=
0.5/c;d[3]=(a[3*f+e]-a[3*e+f])*c;d[e]=(a[3*e+b]+a[3*b+e])*c;d[f]=(a[3*f+b]+a[3*b+f])*c}return d};y.toQuat4=m.fromRotationMatrix;var B=y.create();m.fromAxes=function(a,b,c,e){B[0]=b[0];B[3]=b[1];B[6]=b[2];B[1]=c[0];B[4]=c[1];B[7]=c[2];B[2]=a[0];B[5]=a[1];B[8]=a[2];return m.fromRotationMatrix(B,e)};m.identity=function(a){a||(a=m.create());a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a};m.fromAngleAxis=function(a,b,c){c||(c=m.create());a*=0.5;var e=Math.sin(a);c[3]=Math.cos(a);c[0]=e*b[0];c[1]=e*b[1];c[2]=e*b[2];
return c};m.toAngleAxis=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];0<c?(b[3]=2*Math.acos(a[3]),c=e.invsqrt(c),b[0]=a[0]*c,b[1]=a[1]*c,b[2]=a[2]*c):(b[3]=0,b[0]=1,b[1]=0,b[2]=0);return b};m.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"};var J={create:function(a){var b=new k(2);a?(b[0]=a[0],b[1]=a[1]):(b[0]=0,b[1]=0);return b},createFrom:function(a,b){var c=new k(2);c[0]=a;c[1]=b;return c},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];return c},subtract:function(a,
b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];return c},multiply:function(a,b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;return c},dist:function(a,b){var c=b[0]-a[0],e=b[1]-a[1];return Math.sqrt(c*c+e*e)},set:function(a,b){b[0]=a[0];b[1]=a[1];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])},negate:function(a,b){b||(b=a);
b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];0<c?(c=Math.sqrt(c),b[0]=a[0]/c,b[1]=a[1]/c):b[0]=b[1]=0;return b},cross:function(a,b,c){a=a[0]*b[1]-a[1]*b[0];if(!c)return a;c[0]=c[1]=0;c[2]=a;return c},length:function(a){var b=a[0];a=a[1];return Math.sqrt(b*b+a*a)},squaredLength:function(a){var b=a[0];a=a[1];return b*b+a*a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]},direction:function(a,b,c){c||(c=a);var e=a[0]-b[0];a=a[1]-b[1];b=e*e+a*a;if(!b)return c[0]=
0,c[1]=0,c[2]=0,c;b=1/Math.sqrt(b);c[0]=e*b;c[1]=a*b;return c},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);return e},str:function(a){return"["+a[0]+", "+a[1]+"]"}},I={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0;return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>
Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},identity:function(a){a||(a=I.create());a[0]=1;a[1]=0;a[2]=0;a[3]=1;return a},transpose:function(a,b){if(!b||a===b){var c=a[1];a[1]=a[2];a[2]=c;return a}b[0]=a[0];b[1]=a[2];b[2]=a[1];b[3]=a[3];return b},determinant:function(a){return a[0]*a[3]-a[2]*a[1]},inverse:function(a,b){b||(b=a);var c=a[0],e=a[1],f=a[2],g=a[3],h=c*g-f*e;if(!h)return null;h=1/h;b[0]=g*h;b[1]=-e*h;b[2]=-f*h;b[3]=c*h;return b},multiply:function(a,
b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];c[0]=e*b[0]+f*b[2];c[1]=e*b[1]+f*b[3];c[2]=g*b[0]+a*b[2];c[3]=g*b[1]+a*b[3];return c},rotate:function(a,b,c){c||(c=a);var e=a[0],f=a[1],g=a[2];a=a[3];var h=Math.sin(b);b=Math.cos(b);c[0]=e*b+f*h;c[1]=e*-h+f*b;c[2]=g*b+a*h;c[3]=g*-h+a*b;return c},multiplyVec2:function(a,b,c){c||(c=b);var e=b[0];b=b[1];c[0]=e*a[0]+b*a[1];c[1]=e*a[2]+b*a[3];return c},scale:function(a,b,c){c||(c=a);var e=a[1],f=a[2],g=a[3],h=b[0];b=b[1];c[0]=a[0]*h;c[1]=e*b;c[2]=f*h;c[3]=
g*b;return c},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}},K={create:function(a){var b=new k(4);a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b},createFrom:function(a,b,c,e){var f=new k(4);f[0]=a;f[1]=b;f[2]=c;f[3]=e;return f},add:function(a,b,c){c||(c=b);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},subtract:function(a,b,c){c||(c=b);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c},multiply:function(a,
b,c){c||(c=b);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c},divide:function(a,b,c){c||(c=b);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c},scale:function(a,b,c){c||(c=a);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c},set:function(a,b){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},equal:function(a,b){return a===b||1E-6>Math.abs(a[0]-b[0])&&1E-6>Math.abs(a[1]-b[1])&&1E-6>Math.abs(a[2]-b[2])&&1E-6>Math.abs(a[3]-b[3])},negate:function(a,b){b||
(b=a);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},length:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return Math.sqrt(b*b+c*c+e*e+a*a)},squaredLength:function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return b*b+c*c+e*e+a*a},lerp:function(a,b,c,e){e||(e=a);e[0]=a[0]+c*(b[0]-a[0]);e[1]=a[1]+c*(b[1]-a[1]);e[2]=a[2]+c*(b[2]-a[2]);e[3]=a[3]+c*(b[3]-a[3]);return e},str:function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"}};b&&(b.glMatrixArrayType=k,b.MatrixArray=k,b.setMatrixArrayType=c,b.determineMatrixArrayType=
f,b.glMath=e,b.vec2=J,b.vec3=n,b.vec4=K,b.mat2=I,b.mat3=y,b.mat4=u,b.quat4=m);return{glMatrixArrayType:k,MatrixArray:k,setMatrixArrayType:c,determineMatrixArrayType:f,glMath:e,vec2:J,vec3:n,vec4:K,mat2:I,mat3:y,mat4:u,quat4:m}});PIXI.shaderFragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor \x3d texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor \x3d gl_FragColor * vColor;","}"];
PIXI.shaderVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat4 uMVMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void) {","gl_Position \x3d uMVMatrix * vec4(aVertexPosition, 1.0, 1.0);","vTextureCoord \x3d aTextureCoord;","vColor \x3d aColor;","}"];
PIXI.CompileVertexShader=function(b,c){for(var f="",e=0;e<c.length;e++)f+=c[e];e=b.createShader(b.VERTEX_SHADER);b.shaderSource(e,f);b.compileShader(e);return!b.getShaderParameter(e,b.COMPILE_STATUS)?(alert(b.getShaderInfoLog(e)),null):e};PIXI.CompileFragmentShader=function(b,c){for(var f="",e=0;e<c.length;e++)f+=c[e];e=b.createShader(b.FRAGMENT_SHADER);b.shaderSource(e,f);b.compileShader(e);return!b.getShaderParameter(e,b.COMPILE_STATUS)?(alert(b.getShaderInfoLog(e)),null):e};PIXI._defaultFrame=new PIXI.Rectangle(0,0,1,1);
PIXI.WebGLRenderer=function(b,c){this.width=b?b:800;this.height=c?c:600;this.view=document.createElement("canvas");this.view.width=this.width;this.view.height=this.height;this.view.background="#FF0000";var f=this;this.view.addEventListener("webglcontextlost",function(b){f.handleContextLost(b)},!1);this.view.addEventListener("webglcontextrestored",function(b){f.handleContextRestored(b)},!1);this.batchs=[];try{this.gl=this.view.getContext("experimental-webgl",{alpha:!1})}catch(e){throw Error(" This browser does not support webGL. Try using the canvas renderer"+
this);}this.initShaders();var g=this.gl;this.batch=new PIXI.WebGLBatch(g);g.disable(g.DEPTH_TEST);g.enable(g.BLEND);g.colorMask(!0,!0,!0,!1);this.projectionMatrix=mat4.create();this.resize(this.width,this.height);this.contextLost=!1};PIXI.WebGLRenderer.constructor=PIXI.WebGLRenderer;
PIXI.WebGLRenderer.prototype.initShaders=function(){var b=this.gl,c=PIXI.CompileFragmentShader(b,PIXI.shaderFragmentSrc),f=PIXI.CompileVertexShader(b,PIXI.shaderVertexSrc),e=this.shaderProgram=b.createProgram();b.attachShader(e,f);b.attachShader(e,c);b.linkProgram(e);b.getProgramParameter(e,b.LINK_STATUS)||alert("Could not initialise shaders");b.useProgram(e);e.vertexPositionAttribute=b.getAttribLocation(e,"aVertexPosition");b.enableVertexAttribArray(e.vertexPositionAttribute);e.textureCoordAttribute=
b.getAttribLocation(e,"aTextureCoord");b.enableVertexAttribArray(e.textureCoordAttribute);e.colorAttribute=b.getAttribLocation(e,"aColor");b.enableVertexAttribArray(e.colorAttribute);e.mvMatrixUniform=b.getUniformLocation(e,"uMVMatrix");e.samplerUniform=b.getUniformLocation(e,"uSampler");PIXI.shaderProgram=this.shaderProgram};
PIXI.WebGLRenderer.prototype.checkVisibility=function(b,c){for(var f=b.children,e=0;e<f.length;e++){var g=f[e],j=g.visible&&c;g.textureChange&&(g.textureChange=!1,j&&(this.removeDisplayObject(g),this.addDisplayObject(g)));g.cacheVisible!=j&&(g.cacheVisible=j,g.cacheVisible?this.addDisplayObject(g):this.removeDisplayObject(g));0<g.children.length&&this.checkVisibility(g,j)}};
PIXI.WebGLRenderer.prototype.render=function(b){if(!this.contextLost){for(var c=0;c<b.__childrenRemoved.length;c++)this.removeDisplayObject(b.__childrenRemoved[c]);for(c=0;c<PIXI.texturesToUpdate.length;c++)this.updateTexture(PIXI.texturesToUpdate[c]);b.__childrenRemoved=[];b.__childrenAdded=[];PIXI.texturesToUpdate=[];this.checkVisibility(b,!0);b.updateTransform();c=this.gl;c.clear(c.COLOR_BUFFER_BIT);c.clearColor(b.backgroundColorSplit[0],b.backgroundColorSplit[1],b.backgroundColorSplit[2],1);c.blendFunc(c.ONE,
c.ONE_MINUS_SRC_ALPHA);c.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,this.projectionMatrix);for(c=0;c<this.batchs.length;c++)b=this.batchs[c],b instanceof PIXI.WebGLBatch?this.batchs[c].render():b instanceof PIXI.Strip&&b.visible&&this.renderStrip(b)}};
PIXI.WebGLRenderer.prototype.updateTexture=function(b){var c=this.gl;b._glTexture||(b._glTexture=c.createTexture());b.hasLoaded&&(c.bindTexture(c.TEXTURE_2D,b._glTexture),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,b.image),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,
c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),c.bindTexture(c.TEXTURE_2D,null));this.refreshBatchs=!0};
PIXI.WebGLRenderer.prototype.addDisplayObject=function(b){if(b.stage&&!b.__inWebGL&&(b.batch=null,b.renderable)){b.__inWebGL=!0;var c=b;do{if(0==c.childIndex)c=c.parent;else for(c=c.parent.children[c.childIndex-1];0!=c.children.length;)c=c.children[c.children.length-1];if(c==b.stage)break}while(!c.renderable||!c.__inWebGL);var f=b;do{if(0==f.children.length){for(;f.childIndex==f.parent.children.length-1;)if(f=f.parent,f==b.stage){f=null;break}f&&(f=f.parent.children[f.childIndex+1])}else f=f.children[0];
if(!f)break}while(!f.renderable||!f.__inWebGL);if(b instanceof PIXI.Sprite){var e;if(c instanceof PIXI.Sprite){if((e=c.batch)&&e.texture==b.texture.baseTexture&&e.blendMode==b.blendMode){e.insertAfter(b,c);return}}else e=c;if(f&&f instanceof PIXI.Sprite&&(c=f.batch)){if(c.texture==b.texture.baseTexture&&c.blendMode==b.blendMode){c.insertBefore(b,f);return}if(c==e){f=e.split(f);c=PIXI._getBatch(this.gl);e=this.batchs.indexOf(e);c.init(b);this.batchs.splice(e+1,0,c,f);return}}c=PIXI._getBatch(this.gl);
c.init(b);e?(e=this.batchs.indexOf(e),this.batchs.splice(e+1,0,c)):this.batchs.push(c)}else b instanceof PIXI.Strip&&(this.initStrip(b),this.batchs.push(b));this.batchUpdate=!0}};
PIXI.WebGLRenderer.prototype.removeDisplayObject=function(b){b.cacheVisible=!1;if(b.renderable){b.__inWebGL=!1;var c;if(b instanceof PIXI.Sprite){var f=b.batch;if(!f)return;f.remove(b);0==f.size&&(c=f)}else c=b;c&&(b=this.batchs.indexOf(c),-1!=b&&(!(0==b||b==this.batchs.length-1)&&this.batchs[b-1]instanceof PIXI.WebGLBatch&&this.batchs[b+1]instanceof PIXI.WebGLBatch&&this.batchs[b-1].texture==this.batchs[b+1].texture&&this.batchs[b-1].blendMode==this.batchs[b+1].blendMode?(this.batchs[b-1].merge(this.batchs[b+
1]),c instanceof PIXI.WebGLBatch&&PIXI._returnBatch(c),PIXI._returnBatch(this.batchs[b+1]),this.batchs.splice(b,2)):(this.batchs.splice(b,1),c instanceof PIXI.WebGLBatch&&PIXI._returnBatch(c))))}};
PIXI.WebGLRenderer.prototype.resize=function(b,c){this.width=b;this.height=c;this.view.width=b;this.view.height=c;this.gl.viewport(0,0,this.width,this.height);mat4.identity(this.projectionMatrix);mat4.scale(this.projectionMatrix,[2/this.width,-2/this.height,1]);mat4.translate(this.projectionMatrix,[-this.width/2,-this.height/2,0])};
PIXI.WebGLRenderer.prototype.initStrip=function(b){var c=this.gl;b._vertexBuffer=c.createBuffer();b._indexBuffer=c.createBuffer();b._uvBuffer=c.createBuffer();b._colorBuffer=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,b._vertexBuffer);c.bufferData(c.ARRAY_BUFFER,b.verticies,c.DYNAMIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,b._uvBuffer);c.bufferData(c.ARRAY_BUFFER,b.uvs,c.STATIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,b._colorBuffer);c.bufferData(c.ARRAY_BUFFER,b.colors,c.STATIC_DRAW);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,
b._indexBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,b.indices,c.STATIC_DRAW)};
PIXI.WebGLRenderer.prototype.renderStrip=function(b){var c=this.gl,f=this.shaderProgram,e=mat3.toMat4(b.worldTransform);mat4.transpose(e);mat4.multiply(this.projectionMatrix,e,e);c.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,e);b.blendMode==PIXI.blendModes.NORMAL?c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA):c.blendFunc(c.ONE,c.ONE_MINUS_SRC_COLOR);b.dirty?(b.dirty=!1,c.bindBuffer(c.ARRAY_BUFFER,b._vertexBuffer),c.bufferData(c.ARRAY_BUFFER,b.verticies,c.STATIC_DRAW),c.vertexAttribPointer(f.vertexPositionAttribute,
2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,b._uvBuffer),c.bufferData(c.ARRAY_BUFFER,b.uvs,c.STATIC_DRAW),c.vertexAttribPointer(f.textureCoordAttribute,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,b.texture.baseTexture._glTexture),c.bindBuffer(c.ARRAY_BUFFER,b._colorBuffer),c.bufferData(c.ARRAY_BUFFER,b.colors,c.STATIC_DRAW),c.vertexAttribPointer(f.colorAttribute,1,c.FLOAT,!1,0,0),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,b._indexBuffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,
b.indices,c.STATIC_DRAW)):(c.bindBuffer(c.ARRAY_BUFFER,b._vertexBuffer),c.bufferSubData(c.ARRAY_BUFFER,0,b.verticies),c.vertexAttribPointer(f.vertexPositionAttribute,2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,b._uvBuffer),c.vertexAttribPointer(f.textureCoordAttribute,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,b.texture.baseTexture._glTexture),c.bindBuffer(c.ARRAY_BUFFER,b._colorBuffer),c.vertexAttribPointer(f.colorAttribute,1,c.FLOAT,!1,0,0),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,
b._indexBuffer));c.drawElements(c.TRIANGLE_STRIP,b.indices.length,c.UNSIGNED_SHORT,0);c.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform,!1,this.projectionMatrix)};PIXI.WebGLRenderer.prototype.handleContextLost=function(b){b.preventDefault();this.contextLost=!0};
PIXI.WebGLRenderer.prototype.handleContextRestored=function(){this.gl=this.view.getContext("experimental-webgl",{alpha:!0});this.initShaders();for(var b=0;b<PIXI.TextureCache.length;b++)this.updateTexture(PIXI.TextureCache[b]);for(b=0;b<this.batchs.length;b++)this.batchs[b].restoreLostContext(this.gl),this.batchs[b].dirty=!0;PIXI._restoreBatchs(this.gl);this.contextLost=!1};PIXI._batchs=[];PIXI._getBatch=function(b){return 0==PIXI._batchs.length?new PIXI.WebGLBatch(b):PIXI._batchs.pop()};PIXI._returnBatch=function(b){b.clean();PIXI._batchs.push(b)};PIXI._restoreBatchs=function(b){for(var c=0;c<PIXI._batchs.length;c++)PIXI._batchs[c].restoreLostContext(b)};
PIXI.WebGLBatch=function(b){this.gl=b;this.size=0;this.vertexBuffer=b.createBuffer();this.indexBuffer=b.createBuffer();this.uvBuffer=b.createBuffer();this.colorBuffer=b.createBuffer();this.blendMode=PIXI.blendModes.NORMAL;this.dynamicSize=1};PIXI.WebGLBatch.constructor=PIXI.WebGLBatch;PIXI.WebGLBatch.prototype.clean=function(){this.verticies=[];this.uvs=[];this.indices=[];this.colors=[];this.dynamicSize=1;this.last=this.texture=null;this.size=0;this.head;this.tail};
PIXI.WebGLBatch.prototype.restoreLostContext=function(b){this.gl=b;this.vertexBuffer=b.createBuffer();this.indexBuffer=b.createBuffer();this.uvBuffer=b.createBuffer();this.colorBuffer=b.createBuffer()};PIXI.WebGLBatch.prototype.init=function(b){b.batch=this;this.dirty=!0;this.blendMode=b.blendMode;this.texture=b.texture.baseTexture;this.tail=this.head=b;this.size=1;this.growBatch()};
PIXI.WebGLBatch.prototype.insertBefore=function(b,c){this.size++;b.batch=this;this.dirty=!0;var f=c.__prev;c.__prev=b;b.__next=c;f?(b.__prev=f,f.__next=b):this.head=b};PIXI.WebGLBatch.prototype.insertAfter=function(b,c){this.size++;b.batch=this;this.dirty=!0;var f=c.__next;c.__next=b;b.__prev=c;f?(b.__next=f,f.__prev=b):this.tail=b};
PIXI.WebGLBatch.prototype.remove=function(b){this.size--;0==this.size?(b.batch=null,b.__prev=null,b.__next=null):(b.__prev?b.__prev.__next=b.__next:(this.head=b.__next,this.head.__prev=null),b.__next?b.__next.__prev=b.__prev:(this.tail=b.__prev,this.tail.__next=null),b.batch=null,b.__next=null,b.__prev=null,this.dirty=!0)};
PIXI.WebGLBatch.prototype.split=function(b){this.dirty=!0;var c=new PIXI.WebGLBatch(this.gl);c.init(b);c.tail=this.tail;this.tail=b.__prev;this.tail.__next=null;b.__prev=null;for(var f=0;b;)f++,b.batch=c,b=b.__next;c.size=f;this.size-=f;return c};PIXI.WebGLBatch.prototype.merge=function(b){this.dirty=!0;this.tail.__next=b.head;b.head.__prev=this.tail;this.size+=b.size;this.tail=b.tail;for(b=b.head;b;)b.batch=this,b=b.__next};
PIXI.WebGLBatch.prototype.growBatch=function(){var b=this.gl;this.dynamicSize=1==this.size?1:1.5*this.size;this.verticies=new Float32Array(8*this.dynamicSize);b.bindBuffer(b.ARRAY_BUFFER,this.vertexBuffer);b.bufferData(b.ARRAY_BUFFER,this.verticies,b.DYNAMIC_DRAW);this.uvs=new Float32Array(8*this.dynamicSize);b.bindBuffer(b.ARRAY_BUFFER,this.uvBuffer);b.bufferData(b.ARRAY_BUFFER,this.uvs,b.DYNAMIC_DRAW);this.dirtyUVS=!0;this.colors=new Float32Array(4*this.dynamicSize);b.bindBuffer(b.ARRAY_BUFFER,
this.colorBuffer);b.bufferData(b.ARRAY_BUFFER,this.colors,b.DYNAMIC_DRAW);this.dirtyColors=!0;this.indices=new Uint16Array(6*this.dynamicSize);for(var c=this.indices.length/6,f=0;f<c;f++){var e=6*f,g=4*f;this.indices[e+0]=g+0;this.indices[e+1]=g+1;this.indices[e+2]=g+2;this.indices[e+3]=g+0;this.indices[e+4]=g+2;this.indices[e+5]=g+3}b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.indexBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER,this.indices,b.STATIC_DRAW)};
PIXI.WebGLBatch.prototype.refresh=function(){this.dynamicSize<this.size&&this.growBatch();for(var b=0,c,f=this.head;f;){c=8*b;var e=f.texture,g=e.frame,j=e.baseTexture.width,e=e.baseTexture.height;this.uvs[c+0]=g.x/j;this.uvs[c+1]=g.y/e;this.uvs[c+2]=(g.x+g.width)/j;this.uvs[c+3]=g.y/e;this.uvs[c+4]=(g.x+g.width)/j;this.uvs[c+5]=(g.y+g.height)/e;this.uvs[c+6]=g.x/j;this.uvs[c+7]=(g.y+g.height)/e;f.updateFrame=!1;colorIndex=4*b;this.colors[colorIndex]=this.colors[colorIndex+1]=this.colors[colorIndex+
2]=this.colors[colorIndex+3]=f.worldAlpha;f=f.__next;b++}this.dirtyColors=this.dirtyUVS=!0};
PIXI.WebGLBatch.prototype.update=function(){for(var b,c,f,e,g,j,k,n,p,q,C,E=0,t=this.head;t;)c=t.width,f=t.height,e=t.anchor.x-t.texture.trim.x,g=t.anchor.y-t.texture.trim.y,j=c*(1-e),c*=-e,e=f*(1-g),g=f*-g,f=8*E,b=t.worldTransform,k=b[0],n=b[3],p=b[1],q=b[4],C=b[2],b=b[5],this.verticies[f+0]=k*c+p*g+C,this.verticies[f+1]=q*g+n*c+b,this.verticies[f+2]=k*j+p*g+C,this.verticies[f+3]=q*g+n*j+b,this.verticies[f+4]=k*j+p*e+C,this.verticies[f+5]=q*e+n*j+b,this.verticies[f+6]=k*c+p*e+C,this.verticies[f+
7]=q*e+n*c+b,t.updateFrame&&(this.dirtyUVS=!0,e=t.texture,j=e.frame,c=e.baseTexture.width,e=e.baseTexture.height,this.uvs[f+0]=j.x/c,this.uvs[f+1]=j.y/e,this.uvs[f+2]=(j.x+j.width)/c,this.uvs[f+3]=j.y/e,this.uvs[f+4]=(j.x+j.width)/c,this.uvs[f+5]=(j.y+j.height)/e,this.uvs[f+6]=j.x/c,this.uvs[f+7]=(j.y+j.height)/e,t.updateFrame=!1),t.cacheAlpha!=t.worldAlpha&&(t.cacheAlpha=t.worldAlpha,j=4*E,this.colors[j]=this.colors[j+1]=this.colors[j+2]=this.colors[j+3]=t.worldAlpha,this.dirtyColors=!0),E++,t=t.__next};
PIXI.WebGLBatch.prototype.render=function(){this.dirty&&(this.refresh(),this.dirty=!1);if(0!=this.size){this.update();var b=this.gl;this.blendMode==PIXI.blendModes.NORMAL?b.blendFunc(b.ONE,b.ONE_MINUS_SRC_ALPHA):b.blendFunc(b.ONE,b.ONE_MINUS_SRC_COLOR);var c=PIXI.shaderProgram;b.bindBuffer(b.ARRAY_BUFFER,this.vertexBuffer);b.bufferSubData(b.ARRAY_BUFFER,0,this.verticies);b.vertexAttribPointer(c.vertexPositionAttribute,2,b.FLOAT,!1,0,0);b.bindBuffer(b.ARRAY_BUFFER,this.uvBuffer);this.dirtyUVS&&(this.dirtyUVS=
!1,b.bufferSubData(b.ARRAY_BUFFER,0,this.uvs));b.vertexAttribPointer(c.textureCoordAttribute,2,b.FLOAT,!1,0,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,this.texture._glTexture);b.bindBuffer(b.ARRAY_BUFFER,this.colorBuffer);this.dirtyColors&&(this.dirtyColors=!1,b.bufferSubData(b.ARRAY_BUFFER,0,this.colors));b.vertexAttribPointer(c.colorAttribute,1,b.FLOAT,!1,0,0);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.indexBuffer);b.drawElements(b.TRIANGLES,6*this.size,b.UNSIGNED_SHORT,0)}};PIXI.CanvasRenderer=function(b,c){this.width=b?b:800;this.height=c?c:600;this.refresh=!0;this.view=document.createElement("canvas");this.view.width=this.width;this.view.height=this.height;this.count=0;this.context=this.view.getContext("2d")};PIXI.CanvasRenderer.constructor=PIXI.CanvasRenderer;
PIXI.CanvasRenderer.prototype.render=function(b){b.__childrenAdded=[];b.__childrenRemoved=[];PIXI.texturesToUpdate=[];this.context.setTransform(1,0,0,1,0,0);b.updateTransform();this.context.setTransform(1,0,0,1,0,0);this.view.style.backgroundColor!=b.backgroundColorString&&(this.view.style.backgroundColor=b.backgroundColorString);this.context.clearRect(0,0,this.width,this.height);this.renderDisplayObject(b)};
PIXI.CanvasRenderer.prototype.resize=function(b,c){this.width=b;this.height=c;this.view.width=b;this.view.height=c};
PIXI.CanvasRenderer.prototype.renderDisplayObject=function(b){var c=b.worldTransform,f=this.context;f.globalCompositeOperation="source-over";if(b.visible){if(b instanceof PIXI.Sprite){var e=b.texture.frame;e&&(f.globalAlpha=b.worldAlpha,0==b.rotation?(this.context.setTransform(1,0,0,1,0,0),f.drawImage(b.texture.baseTexture.image,e.x,e.y,e.width,e.height,c[2]+(b.anchor.x-b.texture.trim.x)*-e.width*c[0],c[5]+(b.anchor.y-b.texture.trim.y)*-e.height*c[4],b.width*c[0],b.height*c[4])):(f.setTransform(c[0],
c[3],c[1],c[4],c[2],c[5]),f.drawImage(b.texture.baseTexture.image,e.x,e.y,e.width,e.height,(b.anchor.x-b.texture.trim.x)*-e.width,(b.anchor.y-b.texture.trim.y)*-e.height,b.width,b.height)))}else b instanceof PIXI.Strip&&(f.setTransform(c[0],c[3],c[1],c[4],c[2],c[5]),this.renderStrip(b));for(c=0;c<b.children.length;c++)this.renderDisplayObject(b.children[c])}};
PIXI.CanvasRenderer.prototype.renderStripFlat=function(b){var c=this.context;b=b.verticies;var f=b.length/2;this.count++;c.beginPath();for(var e=1;e<f-2;e++){var g=2*e,j=b[g+2],k=b[g+4],n=b[g+3],p=b[g+5];c.moveTo(b[g],b[g+1]);c.lineTo(j,n);c.lineTo(k,p)}c.fillStyle="#FF0000";c.fill();c.closePath()};
PIXI.CanvasRenderer.prototype.renderStrip=function(b){var c=this.context,f=b.verticies,e=b.uvs,g=f.length/2;this.count++;for(var j=1;j<g-2;j++){var k=2*j,n=f[k],p=f[k+2],q=f[k+4],C=f[k+1],E=f[k+3],t=f[k+5],x=e[k]*b.texture.width,y=e[k+2]*b.texture.width,u=e[k+4]*b.texture.width,m=e[k+1]*b.texture.height,F=e[k+3]*b.texture.height,k=e[k+5]*b.texture.height;c.save();c.beginPath();c.moveTo(n,C);c.lineTo(p,E);c.lineTo(q,t);c.closePath();c.clip();var B=x*F+m*u+y*k-F*u-m*y-x*k;c.transform((n*F+m*q+p*k-F*
q-m*p-n*k)/B,(C*F+m*t+E*k-F*t-m*E-C*k)/B,(x*p+n*u+y*q-p*u-n*y-x*q)/B,(x*E+C*u+y*t-E*u-C*y-x*t)/B,(x*F*q+m*p*u+n*y*k-n*F*u-m*y*q-x*p*k)/B,(x*F*t+m*E*u+C*y*k-C*F*u-m*y*t-x*E*k)/B);c.drawImage(b.texture.baseTexture.image,0,0);c.restore()}};PIXI.DisplayObject=function(){this.position=new PIXI.Point;this.scale=new PIXI.Point(1,1);this.rotation=0;this.alpha=1;this.visible=!0;this.cacheVisible=!1;this.stage=this.parent=null;this.worldAlpha=1;this.color=[];this.worldTransform=mat3.identity();this.localTransform=mat3.identity();this.dynamic=!0;this._sr=0;this._cr=1;this.renderable=!1};PIXI.DisplayObject.constructor=PIXI.DisplayObject;
PIXI.DisplayObject.prototype.updateTransform=function(){this.rotation!=this.rotationCache&&(this.rotationCach=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation));this.localTransform[0]=this._cr*this.scale.x;this.localTransform[1]=-this._sr*this.scale.y;this.localTransform[3]=this._sr*this.scale.x;this.localTransform[4]=this._cr*this.scale.y;this.localTransform[2]=this.position.x;this.localTransform[5]=this.position.y;mat3.multiply(this.localTransform,this.parent.worldTransform,
this.worldTransform);this.worldAlpha=this.alpha*this.parent.worldAlpha};PIXI.DisplayObjectContainer=function(){PIXI.DisplayObject.call(this);this.children=[];this.renderable=!1};PIXI.DisplayObjectContainer.constructor=PIXI.DisplayObjectContainer;PIXI.DisplayObjectContainer.prototype=Object.create(PIXI.DisplayObject.prototype);PIXI.DisplayObjectContainer.prototype.addChild=function(b){void 0!=b.parent&&b.parent.removeChild(b);b.parent=this;b.childIndex=this.children.length;this.children.push(b);this.stage&&this.stage.__addChild(b)};
PIXI.DisplayObjectContainer.prototype.addChildAt=function(b,c){if(0<=c&&c<=this.children.length){void 0!=b.parent&&b.parent.removeChild(b);c==this.children.length?this.children.push(b):this.children.splice(c,0,b);b.parent=this;b.childIndex=c;for(var f=this.children.length,e=c;e<f;e++)this.children[e].childIndex=e;this.stage&&this.stage.__addChild(b)}else throw Error(b+" The index "+c+" supplied is out of bounds "+this.children.length);};
PIXI.DisplayObjectContainer.prototype.removeChild=function(b){var c=this.children.indexOf(b);if(-1!==c){this.stage&&this.stage.__removeChild(b);b.parent=void 0;this.children.splice(c,1);b=c;for(c=this.children.length;b<c;b++)this.children[b].childIndex-=1}else throw Error(b+" The supplied DisplayObject must be a child of the caller "+this);};
PIXI.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible){PIXI.DisplayObject.prototype.updateTransform.call(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateTransform()}};PIXI.Stage=function(b){PIXI.DisplayObjectContainer.call(this);this.worldTransform=mat3.identity();this.__childrenAdded=[];this.__childrenRemoved=[];this.childIndex=0;this.stage=this;this.setBackgroundColor(b)};PIXI.Stage.constructor=PIXI.Stage;PIXI.Stage.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateTransform()};
PIXI.Stage.prototype.setBackgroundColor=function(b){this.backgroundColor=b?b:0;this.backgroundColorSplit=HEXtoRGB(this.backgroundColor);this.backgroundColorString="#"+this.backgroundColor.toString(16)};PIXI.Stage.prototype.__addChild=function(b){b.stage=this;if(b.children)for(var c=0;c<b.children.length;c++)this.__addChild(b.children[c])};PIXI.Stage.prototype.__removeChild=function(b){this.__childrenRemoved.push(b);b.stage=void 0;if(b.children)for(var c=0,f=b.children.length;c<f;c++)this.__removeChild(b.children[c])};PIXI.blendModes={};PIXI.blendModes.NORMAL=0;PIXI.blendModes.SCREEN=1;PIXI.Sprite=function(b){PIXI.DisplayObjectContainer.call(this);this.anchor=new PIXI.Point;this.texture=b;this.blendMode=PIXI.blendModes.NORMAL;this.height=this.width=1;b.baseTexture.hasLoaded?(this.width=this.texture.frame.width,this.height=this.texture.frame.height,this.updateFrame=!0):(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind));this.renderable=!0};
PIXI.Sprite.constructor=PIXI.Sprite;PIXI.Sprite.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.Sprite.prototype.setTexture=function(b){this.texture.baseTexture!=b.baseTexture&&(this.textureChange=!0);this.texture=b;this.width=b.frame.width;this.height=b.frame.height;this.updateFrame=!0};PIXI.Sprite.prototype.onTextureUpdate=function(){this.width=this.texture.frame.width;this.height=this.texture.frame.height;this.updateFrame=!0};
PIXI.Sprite.fromFrame=function(b){var c=PIXI.TextureCache[b];if(!c)throw Error("The frameId '"+b+"' does not exist in the texture cache"+this);return new PIXI.Sprite(c)};PIXI.Sprite.fromImage=function(b){b=PIXI.Texture.fromImage(b);return new PIXI.Sprite(b)};PIXI.Strip=function(b,c,f){PIXI.DisplayObjectContainer.call(this);this.texture=b;this.blendMode=PIXI.blendModes.NORMAL;try{this.uvs=new Float32Array([0,1,1,1,1,0,0,1]),this.verticies=new Float32Array([0,0,0,0,0,0,0,0,0]),this.colors=new Float32Array([1,1,1,1]),this.indices=new Uint16Array([0,1,2,3])}catch(e){this.uvs=[0,1,1,1,1,0,0,1],this.verticies=[0,0,0,0,0,0,0,0,0],this.colors=[1,1,1,1],this.indices=[0,1,2,3]}this.width=c;this.height=f;b.baseTexture.hasLoaded?(this.width=this.texture.frame.width,
this.height=this.texture.frame.height,this.updateFrame=!0):(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind));this.renderable=!0};PIXI.Strip.constructor=PIXI.Strip;PIXI.Strip.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.Strip.prototype.setTexture=function(b){this.texture=b;this.width=b.frame.width;this.height=b.frame.height;this.updateFrame=!0};
PIXI.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0};PIXI.Rope=function(b,c){PIXI.Strip.call(this,b);this.points=c;try{this.verticies=new Float32Array(4*c.length),this.uvs=new Float32Array(4*c.length),this.colors=new Float32Array(2*c.length),this.indices=new Uint16Array(2*c.length)}catch(f){this.verticies=verticies,this.uvs=uvs,this.colors=colors,this.indices=indices}this.refresh()};PIXI.Rope.constructor=PIXI.Rope;PIXI.Rope.prototype=Object.create(PIXI.Strip.prototype);
PIXI.Rope.prototype.refresh=function(){var b=this.points;if(!(1>b.length)){var c=this.uvs,f=this.indices,e=this.colors;this.count-=0.2;c[0]=0;c[1]=1;c[2]=0;c[3]=1;e[0]=1;e[1]=1;f[0]=0;f[1]=1;for(var b=b.length,g=1;g<b;g++){var j=4*g,k=g/(b-1);c[j]=k;c[j+1]=0;c[j+2]=k;c[j+3]=1;j=2*g;e[j]=1;e[j+1]=1;j=2*g;f[j]=j;f[j+1]=j+1}}};
PIXI.Rope.prototype.updateTransform=function(){var b=this.points;if(!(1>b.length)){var c=this.verticies,f=b[0],e,g=e=0,j=b[0];this.count-=0.2;c[0]=j.x+e;c[1]=j.y+g;c[2]=j.x-e;c[3]=j.y-g;for(var k=b.length,n=1;n<k;n++){var j=b[n],p=4*n;e=n<b.length-1?b[n+1]:j;g=-(e.x-f.x);e=e.y-f.y;var f=Math.sqrt(e*e+g*g),q=this.texture.height/2;e/=f;g/=f;e*=q;g*=q;c[p]=j.x+e;c[p+1]=j.y+g;c[p+2]=j.x-e;c[p+3]=j.y-g;f=j}PIXI.DisplayObjectContainer.prototype.updateTransform.call(this)}};
PIXI.Rope.prototype.setTexture=function(b){this.texture=b;this.updateFrame=!0};PIXI.MovieClip=function(b){PIXI.Sprite.call(this,b[0]);this.textures=b;this.currentFrame=0;this.animationSpeed=1};PIXI.MovieClip.constructor=PIXI.MovieClip;PIXI.MovieClip.prototype=Object.create(PIXI.Sprite.prototype);PIXI.MovieClip.prototype.stop=function(){this.playing=!1};PIXI.MovieClip.prototype.play=function(){this.playing=!0};PIXI.MovieClip.prototype.gotoAndStop=function(b){this.playing=!1;this.currentFrame=b;this.setTexture(this.textures[(this.currentFrame+0.5|0)%this.textures.length])};
PIXI.MovieClip.prototype.gotoAndPlay=function(b){this.currentFrame=b;this.playing=!0};PIXI.MovieClip.prototype.updateTransform=function(){PIXI.Sprite.prototype.updateTransform.call(this);this.playing&&(this.currentFrame+=this.animationSpeed,this.setTexture(this.textures[(this.currentFrame+0.5|0)%this.textures.length]))};PIXI.BaseTextureCache={};PIXI.texturesToUpdate=[];PIXI.BaseTexture=function(b){PIXI.EventTarget.call(this);this.imageUrl=b;this.image=new Image;var c=this;this.image.onload=function(){c.hasLoaded=!0;c.width=c.image.width;c.height=c.image.height;PIXI.texturesToUpdate.push(c);c.dispatchEvent({type:"loaded",content:c})};this.image.src=b;this.height=this.width=100;PIXI.BaseTextureCache[b]=this};PIXI.BaseTexture.constructor=PIXI.BaseTexture;PIXI.TextureCache={};PIXI.FrameCache={};PIXI.Texture=function(b,c){PIXI.EventTarget.call(this);c||(this.noFrame=!0,c=new PIXI.Rectangle(0,0,1,1));this.trim=new PIXI.Point;this.baseTexture=b;this.frame=c;this.scope=this;if(b.hasLoaded)c||(c=new PIXI.Rectangle(0,0,b.width,b.height)),this.setFrame(c);else{var f=this;b.addEventListener("loaded",function(){f.onBaseTextureLoaded()})}};PIXI.Texture.constructor=PIXI.Texture;
PIXI.Texture.prototype.onBaseTextureLoaded=function(){var b=this.baseTexture;b.removeEventListener("loaded",this.onLoaded);this.noFrame&&(this.frame=new PIXI.Rectangle(0,0,b.width,b.height));this.noFrame=!1;this.width=this.frame.width;this.height=this.frame.height;this.scope.dispatchEvent({type:"update",content:this})};PIXI.Texture.prototype.setFrame=function(b){this.frame=b;this.width=b.width;this.height=b.height};
PIXI.Texture.fromImage=function(b){var c=PIXI.TextureCache[b];c||((c=PIXI.BaseTextureCache[b])||(c=new PIXI.BaseTexture(b)),c=new PIXI.Texture(c),PIXI.TextureCache[b]=c);return c};PIXI.Texture.fromFrameId=function(b){var c=PIXI.TextureCache[b];if(!c)throw Error("The frameId '"+b+"' does not exist in the texture cache "+this);return c};PIXI.Texture.addTextureToCache=function(b,c){PIXI.TextureCache[c]=b};PIXI.Texture.removeTextureFromCache=function(b){PIXI.TextureCache[b]=texture};PIXI.autoDetectRenderer=function(b,c){b||(b=800);c||(c=600);var f;try{f=!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(e){f=!1}return f?new PIXI.WebGLRenderer(b,c):new PIXI.CanvasRenderer(b,c)};PIXI.SpriteSheetLoader=function(b){PIXI.EventTarget.call(this);this.url=b;this.baseUrl=b.replace(/[^\/]*$/,"");this.texture;this.frames={}};PIXI.SpriteSheetLoader.constructor=PIXI.SpriteSheetLoader;PIXI.SpriteSheetLoader.prototype.load=function(){this.ajaxRequest=new AjaxRequest;var b=this;this.ajaxRequest.onreadystatechange=function(){b.onLoaded()};this.ajaxRequest.open("GET",this.url,!0);this.ajaxRequest.send(null)};
PIXI.SpriteSheetLoader.prototype.onLoaded=function(){if(4==this.ajaxRequest.readyState&&(200==this.ajaxRequest.status||-1==window.location.href.indexOf("http"))){var b=eval("("+this.ajaxRequest.responseText+")");this.texture=PIXI.Texture.fromImage(this.baseUrl+b.meta.image).baseTexture;var b=b.frames,c;for(c in b){var f=b[c].frame;PIXI.TextureCache[c]=new PIXI.Texture(this.texture,{x:f.x,y:f.y,width:f.w,height:f.h});b[c].trimmed&&(PIXI.TextureCache[c].realSize=b[c].spriteSourceSize,PIXI.TextureCache[c].trim.x=
0)}if(this.texture.hasLoaded)this.dispatchEvent({type:"loaded",content:this});else{var e=this;this.texture.addEventListener("loaded",function(){e.dispatchEvent({type:"loaded",content:e})})}}};PIXI.AssetLoader=function(b){PIXI.EventTarget.call(this);this.assetURLs=b;this.assets=[]};PIXI.AssetLoader.constructor=PIXI.AssetLoader;
PIXI.AssetLoader.prototype.load=function(){this.loadCount=this.assetURLs.length;for(var b=["jpeg","jpg","png","gif"],c=["json"],f=0;f<this.assetURLs.length;f++){for(var e=this.assetURLs[f],g=e.split(".").pop().toLowerCase(),j=null,k=0;k<b.length;k++)if(g==b[k]){j="img";break}if("img"!=j)for(k=0;k<c.length;k++)if(g==c[k]){j="atlas";break}if("img"==j)if(e=PIXI.Texture.fromImage(e),e.hasLoaded)this.loadCount--;else{var n=this;e.baseTexture.addEventListener("loaded",function(){n.onAssetLoaded()});this.assets.push(e)}else if("atlas"==
j)e=new PIXI.SpriteSheetLoader(e),this.assets.push(e),n=this,e.addEventListener("loaded",function(){n.onAssetLoaded()}),e.load();else throw Error(e+" is an unsupported file type "+this);}};PIXI.AssetLoader.prototype.onAssetLoaded=function(){this.loadCount--;this.dispatchEvent({type:"progress",content:this});0==this.loadCount&&this.dispatchEvent({type:"loaded",content:this})};

BIN
logo_small.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -1,5 +1,5 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
/**

View file

@ -1,5 +1,5 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/

View file

@ -1,10 +1,11 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
/**
* A MovieClip is a simple way to display an animation depicted by a list of textures.
* @class MovieClip
* @extends Sprite
* @constructor
* @param textures {Array} an array of {Texture} objects that make up the animation
*/

View file

@ -1,5 +1,5 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
/**

View file

@ -1,5 +1,5 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
/**

View file

@ -1,5 +1,5 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
PIXI.blendModes = {};

View file

@ -1,5 +1,5 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
/**
@ -7,15 +7,19 @@ A Stage represents the root of the display tree. Everything connected to the sta
@class Stage
@extends DisplayObjectContainer
@constructor
@param backgroundColor {Number} the background color of the stage
*/
PIXI.Stage = function()
PIXI.Stage = function(backgroundColor)
{
PIXI.DisplayObjectContainer.call( this );
this.worldTransform = mat3.identity();
this.__childrenAdded = [];
this.__childrenRemoved = [];
this.childIndex = 0;
this.stage= this;
this.setBackgroundColor(backgroundColor);
}
// constructor
@ -25,6 +29,7 @@ PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
/**
@method updateTransform
@internal
*/
PIXI.Stage.prototype.updateTransform = function()
{
@ -35,15 +40,18 @@ PIXI.Stage.prototype.updateTransform = function()
this.children[i].updateTransform();
}
}
/*
PIXI.Stage.prototype.setFilter = function(filters)
{
this.filters = filters;
}*/
/**
@method __addChild
* @method setBackgroundColor
* @param backgroundColor {Number}
*/
PIXI.Stage.prototype.setBackgroundColor = function(backgroundColor)
{
this.backgroundColor = backgroundColor ? backgroundColor : 0x000000;
this.backgroundColorSplit = HEXtoRGB(this.backgroundColor);
this.backgroundColorString = "#" + this.backgroundColor.toString(16);
}
PIXI.Stage.prototype.__addChild = function(child)
{
//this.__childrenAdded.push(child);
@ -60,9 +68,7 @@ PIXI.Stage.prototype.__addChild = function(child)
}
/**
@method __removeChild
*/
PIXI.Stage.prototype.__removeChild = function(child)
{
this.__childrenRemoved.push(child);

View file

@ -1,9 +1,9 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
/**
* A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrameId(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
* A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrame(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
* When all items have been loaded this class will dispatch a 'loaded' event
* As each individual item is loaded this class will dispatch a 'progress' event
* @class AssetLoader
@ -15,7 +15,6 @@ PIXI.AssetLoader = function(assetURLs)
{
PIXI.EventTarget.call( this );
/**
* The array of asset URLs that are going to be loaded
* @property assetURLs
@ -26,6 +25,16 @@ PIXI.AssetLoader = function(assetURLs)
this.assets = [];
}
/**
Fired when an item has loaded
@event onProgress
**/
/**
Fired when all the assets have loaded
@event onComplete
**/
// constructor
PIXI.AssetLoader.constructor = PIXI.AssetLoader;
@ -44,7 +53,7 @@ PIXI.AssetLoader.prototype.load = function()
var filename = this.assetURLs[i];
var fileType = filename.split('.').pop().toLowerCase();
// what are we loading?
var type;
var type = null;
for (var j=0; j < imageTypes.length; j++)
{
@ -55,7 +64,7 @@ PIXI.AssetLoader.prototype.load = function()
}
}
if(!type)
if(type != "img")
{
for (var j=0; j < spriteSheetTypes.length; j++)
{
@ -69,6 +78,7 @@ PIXI.AssetLoader.prototype.load = function()
if(type == "img")
{
var texture = PIXI.Texture.fromImage(filename);
if(!texture.hasLoaded)
{
@ -116,11 +126,13 @@ PIXI.AssetLoader.prototype.load = function()
PIXI.AssetLoader.prototype.onAssetLoaded = function()
{
this.loadCount--;
this.dispatchEvent( { type: 'progress', content: this } );
this.dispatchEvent( { type: 'onProgress', content: this } );
if(this.onProgress)this.onProgress();
if(this.loadCount == 0)
{
this.dispatchEvent( { type: 'loaded', content: this } );
this.dispatchEvent( { type: 'onComplete', content: this } );
if(this.onComplete)this.onComplete();
}
}

View file

@ -1,5 +1,5 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
/**

View file

@ -1,9 +1,9 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
/**
* the CanvasRenderer is draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
* the CanvasRenderer draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
* Dont forget to add the view to your DOM or you will not see anything :)
* @class CanvasRenderer
* @param width {Number} the width of the canvas view
@ -37,7 +37,6 @@ PIXI.CanvasRenderer = function(width, height)
this.view.width = this.width;
this.view.height = this.height;
this.view.background = "#FF0000";
this.count = 0;
/**
@ -71,6 +70,10 @@ PIXI.CanvasRenderer.prototype.render = function(stage)
stage.updateTransform();
this.context.setTransform(1,0,0,1,0,0);
// update the background color
if(this.view.style.backgroundColor!=stage.backgroundColorString)this.view.style.backgroundColor = stage.backgroundColorString;
this.context.clearRect(0, 0, this.width, this.height)
this.renderDisplayObject(stage);
}

View file

@ -1,5 +1,5 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
PIXI._batchs = [];

View file

@ -1,5 +1,5 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
@ -8,6 +8,7 @@ PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
* the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batch's or Sprite Cloud's
* Dont forget to add the view to your DOM or you will not see anything :)
* @class WebGLRenderer
* @constructor
* @param width {Number} the width of the canvas view
* @default 0
* @param height {Number} the height of the canvas view
@ -194,7 +195,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
gl.clear(gl.COLOR_BUFFER_BIT)
gl.clearColor(0, 0, 0, 1.0);
gl.clearColor(stage.backgroundColorSplit[0], stage.backgroundColorSplit[1], stage.backgroundColorSplit[2], 1.0);
// set the correct blend mode!
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
@ -502,7 +503,7 @@ PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
if(this.batchs[index-1] instanceof PIXI.WebGLBatch && this.batchs[index+1] instanceof PIXI.WebGLBatch)
{
if(this.batchs[index-1].texture == this.batchs[index+1].texture)
if(this.batchs[index-1].texture == this.batchs[index+1].texture && this.batchs[index-1].blendMode == this.batchs[index+1].blendMode)
{
//console.log("MERGE")
this.batchs[index-1].merge(this.batchs[index+1]);

View file

@ -1,6 +1,6 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
PIXI.shaderFragmentSrc = [ "precision mediump float;",

View file

@ -1,5 +1,5 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
PIXI.BaseTextureCache = {};
@ -42,7 +42,7 @@ PIXI.BaseTexture = function(imageUrl)
scope.dispatchEvent( { type: 'loaded', content: scope } );
}
$.proxy(this.onImageLoaded, this);
//$.proxy(this.onImageLoaded, this);
this.image.src = imageUrl;
/**

View file

@ -1,5 +1,5 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
PIXI.TextureCache = {};
@ -113,11 +113,11 @@ PIXI.Texture.fromImage = function(imageUrl)
*
* Helper function that returns a texture based on a frame id
* If the frame id is not in the texture cache an error will be thrown
* @method fromFrameId
* @method fromFrame
* @param frameId {String} The frame id of the texture
* @return Texture
*/
PIXI.Texture.fromFrameId = function(frameId)
PIXI.Texture.fromFrame = function(frameId)
{
var texture = PIXI.TextureCache[frameId];
if(!texture)throw new Error("The frameId '"+ frameId +"' does not exist in the texture cache " + this);

View file

@ -1,5 +1,5 @@
/**
* @author Mat Groves http://matgroves.com/
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
/**

View file

@ -12,6 +12,10 @@ window.requestAnimFrame = (function() {
};
})();
function HEXtoRGB(hex) {
return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255];
}
var AjaxRequest = function()
{
var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE

View file

@ -1,9 +1,10 @@
{
"name": "The Foo API",
"name": "Pixi.js API",
"logo": "../logo_small.png",
"description": "The Foo API: a library for doing X, Y, and Z",
"version": "1.2.1",
"url": "http://example.com/",
"version": "0.9",
"url": "http://goodboydigital.com/",
"options": {
"outdir": "../build/apidocs"
"outdir": "../docs"
}
}