RenderTexture update
RenderTexture added (webGL and Canvas) WebGL Render rearchitected - a little faster :) Pivot added to DisplayObject docs updated grunt file updated
This commit is contained in:
parent
ba5a79c606
commit
88b863155a
82 changed files with 14133 additions and 6332 deletions
|
@ -29,12 +29,14 @@ module.exports = function(grunt) {
|
|||
'<%= dirs.src %>/renderers/WebGLShaders.js',
|
||||
'<%= dirs.src %>/renderers/WebGLRenderer.js',
|
||||
'<%= dirs.src %>/renderers/WebGLBatch.js',
|
||||
'<%= dirs.src %>/renderers/WebGLRenderGroup.js',
|
||||
'<%= dirs.src %>/renderers/CanvasRenderer.js',
|
||||
'<%= dirs.src %>/extras/Strip.js',
|
||||
'<%= dirs.src %>/extras/Rope.js',
|
||||
'<%= dirs.src %>/extras/TilingSprite.js',
|
||||
'<%= dirs.src %>/textures/BaseTexture.js',
|
||||
'<%= dirs.src %>/textures/Texture.js',
|
||||
'<%= dirs.src %>/textures/RenderTexture.js',
|
||||
'<%= dirs.src %>/loaders/AssetLoader.js',
|
||||
'<%= dirs.src %>/loaders/SpriteSheetLoader.js',
|
||||
'<%= dirs.src %>/loaders/ImageLoader.js',
|
||||
|
|
1391
bin/pixi.dev.js
1391
bin/pixi.dev.js
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
@ -14,6 +14,7 @@ YUI.add("yuidoc-meta", function(Y) {
|
|||
"MovieClip",
|
||||
"Point",
|
||||
"Rectangle",
|
||||
"RenderTexture",
|
||||
"Sprite",
|
||||
"SpriteSheetLoader",
|
||||
"Stage",
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -373,7 +375,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_textures_BaseTexture.js.html#l102"><code>src/pixi/textures/BaseTexture.js:102</code></a>
|
||||
<a href="../files/src_pixi_textures_BaseTexture.js.html#l103"><code>src/pixi/textures/BaseTexture.js:103</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -490,6 +492,13 @@ http://www.bmglyph.com/ for mac.</p>
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property inherited">
|
||||
<a href="#property_pivot">pivot</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property inherited">
|
||||
|
@ -670,7 +679,7 @@ http://www.bmglyph.com/ for mac.</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l51"><code>src/pixi/DisplayObjectContainer.js:51</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l61"><code>src/pixi/DisplayObjectContainer.js:61</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -769,7 +778,7 @@ http://www.bmglyph.com/ for mac.</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l97"><code>src/pixi/DisplayObject.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l104"><code>src/pixi/DisplayObject.js:104</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -853,7 +862,7 @@ http://www.bmglyph.com/ for mac.</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l137"><code>src/pixi/DisplayObjectContainer.js:137</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l153"><code>src/pixi/DisplayObjectContainer.js:153</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -937,7 +946,7 @@ http://www.bmglyph.com/ for mac.</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l103"><code>src/pixi/DisplayObject.js:103</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l110"><code>src/pixi/DisplayObject.js:110</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1021,7 +1030,7 @@ http://www.bmglyph.com/ for mac.</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l129"><code>src/pixi/DisplayObject.js:129</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l136"><code>src/pixi/DisplayObject.js:136</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1105,7 +1114,7 @@ http://www.bmglyph.com/ for mac.</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l130"><code>src/pixi/DisplayObject.js:130</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1189,7 +1198,7 @@ http://www.bmglyph.com/ for mac.</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l109"><code>src/pixi/DisplayObject.js:109</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1274,7 +1283,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1359,7 +1368,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l155"><code>src/pixi/DisplayObjectContainer.js:155</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l171"><code>src/pixi/DisplayObjectContainer.js:171</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1443,7 +1452,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l170"><code>src/pixi/DisplayObject.js:170</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l177"><code>src/pixi/DisplayObject.js:177</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1652,7 +1661,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l113"><code>src/pixi/DisplayObjectContainer.js:113</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1751,7 +1760,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l140"><code>src/pixi/DisplayObject.js:140</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1836,7 +1845,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l153"><code>src/pixi/DisplayObject.js:153</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l160"><code>src/pixi/DisplayObject.js:160</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1920,7 +1929,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l159"><code>src/pixi/DisplayObject.js:159</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l166"><code>src/pixi/DisplayObject.js:166</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2005,7 +2014,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l154"><code>src/pixi/DisplayObject.js:154</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2078,7 +2087,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2119,7 +2128,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l86"><code>src/pixi/DisplayObject.js:86</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l93"><code>src/pixi/DisplayObject.js:93</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2201,7 +2210,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l69"><code>src/pixi/DisplayObject.js:69</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2243,7 +2252,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l48"><code>src/pixi/DisplayObject.js:48</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2261,6 +2270,47 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="property_pivot" class="property item inherited">
|
||||
<h3 class="name"><code>pivot</code></h3>
|
||||
<span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/DisplayObject.html#property_pivot">DisplayObject</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>The pivot point of the displayObject that it rotates around</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -2325,7 +2375,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2407,7 +2457,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2448,7 +2498,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l47"><code>src/pixi/DisplayObject.js:47</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -356,6 +358,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property">
|
||||
<a href="#property_pivot">pivot</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property">
|
||||
|
@ -602,7 +611,7 @@ WebGL is the preferred renderer as it is a lot fastest. If webGL is not supporte
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l97"><code>src/pixi/DisplayObject.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l104"><code>src/pixi/DisplayObject.js:104</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -689,7 +698,7 @@ WebGL is the preferred renderer as it is a lot fastest. If webGL is not supporte
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l103"><code>src/pixi/DisplayObject.js:103</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l110"><code>src/pixi/DisplayObject.js:110</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -776,7 +785,7 @@ WebGL is the preferred renderer as it is a lot fastest. If webGL is not supporte
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l129"><code>src/pixi/DisplayObject.js:129</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l136"><code>src/pixi/DisplayObject.js:136</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -863,7 +872,7 @@ WebGL is the preferred renderer as it is a lot fastest. If webGL is not supporte
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l130"><code>src/pixi/DisplayObject.js:130</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -950,7 +959,7 @@ WebGL is the preferred renderer as it is a lot fastest. If webGL is not supporte
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l109"><code>src/pixi/DisplayObject.js:109</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1038,7 +1047,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1126,7 +1135,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l170"><code>src/pixi/DisplayObject.js:170</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l177"><code>src/pixi/DisplayObject.js:177</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1213,7 +1222,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l140"><code>src/pixi/DisplayObject.js:140</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1301,7 +1310,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l153"><code>src/pixi/DisplayObject.js:153</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l160"><code>src/pixi/DisplayObject.js:160</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1388,7 +1397,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l159"><code>src/pixi/DisplayObject.js:159</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l166"><code>src/pixi/DisplayObject.js:166</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1476,7 +1485,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l154"><code>src/pixi/DisplayObject.js:154</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1552,7 +1561,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1596,7 +1605,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l86"><code>src/pixi/DisplayObject.js:86</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l93"><code>src/pixi/DisplayObject.js:93</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1640,7 +1649,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l69"><code>src/pixi/DisplayObject.js:69</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1685,7 +1694,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l48"><code>src/pixi/DisplayObject.js:48</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1703,6 +1712,50 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="property_pivot" class="property item">
|
||||
<h3 class="name"><code>pivot</code></h3>
|
||||
<span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
Defined in
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>The pivot point of the displayObject that it rotates around</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -1773,7 +1826,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1861,7 +1914,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1905,7 +1958,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l47"><code>src/pixi/DisplayObject.js:47</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -393,6 +395,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property inherited">
|
||||
<a href="#property_pivot">pivot</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property inherited">
|
||||
|
@ -579,7 +588,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l51"><code>src/pixi/DisplayObjectContainer.js:51</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l61"><code>src/pixi/DisplayObjectContainer.js:61</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -678,7 +687,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l97"><code>src/pixi/DisplayObject.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l104"><code>src/pixi/DisplayObject.js:104</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -765,7 +774,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l137"><code>src/pixi/DisplayObjectContainer.js:137</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l153"><code>src/pixi/DisplayObjectContainer.js:153</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -849,7 +858,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l103"><code>src/pixi/DisplayObject.js:103</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l110"><code>src/pixi/DisplayObject.js:110</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -933,7 +942,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l129"><code>src/pixi/DisplayObject.js:129</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l136"><code>src/pixi/DisplayObject.js:136</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1017,7 +1026,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l130"><code>src/pixi/DisplayObject.js:130</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1101,7 +1110,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l109"><code>src/pixi/DisplayObject.js:109</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1186,7 +1195,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1274,7 +1283,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l155"><code>src/pixi/DisplayObjectContainer.js:155</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l171"><code>src/pixi/DisplayObjectContainer.js:171</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1358,7 +1367,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l170"><code>src/pixi/DisplayObject.js:170</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l177"><code>src/pixi/DisplayObject.js:177</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1451,7 +1460,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l113"><code>src/pixi/DisplayObjectContainer.js:113</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1550,7 +1559,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l140"><code>src/pixi/DisplayObject.js:140</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1635,7 +1644,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l153"><code>src/pixi/DisplayObject.js:153</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l160"><code>src/pixi/DisplayObject.js:160</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1719,7 +1728,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l159"><code>src/pixi/DisplayObject.js:159</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l166"><code>src/pixi/DisplayObject.js:166</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1804,7 +1813,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l154"><code>src/pixi/DisplayObject.js:154</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1877,7 +1886,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1918,7 +1927,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l86"><code>src/pixi/DisplayObject.js:86</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l93"><code>src/pixi/DisplayObject.js:93</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2003,7 +2012,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l69"><code>src/pixi/DisplayObject.js:69</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2045,7 +2054,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l48"><code>src/pixi/DisplayObject.js:48</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2063,6 +2072,47 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="property_pivot" class="property item inherited">
|
||||
<h3 class="name"><code>pivot</code></h3>
|
||||
<span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/DisplayObject.html#property_pivot">DisplayObject</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>The pivot point of the displayObject that it rotates around</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -2127,7 +2177,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2209,7 +2259,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2250,7 +2300,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l47"><code>src/pixi/DisplayObject.js:47</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -132,7 +134,7 @@
|
|||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/src_pixi_InteractionManager.js.html#l513"><code>src/pixi/InteractionManager.js:513</code></a>
|
||||
Defined in: <a href="../files/src_pixi_InteractionManager.js.html#l515"><code>src/pixi/InteractionManager.js:515</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -186,7 +188,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_InteractionManager.js.html#l513"><code>src/pixi/InteractionManager.js:513</code></a>
|
||||
<a href="../files/src_pixi_InteractionManager.js.html#l515"><code>src/pixi/InteractionManager.js:515</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -325,7 +327,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_InteractionManager.js.html#l537"><code>src/pixi/InteractionManager.js:537</code></a>
|
||||
<a href="../files/src_pixi_InteractionManager.js.html#l539"><code>src/pixi/InteractionManager.js:539</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -414,7 +416,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_InteractionManager.js.html#l519"><code>src/pixi/InteractionManager.js:519</code></a>
|
||||
<a href="../files/src_pixi_InteractionManager.js.html#l521"><code>src/pixi/InteractionManager.js:521</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -458,7 +460,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_InteractionManager.js.html#l529"><code>src/pixi/InteractionManager.js:529</code></a>
|
||||
<a href="../files/src_pixi_InteractionManager.js.html#l531"><code>src/pixi/InteractionManager.js:531</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -148,7 +150,7 @@
|
|||
|
||||
|
||||
<div class="box intro">
|
||||
<p>The interaction manager deals with mouse and touch events. At this moment only Sprite's can be interactive.
|
||||
<p>The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive
|
||||
This manager also supports multitouch.</p>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -510,6 +512,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property inherited">
|
||||
<a href="#property_pivot">pivot</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property">
|
||||
|
@ -718,7 +727,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l51"><code>src/pixi/DisplayObjectContainer.js:51</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l61"><code>src/pixi/DisplayObjectContainer.js:61</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -817,7 +826,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l97"><code>src/pixi/DisplayObject.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l104"><code>src/pixi/DisplayObject.js:104</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -901,7 +910,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l137"><code>src/pixi/DisplayObjectContainer.js:137</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l153"><code>src/pixi/DisplayObjectContainer.js:153</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1159,7 +1168,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l103"><code>src/pixi/DisplayObject.js:103</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l110"><code>src/pixi/DisplayObject.js:110</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1243,7 +1252,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l129"><code>src/pixi/DisplayObject.js:129</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l136"><code>src/pixi/DisplayObject.js:136</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1327,7 +1336,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l130"><code>src/pixi/DisplayObject.js:130</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1411,7 +1420,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l109"><code>src/pixi/DisplayObject.js:109</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1496,7 +1505,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1635,7 +1644,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l155"><code>src/pixi/DisplayObjectContainer.js:155</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l171"><code>src/pixi/DisplayObjectContainer.js:171</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1719,7 +1728,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l170"><code>src/pixi/DisplayObject.js:170</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l177"><code>src/pixi/DisplayObject.js:177</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1947,7 +1956,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l113"><code>src/pixi/DisplayObjectContainer.js:113</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2046,7 +2055,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l140"><code>src/pixi/DisplayObject.js:140</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2131,7 +2140,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l153"><code>src/pixi/DisplayObject.js:153</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l160"><code>src/pixi/DisplayObject.js:160</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2215,7 +2224,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l159"><code>src/pixi/DisplayObject.js:159</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l166"><code>src/pixi/DisplayObject.js:166</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2300,7 +2309,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l154"><code>src/pixi/DisplayObject.js:154</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2373,7 +2382,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2544,7 +2553,7 @@ currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l86"><code>src/pixi/DisplayObject.js:86</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l93"><code>src/pixi/DisplayObject.js:93</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2711,7 +2720,7 @@ currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l69"><code>src/pixi/DisplayObject.js:69</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2841,7 +2850,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l48"><code>src/pixi/DisplayObject.js:48</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2859,6 +2868,47 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="property_pivot" class="property item inherited">
|
||||
<h3 class="name"><code>pivot</code></h3>
|
||||
<span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/DisplayObject.html#property_pivot">DisplayObject</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>The pivot point of the displayObject that it rotates around</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -2967,7 +3017,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -3049,7 +3099,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -3175,7 +3225,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l47"><code>src/pixi/DisplayObject.js:47</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
762
docs/classes/RenderTexture.html
Normal file
762
docs/classes/RenderTexture.html
Normal file
|
@ -0,0 +1,762 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>RenderTexture - Pixi.JS</title>
|
||||
<link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0/build/cssgrids/cssgrids-min.css">
|
||||
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
||||
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
||||
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
|
||||
<script src="http://yui.yahooapis.com/combo?3.8.0/build/yui/yui-min.js"></script>
|
||||
</head>
|
||||
<body class="yui3-skin-sam">
|
||||
|
||||
<div id="doc">
|
||||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.JS"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 1.0.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
||||
<div class="yui3-u-1-4">
|
||||
<div id="docs-sidebar" class="sidebar apidocs">
|
||||
<div id="api-list">
|
||||
<h2 class="off-left">APIs</h2>
|
||||
<div id="api-tabview" class="tabview">
|
||||
<ul class="tabs">
|
||||
<li><a href="#api-classes">Classes</a></li>
|
||||
<li><a href="#api-modules">Modules</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="api-tabview-filter">
|
||||
<input type="search" id="api-filter" placeholder="Type to filter APIs">
|
||||
</div>
|
||||
|
||||
<div id="api-tabview-panel">
|
||||
<ul id="api-classes" class="apis classes">
|
||||
|
||||
<li><a href="../classes/AssetLoader.html">AssetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/Stage.html">Stage</a></li>
|
||||
|
||||
<li><a href="../classes/Text.html">Text</a></li>
|
||||
|
||||
<li><a href="../classes/Texture.html">Texture</a></li>
|
||||
|
||||
<li><a href="../classes/TilingSprite.html">TilingSprite</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLBatch.html">WebGLBatch</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLRenderer.html">WebGLRenderer</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<ul id="api-modules" class="apis modules">
|
||||
|
||||
<li><a href="../modules/PIXI.html">PIXI</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="yui3-u-3-4">
|
||||
<div id="api-options">
|
||||
Show:
|
||||
<label for="api-show-inherited">
|
||||
<input type="checkbox" id="api-show-inherited" checked>
|
||||
Inherited
|
||||
</label>
|
||||
|
||||
<label for="api-show-protected">
|
||||
<input type="checkbox" id="api-show-protected">
|
||||
Protected
|
||||
</label>
|
||||
|
||||
<label for="api-show-private">
|
||||
<input type="checkbox" id="api-show-private">
|
||||
Private
|
||||
</label>
|
||||
<label for="api-show-deprecated">
|
||||
<input type="checkbox" id="api-show-deprecated">
|
||||
Deprecated
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="apidocs">
|
||||
<div id="docs-main">
|
||||
<div class="content">
|
||||
<h1>RenderTexture Class</h1>
|
||||
<div class="box meta">
|
||||
|
||||
|
||||
|
||||
<div class="extends">
|
||||
Extends <a href="../classes/Texture.html" class="crosslink">Texture</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/src_pixi_textures_RenderTexture.js.html#l5"><code>src/pixi/textures/RenderTexture.js:5</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
Module: <a href="../modules/PIXI.html">PIXI</a>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="box intro">
|
||||
<p>A RenderTexture is a special texture that allows any pixi displayObject to be rendered to it.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="constructor">
|
||||
<h2>Constructor</h2>
|
||||
<div id="method_RenderTexture" class="method item">
|
||||
<h3 class="name"><code>RenderTexture</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="../files/src_pixi_textures_RenderTexture.js.html#l5"><code>src/pixi/textures/RenderTexture.js:5</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">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">height</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="classdocs" class="tabview">
|
||||
<ul class="api-class-tabs">
|
||||
<li class="api-class-tab index"><a href="#index">Index</a></li>
|
||||
|
||||
|
||||
<li class="api-class-tab methods"><a href="#methods">Methods</a></li>
|
||||
|
||||
|
||||
<li class="api-class-tab properties"><a href="#properties">Properties</a></li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div>
|
||||
<div id="index" class="api-class-tabpanel index">
|
||||
<h2 class="off-left">Item Index</h2>
|
||||
|
||||
|
||||
<div class="index-section methods">
|
||||
<h3>Methods</h3>
|
||||
|
||||
<ul class="index-list methods extends">
|
||||
|
||||
<li class="index-item method inherited">
|
||||
<a href="#method_fromFrame">fromFrame</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method">
|
||||
<a href="#method_render">render</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item method inherited">
|
||||
<a href="#method_setFrame">setFrame</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="index-section properties">
|
||||
<h3>Properties</h3>
|
||||
|
||||
<ul class="index-list properties extends">
|
||||
|
||||
<li class="index-item property inherited">
|
||||
<a href="#property_baseTexture">baseTexture</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property inherited">
|
||||
<a href="#property_frame">frame</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="methods" class="api-class-tabpanel">
|
||||
<h2 class="off-left">Methods</h2>
|
||||
|
||||
|
||||
<div id="method_fromFrame" class="method item inherited">
|
||||
<h3 class="name"><code>fromFrame</code></h3>
|
||||
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>frameId</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<span class="returns-inline">
|
||||
<span class="type"></span>
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/Texture.html#method_fromFrame">Texture</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_textures_Texture.js.html#l127"><code>src/pixi/textures/Texture.js:127</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>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</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">frameId</code>
|
||||
<span class="type">String</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>The frame id of the texture</p>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="returns">
|
||||
<h4>Returns:</h4>
|
||||
|
||||
<div class="returns-description">
|
||||
|
||||
|
||||
Texture
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="method_render" class="method item">
|
||||
<h3 class="name"><code>render</code></h3>
|
||||
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>displayObject</code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>clear</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
Defined in
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_textures_RenderTexture.js.html#l90"><code>src/pixi/textures/RenderTexture.js:90</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>This function will draw the display object to the texture.</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">displayObject</code>
|
||||
<span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">clear</code>
|
||||
<span class="type">Boolean</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>If true the texture will not be cleared before the displayObject is drawn</p>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="method_setFrame" class="method item inherited">
|
||||
<h3 class="name"><code>setFrame</code></h3>
|
||||
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>frame</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/Texture.html#method_setFrame">Texture</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_textures_Texture.js.html#l83"><code>src/pixi/textures/Texture.js:83</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Specifies the rectangle region of the baseTexture</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">frame</code>
|
||||
<span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="properties" class="api-class-tabpanel">
|
||||
<h2 class="off-left">Properties</h2>
|
||||
|
||||
|
||||
<div id="property_baseTexture" class="property item inherited">
|
||||
<h3 class="name"><code>baseTexture</code></h3>
|
||||
<span class="type"><a href="../classes/BaseTexture.html" class="crosslink">BaseTexture</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/Texture.html#property_baseTexture">Texture</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_textures_Texture.js.html#l31"><code>src/pixi/textures/Texture.js:31</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>The base texture of this texture</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="property_frame" class="property item inherited">
|
||||
<h3 class="name"><code>frame</code></h3>
|
||||
<span class="type">#Rectangle</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/Texture.html#property_frame">Texture</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_textures_Texture.js.html#l40"><code>src/pixi/textures/Texture.js:40</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>The frame specifies the region of the base texture that this texture uses</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../assets/vendor/prettify/prettify-min.js"></script>
|
||||
<script>prettyPrint();</script>
|
||||
<script src="../assets/js/yui-prettify.js"></script>
|
||||
<script src="../assets/../api.js"></script>
|
||||
<script src="../assets/js/api-filter.js"></script>
|
||||
<script src="../assets/js/api-list.js"></script>
|
||||
<script src="../assets/js/api-search.js"></script>
|
||||
<script src="../assets/js/apidocs.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -472,6 +474,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property inherited">
|
||||
<a href="#property_pivot">pivot</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property inherited">
|
||||
|
@ -666,7 +675,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l51"><code>src/pixi/DisplayObjectContainer.js:51</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l61"><code>src/pixi/DisplayObjectContainer.js:61</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -765,7 +774,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l97"><code>src/pixi/DisplayObject.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l104"><code>src/pixi/DisplayObject.js:104</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1063,7 +1072,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l137"><code>src/pixi/DisplayObjectContainer.js:137</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l153"><code>src/pixi/DisplayObjectContainer.js:153</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1147,7 +1156,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l103"><code>src/pixi/DisplayObject.js:103</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l110"><code>src/pixi/DisplayObject.js:110</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1231,7 +1240,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l129"><code>src/pixi/DisplayObject.js:129</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l136"><code>src/pixi/DisplayObject.js:136</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1315,7 +1324,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l130"><code>src/pixi/DisplayObject.js:130</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1399,7 +1408,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l109"><code>src/pixi/DisplayObject.js:109</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1484,7 +1493,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1569,7 +1578,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l155"><code>src/pixi/DisplayObjectContainer.js:155</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l171"><code>src/pixi/DisplayObjectContainer.js:171</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1653,7 +1662,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l170"><code>src/pixi/DisplayObject.js:170</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l177"><code>src/pixi/DisplayObject.js:177</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1830,7 +1839,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l113"><code>src/pixi/DisplayObjectContainer.js:113</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1929,7 +1938,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l140"><code>src/pixi/DisplayObject.js:140</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2014,7 +2023,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l153"><code>src/pixi/DisplayObject.js:153</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l160"><code>src/pixi/DisplayObject.js:160</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2098,7 +2107,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l159"><code>src/pixi/DisplayObject.js:159</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l166"><code>src/pixi/DisplayObject.js:166</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2183,7 +2192,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l154"><code>src/pixi/DisplayObject.js:154</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2256,7 +2265,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2389,7 +2398,7 @@ currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l86"><code>src/pixi/DisplayObject.js:86</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l93"><code>src/pixi/DisplayObject.js:93</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2515,7 +2524,7 @@ currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l69"><code>src/pixi/DisplayObject.js:69</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2557,7 +2566,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l48"><code>src/pixi/DisplayObject.js:48</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2575,6 +2584,47 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="property_pivot" class="property item inherited">
|
||||
<h3 class="name"><code>pivot</code></h3>
|
||||
<span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/DisplayObject.html#property_pivot">DisplayObject</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>The pivot point of the displayObject that it rotates around</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -2639,7 +2689,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2721,7 +2771,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2806,7 +2856,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l47"><code>src/pixi/DisplayObject.js:47</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -468,6 +470,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property inherited">
|
||||
<a href="#property_pivot">pivot</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property inherited">
|
||||
|
@ -648,7 +657,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l51"><code>src/pixi/DisplayObjectContainer.js:51</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l61"><code>src/pixi/DisplayObjectContainer.js:61</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -747,7 +756,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l97"><code>src/pixi/DisplayObject.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l104"><code>src/pixi/DisplayObject.js:104</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -831,7 +840,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l137"><code>src/pixi/DisplayObjectContainer.js:137</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l153"><code>src/pixi/DisplayObjectContainer.js:153</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -912,7 +921,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_Stage.js.html#l71"><code>src/pixi/Stage.js:71</code></a>
|
||||
<a href="../files/src_pixi_Stage.js.html#l72"><code>src/pixi/Stage.js:72</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -986,7 +995,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l103"><code>src/pixi/DisplayObject.js:103</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l110"><code>src/pixi/DisplayObject.js:110</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1070,7 +1079,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l129"><code>src/pixi/DisplayObject.js:129</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l136"><code>src/pixi/DisplayObject.js:136</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1154,7 +1163,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l130"><code>src/pixi/DisplayObject.js:130</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1238,7 +1247,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l109"><code>src/pixi/DisplayObject.js:109</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1323,7 +1332,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1408,7 +1417,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l155"><code>src/pixi/DisplayObjectContainer.js:155</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l171"><code>src/pixi/DisplayObjectContainer.js:171</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1495,7 +1504,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_Stage.js.html#l60"><code>src/pixi/Stage.js:60</code></a>
|
||||
<a href="../files/src_pixi_Stage.js.html#l61"><code>src/pixi/Stage.js:61</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1579,7 +1588,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l170"><code>src/pixi/DisplayObject.js:170</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l177"><code>src/pixi/DisplayObject.js:177</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1669,7 +1678,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l113"><code>src/pixi/DisplayObjectContainer.js:113</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1768,7 +1777,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l140"><code>src/pixi/DisplayObject.js:140</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1853,7 +1862,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l153"><code>src/pixi/DisplayObject.js:153</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l160"><code>src/pixi/DisplayObject.js:160</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1937,7 +1946,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l159"><code>src/pixi/DisplayObject.js:159</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l166"><code>src/pixi/DisplayObject.js:166</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2022,7 +2031,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l154"><code>src/pixi/DisplayObject.js:154</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2099,7 +2108,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_Stage.js.html#l37"><code>src/pixi/Stage.js:37</code></a>
|
||||
<a href="../files/src_pixi_Stage.js.html#l38"><code>src/pixi/Stage.js:38</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2149,7 +2158,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2190,7 +2199,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l86"><code>src/pixi/DisplayObject.js:86</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l93"><code>src/pixi/DisplayObject.js:93</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2272,7 +2281,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l69"><code>src/pixi/DisplayObject.js:69</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2314,7 +2323,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l48"><code>src/pixi/DisplayObject.js:48</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2332,6 +2341,47 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="property_pivot" class="property item inherited">
|
||||
<h3 class="name"><code>pivot</code></h3>
|
||||
<span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/DisplayObject.html#property_pivot">DisplayObject</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>The pivot point of the displayObject that it rotates around</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -2396,7 +2446,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2478,7 +2528,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2519,7 +2569,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l47"><code>src/pixi/DisplayObject.js:47</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -557,6 +559,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property inherited">
|
||||
<a href="#property_pivot">pivot</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property inherited">
|
||||
|
@ -751,7 +760,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l51"><code>src/pixi/DisplayObjectContainer.js:51</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l61"><code>src/pixi/DisplayObjectContainer.js:61</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -850,7 +859,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l97"><code>src/pixi/DisplayObject.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l104"><code>src/pixi/DisplayObject.js:104</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -934,7 +943,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l137"><code>src/pixi/DisplayObjectContainer.js:137</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l153"><code>src/pixi/DisplayObjectContainer.js:153</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1018,7 +1027,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l103"><code>src/pixi/DisplayObject.js:103</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l110"><code>src/pixi/DisplayObject.js:110</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1102,7 +1111,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l129"><code>src/pixi/DisplayObject.js:129</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l136"><code>src/pixi/DisplayObject.js:136</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1186,7 +1195,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l130"><code>src/pixi/DisplayObject.js:130</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1270,7 +1279,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l109"><code>src/pixi/DisplayObject.js:109</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1355,7 +1364,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1440,7 +1449,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l155"><code>src/pixi/DisplayObjectContainer.js:155</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l171"><code>src/pixi/DisplayObjectContainer.js:171</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1524,7 +1533,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l170"><code>src/pixi/DisplayObject.js:170</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l177"><code>src/pixi/DisplayObject.js:177</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1867,7 +1876,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l113"><code>src/pixi/DisplayObjectContainer.js:113</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1966,7 +1975,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l140"><code>src/pixi/DisplayObject.js:140</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2051,7 +2060,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l153"><code>src/pixi/DisplayObject.js:153</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l160"><code>src/pixi/DisplayObject.js:160</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2135,7 +2144,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l159"><code>src/pixi/DisplayObject.js:159</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l166"><code>src/pixi/DisplayObject.js:166</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2220,7 +2229,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l154"><code>src/pixi/DisplayObject.js:154</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2293,7 +2302,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2420,7 +2429,7 @@ currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l86"><code>src/pixi/DisplayObject.js:86</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l93"><code>src/pixi/DisplayObject.js:93</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2543,7 +2552,7 @@ currently supports PIXI.blendModes.NORMAL and PIXI.blendModes.SCREEN</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l69"><code>src/pixi/DisplayObject.js:69</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2585,7 +2594,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l48"><code>src/pixi/DisplayObject.js:48</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2603,6 +2612,47 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="property_pivot" class="property item inherited">
|
||||
<h3 class="name"><code>pivot</code></h3>
|
||||
<span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/DisplayObject.html#property_pivot">DisplayObject</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>The pivot point of the displayObject that it rotates around</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -2667,7 +2717,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2749,7 +2799,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2831,7 +2881,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l47"><code>src/pixi/DisplayObject.js:47</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -296,6 +298,8 @@
|
|||
<a href="#method_addTextureToCache">addTextureToCache</a>
|
||||
|
||||
|
||||
<span class="flag static">static</span>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
@ -328,6 +332,8 @@
|
|||
<a href="#method_removeTextureFromCache">removeTextureFromCache</a>
|
||||
|
||||
|
||||
<span class="flag static">static</span>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
@ -408,6 +414,8 @@
|
|||
|
||||
|
||||
|
||||
<span class="flag static">static</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -827,6 +835,8 @@
|
|||
|
||||
|
||||
|
||||
<span class="flag static">static</span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -843,7 +853,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_textures_Texture.js.html#l170"><code>src/pixi/textures/Texture.js:170</code></a>
|
||||
<a href="../files/src_pixi_textures_Texture.js.html#l171"><code>src/pixi/textures/Texture.js:171</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -972,7 +982,7 @@
|
|||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -468,6 +470,13 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property inherited">
|
||||
<a href="#property_pivot">pivot</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="index-item property inherited">
|
||||
|
@ -662,7 +671,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l51"><code>src/pixi/DisplayObjectContainer.js:51</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l61"><code>src/pixi/DisplayObjectContainer.js:61</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -761,7 +770,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l97"><code>src/pixi/DisplayObject.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l104"><code>src/pixi/DisplayObject.js:104</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -845,7 +854,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l137"><code>src/pixi/DisplayObjectContainer.js:137</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l153"><code>src/pixi/DisplayObjectContainer.js:153</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -929,7 +938,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l103"><code>src/pixi/DisplayObject.js:103</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l110"><code>src/pixi/DisplayObject.js:110</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1013,7 +1022,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l129"><code>src/pixi/DisplayObject.js:129</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l136"><code>src/pixi/DisplayObject.js:136</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1097,7 +1106,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l130"><code>src/pixi/DisplayObject.js:130</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1181,7 +1190,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l109"><code>src/pixi/DisplayObject.js:109</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1266,7 +1275,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l116"><code>src/pixi/DisplayObject.js:116</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l123"><code>src/pixi/DisplayObject.js:123</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1351,7 +1360,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l155"><code>src/pixi/DisplayObjectContainer.js:155</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l171"><code>src/pixi/DisplayObjectContainer.js:171</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1435,7 +1444,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l170"><code>src/pixi/DisplayObject.js:170</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l177"><code>src/pixi/DisplayObject.js:177</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1525,7 +1534,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l97"><code>src/pixi/DisplayObjectContainer.js:97</code></a>
|
||||
<a href="../files/src_pixi_DisplayObjectContainer.js.html#l113"><code>src/pixi/DisplayObjectContainer.js:113</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1624,7 +1633,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l140"><code>src/pixi/DisplayObject.js:140</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1709,7 +1718,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l153"><code>src/pixi/DisplayObject.js:153</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l160"><code>src/pixi/DisplayObject.js:160</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1793,7 +1802,7 @@ basically a touch version of click</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l159"><code>src/pixi/DisplayObject.js:159</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l166"><code>src/pixi/DisplayObject.js:166</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1878,7 +1887,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l147"><code>src/pixi/DisplayObject.js:147</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l154"><code>src/pixi/DisplayObject.js:154</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1951,7 +1960,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1992,7 +2001,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l86"><code>src/pixi/DisplayObject.js:86</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l93"><code>src/pixi/DisplayObject.js:93</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2074,7 +2083,7 @@ for this callback to be fired, The touch must have started over the sprite</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l69"><code>src/pixi/DisplayObject.js:69</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2116,7 +2125,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l48"><code>src/pixi/DisplayObject.js:48</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2134,6 +2143,47 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="property_pivot" class="property item inherited">
|
||||
<h3 class="name"><code>pivot</code></h3>
|
||||
<span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
<p>Inherited from
|
||||
<a href="../classes/DisplayObject.html#property_pivot">DisplayObject</a>:
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>The pivot point of the displayObject that it rotates around</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -2198,7 +2248,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l26"><code>src/pixi/DisplayObject.js:26</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l33"><code>src/pixi/DisplayObject.js:33</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2280,7 +2330,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l55"><code>src/pixi/DisplayObject.js:55</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l62"><code>src/pixi/DisplayObject.js:62</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -2409,7 +2459,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l40"><code>src/pixi/DisplayObject.js:40</code></a>
|
||||
<a href="../files/src_pixi_DisplayObject.js.html#l47"><code>src/pixi/DisplayObject.js:47</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -132,7 +134,7 @@
|
|||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/src_pixi_renderers_WebGLBatch.js.html#l42"><code>src/pixi/renderers/WebGLBatch.js:42</code></a>
|
||||
Defined in: <a href="../files/src_pixi_renderers_WebGLRenderGroup.js.html#l8"><code>src/pixi/renderers/WebGLRenderGroup.js:8</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -818,7 +820,7 @@ if a group of sprites all have the same baseTexture and blendMode then they can
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_renderers_WebGLBatch.js.html#l491"><code>src/pixi/renderers/WebGLBatch.js:491</code></a>
|
||||
<a href="../files/src_pixi_renderers_WebGLBatch.js.html#l513"><code>src/pixi/renderers/WebGLBatch.js:513</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -132,7 +134,7 @@
|
|||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/src_pixi_renderers_WebGLRenderer.js.html#l7"><code>src/pixi/renderers/WebGLRenderer.js:7</code></a>
|
||||
Defined in: <a href="../files/src_pixi_renderers_WebGLRenderer.js.html#l11"><code>src/pixi/renderers/WebGLRenderer.js:11</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -215,7 +217,7 @@ Dont forget to add the view to your DOM or you will not see anything :)</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_renderers_WebGLRenderer.js.html#l7"><code>src/pixi/renderers/WebGLRenderer.js:7</code></a>
|
||||
<a href="../files/src_pixi_renderers_WebGLRenderer.js.html#l11"><code>src/pixi/renderers/WebGLRenderer.js:11</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -401,7 +403,7 @@ Dont forget to add the view to your DOM or you will not see anything :)</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_renderers_WebGLRenderer.js.html#l187"><code>src/pixi/renderers/WebGLRenderer.js:187</code></a>
|
||||
<a href="../files/src_pixi_renderers_WebGLRenderer.js.html#l147"><code>src/pixi/renderers/WebGLRenderer.js:147</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -494,7 +496,7 @@ Dont forget to add the view to your DOM or you will not see anything :)</p>
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_renderers_WebGLRenderer.js.html#l617"><code>src/pixi/renderers/WebGLRenderer.js:617</code></a>
|
||||
<a href="../files/src_pixi_renderers_WebGLRenderer.js.html#l290"><code>src/pixi/renderers/WebGLRenderer.js:290</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
|
283
docs/data.json
283
docs/data.json
|
@ -78,6 +78,13 @@
|
|||
"src/pixi/renderers/WebGLBatch.js": {
|
||||
"name": "src/pixi/renderers/WebGLBatch.js",
|
||||
"modules": {},
|
||||
"classes": {},
|
||||
"fors": {},
|
||||
"namespaces": {}
|
||||
},
|
||||
"src/pixi/renderers/WebGLRenderGroup.js": {
|
||||
"name": "src/pixi/renderers/WebGLRenderGroup.js",
|
||||
"modules": {},
|
||||
"classes": {
|
||||
"WebGLBatch": 1
|
||||
},
|
||||
|
@ -127,6 +134,15 @@
|
|||
"fors": {},
|
||||
"namespaces": {}
|
||||
},
|
||||
"src/pixi/textures/RenderTexture.js": {
|
||||
"name": "src/pixi/textures/RenderTexture.js",
|
||||
"modules": {},
|
||||
"classes": {
|
||||
"RenderTexture": 1
|
||||
},
|
||||
"fors": {},
|
||||
"namespaces": {}
|
||||
},
|
||||
"src/pixi/textures/Texture.js": {
|
||||
"name": "src/pixi/textures/Texture.js",
|
||||
"modules": {},
|
||||
|
@ -270,6 +286,7 @@
|
|||
"BitmapText": 1,
|
||||
"Text": 1,
|
||||
"BaseTexture": 1,
|
||||
"RenderTexture": 1,
|
||||
"Texture": 1,
|
||||
"DisplayObject": 1,
|
||||
"DisplayObjectContainer": 1,
|
||||
|
@ -470,8 +487,8 @@
|
|||
"plugin_for": [],
|
||||
"extension_for": [],
|
||||
"module": "PIXI",
|
||||
"file": "src/pixi/renderers/WebGLBatch.js",
|
||||
"line": 42,
|
||||
"file": "src/pixi/renderers/WebGLRenderGroup.js",
|
||||
"line": 8,
|
||||
"description": "A WebGLBatch Enables a group of sprites to be drawn using the same settings.\nif a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.",
|
||||
"params": [
|
||||
{
|
||||
|
@ -494,7 +511,7 @@
|
|||
"extension_for": [],
|
||||
"module": "PIXI",
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 7,
|
||||
"line": 11,
|
||||
"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": [
|
||||
|
@ -649,6 +666,33 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"RenderTexture": {
|
||||
"name": "RenderTexture",
|
||||
"shortname": "RenderTexture",
|
||||
"classitems": [],
|
||||
"plugins": [],
|
||||
"extensions": [],
|
||||
"plugin_for": [],
|
||||
"extension_for": [],
|
||||
"module": "PIXI",
|
||||
"file": "src/pixi/textures/RenderTexture.js",
|
||||
"line": 5,
|
||||
"description": "A RenderTexture is a special texture that allows any pixi displayObject to be rendered to it.",
|
||||
"extends": "Texture",
|
||||
"is_constructor": 1,
|
||||
"params": [
|
||||
{
|
||||
"name": "width",
|
||||
"description": "",
|
||||
"type": "Number"
|
||||
},
|
||||
{
|
||||
"name": "height",
|
||||
"description": "",
|
||||
"type": "Number"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Texture": {
|
||||
"name": "Texture",
|
||||
"shortname": "Texture",
|
||||
|
@ -716,7 +760,7 @@
|
|||
"module": "PIXI",
|
||||
"file": "src/pixi/InteractionManager.js",
|
||||
"line": 7,
|
||||
"description": "The interaction manager deals with mouse and touch events. At this moment only Sprite's can be interactive.\nThis manager also supports multitouch.",
|
||||
"description": "The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive\nThis manager also supports multitouch.",
|
||||
"is_constructor": 1,
|
||||
"params": [
|
||||
{
|
||||
|
@ -737,7 +781,7 @@
|
|||
"extension_for": [],
|
||||
"module": "PIXI",
|
||||
"file": "src/pixi/InteractionManager.js",
|
||||
"line": 513,
|
||||
"line": 515,
|
||||
"is_constructor": 1
|
||||
},
|
||||
"MovieClip": {
|
||||
|
@ -1097,7 +1141,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/CanvasRenderer.js",
|
||||
"line": 112,
|
||||
"line": 110,
|
||||
"description": "resizes the canvas view to the specified width and height",
|
||||
"params": [
|
||||
{
|
||||
|
@ -1113,28 +1157,28 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/CanvasRenderer.js",
|
||||
"line": 126,
|
||||
"line": 124,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "CanvasRenderer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/CanvasRenderer.js",
|
||||
"line": 203,
|
||||
"line": 205,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "CanvasRenderer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/CanvasRenderer.js",
|
||||
"line": 238,
|
||||
"line": 240,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "CanvasRenderer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/CanvasRenderer.js",
|
||||
"line": 267,
|
||||
"line": 269,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "CanvasRenderer"
|
||||
|
@ -1301,12 +1345,25 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLBatch.js",
|
||||
"line": 491,
|
||||
"line": 513,
|
||||
"description": "Draws the batch to the frame buffer",
|
||||
"itemtype": "method",
|
||||
"name": "render",
|
||||
"class": "WebGLBatch"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderGroup.js",
|
||||
"line": 1,
|
||||
"author": "Mat Groves http://matgroves.com/ @Doormat23",
|
||||
"class": "WebGLBatch"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderGroup.js",
|
||||
"line": 476,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "WebGLBatch"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 1,
|
||||
|
@ -1315,35 +1372,28 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 73,
|
||||
"line": 82,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "WebGLRenderer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 88,
|
||||
"line": 97,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "WebGLRenderer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 98,
|
||||
"line": 107,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "WebGLRenderer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 137,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "WebGLRenderer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 187,
|
||||
"line": 147,
|
||||
"description": "Renders the stage to its webGL view",
|
||||
"itemtype": "method",
|
||||
"name": "render",
|
||||
|
@ -1358,28 +1408,14 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 284,
|
||||
"line": 234,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "WebGLRenderer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 337,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "WebGLRenderer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 540,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "WebGLRenderer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 617,
|
||||
"line": 290,
|
||||
"description": "resizes the webGL view to the specified width and height",
|
||||
"itemtype": "method",
|
||||
"name": "resize",
|
||||
|
@ -1399,42 +1435,42 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 642,
|
||||
"line": 315,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "WebGLRenderer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 722,
|
||||
"line": 392,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "WebGLRenderer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 762,
|
||||
"line": 429,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "WebGLRenderer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 790,
|
||||
"line": 457,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "WebGLRenderer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 867,
|
||||
"line": 534,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "WebGLRenderer"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/WebGLRenderer.js",
|
||||
"line": 876,
|
||||
"line": 543,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "WebGLRenderer"
|
||||
|
@ -1638,7 +1674,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/textures/BaseTexture.js",
|
||||
"line": 102,
|
||||
"line": 103,
|
||||
"description": "Helper function that returns a base texture based on an image url\n If the image is not in the base texture cache it will be created and loaded",
|
||||
"static": 1,
|
||||
"itemtype": "method",
|
||||
|
@ -1655,6 +1691,32 @@
|
|||
},
|
||||
"class": "BaseTexture"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/textures/RenderTexture.js",
|
||||
"line": 1,
|
||||
"author": "Mat Groves http://matgroves.com/ @Doormat23",
|
||||
"class": "RenderTexture"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/textures/RenderTexture.js",
|
||||
"line": 90,
|
||||
"description": "This function will draw the display object to the texture.",
|
||||
"itemtype": "method",
|
||||
"name": "render",
|
||||
"params": [
|
||||
{
|
||||
"name": "displayObject",
|
||||
"description": "",
|
||||
"type": "DisplayObject"
|
||||
},
|
||||
{
|
||||
"name": "clear",
|
||||
"description": "If true the texture will not be cleared before the displayObject is drawn",
|
||||
"type": "Boolean"
|
||||
}
|
||||
],
|
||||
"class": "RenderTexture"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/textures/Texture.js",
|
||||
"line": 1,
|
||||
|
@ -1754,6 +1816,7 @@
|
|||
"file": "src/pixi/textures/Texture.js",
|
||||
"line": 158,
|
||||
"description": "Adds a texture to the textureCache.",
|
||||
"static": 1,
|
||||
"itemtype": "method",
|
||||
"name": "addTextureToCache",
|
||||
"params": [
|
||||
|
@ -1772,8 +1835,9 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/textures/Texture.js",
|
||||
"line": 170,
|
||||
"line": 171,
|
||||
"description": "Remove a texture from the textureCache.",
|
||||
"static": 1,
|
||||
"itemtype": "method",
|
||||
"name": "removeTextureFromCache",
|
||||
"params": [
|
||||
|
@ -1872,6 +1936,15 @@
|
|||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 26,
|
||||
"description": "The pivot point of the displayObject that it rotates around",
|
||||
"itemtype": "property",
|
||||
"name": "pivot",
|
||||
"type": "Point",
|
||||
"class": "DisplayObject"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 33,
|
||||
"description": "The rotation of the object in radians.",
|
||||
"itemtype": "property",
|
||||
"name": "rotation",
|
||||
|
@ -1880,7 +1953,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 33,
|
||||
"line": 40,
|
||||
"description": "The opacity of the object.",
|
||||
"itemtype": "property",
|
||||
"name": "alpha",
|
||||
|
@ -1889,7 +1962,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 40,
|
||||
"line": 47,
|
||||
"description": "The visibility of the object.",
|
||||
"itemtype": "property",
|
||||
"name": "visible",
|
||||
|
@ -1898,7 +1971,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 48,
|
||||
"line": 55,
|
||||
"description": "[read-only] The display object container that contains this display object.",
|
||||
"itemtype": "property",
|
||||
"name": "parent",
|
||||
|
@ -1907,7 +1980,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 55,
|
||||
"line": 62,
|
||||
"description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.",
|
||||
"itemtype": "property",
|
||||
"name": "stage",
|
||||
|
@ -1916,7 +1989,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 62,
|
||||
"line": 69,
|
||||
"description": "This is the defined area that will pick up mouse / touch events. It is null by default.\nSetting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)",
|
||||
"itemtype": "property",
|
||||
"name": "hitArea",
|
||||
|
@ -1925,7 +1998,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 86,
|
||||
"line": 93,
|
||||
"description": "This is used to indicate if the displayObject should display a mouse hand cursor on rollover",
|
||||
"itemtype": "property",
|
||||
"name": "buttonMode",
|
||||
|
@ -1934,7 +2007,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 97,
|
||||
"line": 104,
|
||||
"description": "A callback that is used when the users clicks on the displayObject with their mouse",
|
||||
"itemtype": "method",
|
||||
"name": "click",
|
||||
|
@ -1949,7 +2022,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 103,
|
||||
"line": 110,
|
||||
"description": "A callback that is used when the user clicks the mouse down over the sprite",
|
||||
"itemtype": "method",
|
||||
"name": "mousedown",
|
||||
|
@ -1964,7 +2037,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 109,
|
||||
"line": 116,
|
||||
"description": "A callback that is used when the user releases the mouse that was over the displayObject\nfor this callback to be fired the mouse must have been pressed down over the displayObject",
|
||||
"itemtype": "method",
|
||||
"name": "mouseup",
|
||||
|
@ -1979,7 +2052,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 116,
|
||||
"line": 123,
|
||||
"description": "A callback that is used when the user releases the mouse that was over the displayObject but is no longer over the displayObject\nfor this callback to be fired, The touch must have started over the displayObject",
|
||||
"itemtype": "method",
|
||||
"name": "mouseupoutside",
|
||||
|
@ -1994,7 +2067,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 123,
|
||||
"line": 130,
|
||||
"description": "A callback that is used when the users mouse rolls over the displayObject",
|
||||
"itemtype": "method",
|
||||
"name": "mouseover",
|
||||
|
@ -2009,7 +2082,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 129,
|
||||
"line": 136,
|
||||
"description": "A callback that is used when the users mouse leaves the displayObject",
|
||||
"itemtype": "method",
|
||||
"name": "mouseout",
|
||||
|
@ -2024,7 +2097,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 140,
|
||||
"line": 147,
|
||||
"description": "A callback that is used when the users taps on the sprite with their finger\nbasically a touch version of click",
|
||||
"itemtype": "method",
|
||||
"name": "tap",
|
||||
|
@ -2039,7 +2112,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 147,
|
||||
"line": 154,
|
||||
"description": "A callback that is used when the user touch's over the displayObject",
|
||||
"itemtype": "method",
|
||||
"name": "touchstart",
|
||||
|
@ -2054,7 +2127,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 153,
|
||||
"line": 160,
|
||||
"description": "A callback that is used when the user releases a touch over the displayObject",
|
||||
"itemtype": "method",
|
||||
"name": "touchend",
|
||||
|
@ -2069,7 +2142,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 159,
|
||||
"line": 166,
|
||||
"description": "A callback that is used when the user releases the touch that was over the displayObject\nfor this callback to be fired, The touch must have started over the sprite",
|
||||
"itemtype": "method",
|
||||
"name": "touchendoutside",
|
||||
|
@ -2084,7 +2157,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 170,
|
||||
"line": 177,
|
||||
"description": "Indicates if the sprite will have touch and mouse interactivity. It is false by default",
|
||||
"itemtype": "method",
|
||||
"name": "setInteractive",
|
||||
|
@ -2099,7 +2172,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObject.js",
|
||||
"line": 184,
|
||||
"line": 191,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "DisplayObject"
|
||||
|
@ -2136,7 +2209,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObjectContainer.js",
|
||||
"line": 51,
|
||||
"line": 61,
|
||||
"description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown",
|
||||
"itemtype": "method",
|
||||
"name": "addChildAt",
|
||||
|
@ -2156,7 +2229,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObjectContainer.js",
|
||||
"line": 97,
|
||||
"line": 113,
|
||||
"description": "Swaps the depth of 2 displayObjects",
|
||||
"itemtype": "method",
|
||||
"name": "swapChildren",
|
||||
|
@ -2176,7 +2249,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObjectContainer.js",
|
||||
"line": 137,
|
||||
"line": 153,
|
||||
"description": "Returns the Child at the specified index",
|
||||
"itemtype": "method",
|
||||
"name": "getChildAt",
|
||||
|
@ -2191,7 +2264,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObjectContainer.js",
|
||||
"line": 155,
|
||||
"line": 171,
|
||||
"description": "Removes a child from the container.",
|
||||
"itemtype": "method",
|
||||
"name": "removeChild",
|
||||
|
@ -2206,7 +2279,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/DisplayObjectContainer.js",
|
||||
"line": 184,
|
||||
"line": 211,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "DisplayObjectContainer"
|
||||
|
@ -2246,7 +2319,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/InteractionManager.js",
|
||||
"line": 519,
|
||||
"line": 521,
|
||||
"description": "This point stores the global coords of where the touch/mouse event happened",
|
||||
"itemtype": "property",
|
||||
"name": "global",
|
||||
|
@ -2255,7 +2328,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/InteractionManager.js",
|
||||
"line": 529,
|
||||
"line": 531,
|
||||
"description": "The target Sprite that was interacted with",
|
||||
"itemtype": "property",
|
||||
"name": "target",
|
||||
|
@ -2264,7 +2337,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/InteractionManager.js",
|
||||
"line": 537,
|
||||
"line": 539,
|
||||
"description": "This will return the local coords of the specified displayObject for this InteractionData",
|
||||
"itemtype": "method",
|
||||
"name": "getLocalPosition",
|
||||
|
@ -2631,7 +2704,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/Stage.js",
|
||||
"line": 37,
|
||||
"line": 38,
|
||||
"itemtype": "method",
|
||||
"name": "updateTransform",
|
||||
"internal": "",
|
||||
|
@ -2640,7 +2713,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/Stage.js",
|
||||
"line": 60,
|
||||
"line": 61,
|
||||
"itemtype": "method",
|
||||
"name": "setBackgroundColor",
|
||||
"params": [
|
||||
|
@ -2655,7 +2728,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/Stage.js",
|
||||
"line": 71,
|
||||
"line": 72,
|
||||
"description": "This will return the point containing global coords of the mouse.",
|
||||
"itemtype": "method",
|
||||
"name": "getMousePosition",
|
||||
|
@ -2682,7 +2755,7 @@
|
|||
},
|
||||
{
|
||||
"message": "unknown tag: internal",
|
||||
"line": " src/pixi/Stage.js:37"
|
||||
"line": " src/pixi/Stage.js:38"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
|
@ -2758,23 +2831,23 @@
|
|||
},
|
||||
{
|
||||
"message": "Missing item type\nresizes the canvas view to the specified width and height",
|
||||
"line": " src/pixi/renderers/CanvasRenderer.js:112"
|
||||
"line": " src/pixi/renderers/CanvasRenderer.js:110"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/CanvasRenderer.js:126"
|
||||
"line": " src/pixi/renderers/CanvasRenderer.js:124"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/CanvasRenderer.js:203"
|
||||
"line": " src/pixi/renderers/CanvasRenderer.js:205"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/CanvasRenderer.js:238"
|
||||
"line": " src/pixi/renderers/CanvasRenderer.js:240"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/CanvasRenderer.js:267"
|
||||
"line": " src/pixi/renderers/CanvasRenderer.js:269"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
|
@ -2800,61 +2873,57 @@
|
|||
"message": "Missing item type\nGrows the size of the batch. As the elements in the batch cannot have a dynamic size this function is used to increase the size of the batch. It also creates a little extra room so that the batch does not need to be resized every time a sprite is added",
|
||||
"line": " src/pixi/renderers/WebGLBatch.js:292"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderGroup.js:1"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderGroup.js:476"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:1"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:73"
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:82"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:88"
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:97"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:98"
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:107"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:137"
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:234"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:284"
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:315"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:337"
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:392"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:540"
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:429"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:642"
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:457"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:722"
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:534"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:762"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:790"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:867"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:876"
|
||||
"line": " src/pixi/renderers/WebGLRenderer.js:543"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
|
@ -2900,6 +2969,10 @@
|
|||
"message": "Missing item type",
|
||||
"line": " src/pixi/textures/BaseTexture.js:1"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/textures/RenderTexture.js:1"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/textures/Texture.js:1"
|
||||
|
@ -2926,7 +2999,7 @@
|
|||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/DisplayObject.js:184"
|
||||
"line": " src/pixi/DisplayObject.js:191"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
|
@ -2934,7 +3007,7 @@
|
|||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/DisplayObjectContainer.js:184"
|
||||
"line": " src/pixi/DisplayObjectContainer.js:211"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -153,6 +155,13 @@ PIXI.DisplayObject = function()
|
|||
*/
|
||||
this.scale = new PIXI.Point(1,1);//{x:1, y:1};
|
||||
|
||||
/**
|
||||
* The pivot point of the displayObject that it rotates around
|
||||
* @property pivot
|
||||
* @type Point
|
||||
*/
|
||||
this.pivot = new PIXI.Point(0,0);
|
||||
|
||||
/**
|
||||
* The rotation of the object in radians.
|
||||
* @property rotation
|
||||
|
@ -173,7 +182,7 @@ PIXI.DisplayObject = function()
|
|||
* @type Boolean
|
||||
*/
|
||||
this.visible = true;
|
||||
this.cacheVisible = false;
|
||||
this.worldVisible = false;
|
||||
|
||||
/**
|
||||
* [read-only] The display object container that contains this display object.
|
||||
|
@ -334,9 +343,16 @@ PIXI.DisplayObject.prototype.updateTransform = function()
|
|||
localTransform[4] = this._cr * this.scale.y;
|
||||
|
||||
///AAARR GETTER SETTTER!
|
||||
localTransform[2] = this.position.x;
|
||||
localTransform[5] = this.position.y;
|
||||
//localTransform[2] = this.position.x;
|
||||
//localTransform[5] = this.position.y;
|
||||
|
||||
var px = this.pivot.x;
|
||||
var py = this.pivot.y;
|
||||
|
||||
///AAARR GETTER SETTTER!
|
||||
localTransform[2] = this.position.x - localTransform[0] * px - py * localTransform[1];
|
||||
localTransform[5] = this.position.y - localTransform[4] * py - px * localTransform[3];
|
||||
|
||||
// Cache the matrix values (makes for huge speed increases!)
|
||||
var a00 = localTransform[0], a01 = localTransform[1], a02 = localTransform[2],
|
||||
a10 = localTransform[3], a11 = localTransform[4], a12 = localTransform[5],
|
||||
|
@ -354,7 +370,9 @@ PIXI.DisplayObject.prototype.updateTransform = function()
|
|||
|
||||
// because we are using affine transformation, we can optimise the matrix concatenation process.. wooo!
|
||||
// mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
|
||||
this.worldAlpha = this.alpha * this.parent.worldAlpha;
|
||||
this.worldAlpha = this.alpha * this.parent.worldAlpha;
|
||||
|
||||
|
||||
}
|
||||
|
||||
</pre>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -165,17 +167,27 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
{
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
child.parent.removeChild(child)
|
||||
child.parent.removeChild(child);
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
child.childIndex = this.children.length;
|
||||
|
||||
this.children.push(child);
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
this.stage.__addChild(child);
|
||||
}
|
||||
|
||||
// need to remove any render groups..
|
||||
if(this.__renderGroup)
|
||||
{
|
||||
// being used by a renderTexture.. if it exists then it must be from a render texture;
|
||||
if(child.__renderGroup)child.__renderGroup.removeDisplayObjectAndChildren(child);
|
||||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -215,6 +227,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
{
|
||||
this.stage.__addChild(child);
|
||||
}
|
||||
|
||||
// little webGL!
|
||||
if(this.__renderGroup)
|
||||
{
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -290,12 +308,23 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
if(this.stage)this.stage.__removeChild(child);
|
||||
if(this.stage)
|
||||
{
|
||||
this.stage.__removeChild(child);
|
||||
}
|
||||
// console.log(child.__renderGroup);
|
||||
if(child.__renderGroup)
|
||||
{
|
||||
// console.log(">?")
|
||||
child.__renderGroup.removeDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
// console.log(">" + child.__renderGroup)
|
||||
child.parent = undefined;
|
||||
//child.childIndex = 0
|
||||
|
||||
this.children.splice( index, 1 );
|
||||
|
||||
// update in dexs!
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -135,7 +137,7 @@
|
|||
|
||||
|
||||
/**
|
||||
The interaction manager deals with mouse and touch events. At this moment only Sprite's can be interactive.
|
||||
The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive
|
||||
This manager also supports multitouch.
|
||||
@class InteractionManager
|
||||
@constructor
|
||||
|
@ -249,6 +251,8 @@ PIXI.InteractionManager.prototype.setTarget = function(target)
|
|||
|
||||
PIXI.InteractionManager.prototype.update = function()
|
||||
{
|
||||
if(!this.target)return;
|
||||
|
||||
// frequency of 30fps??
|
||||
var now = Date.now();
|
||||
var diff = now - this.last;
|
||||
|
@ -280,7 +284,7 @@ PIXI.InteractionManager.prototype.update = function()
|
|||
// loop through interactive objects!
|
||||
var length = this.interactiveItems.length;
|
||||
|
||||
if(this.target)this.target.view.style.cursor = "default";
|
||||
this.target.view.style.cursor = "default";
|
||||
|
||||
for (var i = 0; i < length; i++)
|
||||
{
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -144,7 +146,7 @@ PIXI.Stage = function(backgroundColor, interactive)
|
|||
{
|
||||
|
||||
PIXI.DisplayObjectContainer.call( this );
|
||||
this.worldTransform = PIXI.mat3.create()//.//identity();
|
||||
this.worldTransform = PIXI.mat3.create()
|
||||
this.__childrenAdded = [];
|
||||
this.__childrenRemoved = [];
|
||||
this.childIndex = 0;
|
||||
|
@ -157,6 +159,7 @@ PIXI.Stage = function(backgroundColor, interactive)
|
|||
this.interactionManager = new PIXI.InteractionManager(this);
|
||||
|
||||
this.setBackgroundColor(backgroundColor);
|
||||
this.worldVisible = true;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -229,15 +232,13 @@ PIXI.Stage.prototype.__removeChild = function(child)
|
|||
{
|
||||
if(child.interactive)this.dirty = true;
|
||||
|
||||
this.__childrenRemoved.push(child);
|
||||
|
||||
child.stage = undefined;
|
||||
|
||||
if(child.children)
|
||||
{
|
||||
for(var i=0,j=child.children.length; i<j; i++)
|
||||
{
|
||||
this.__removeChild(child.children[i])
|
||||
this.__removeChild(child.children[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -209,14 +211,12 @@ PIXI.CanvasRenderer.prototype.render = function(stage)
|
|||
PIXI.texturesToUpdate = [];
|
||||
PIXI.texturesToDestroy = [];
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
stage.updateTransform();
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
|
||||
// update the background color
|
||||
if(this.view.style.backgroundColor!=stage.backgroundColorString && !this.transparent)this.view.style.backgroundColor = stage.backgroundColorString;
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
this.context.clearRect(0, 0, this.width, this.height)
|
||||
this.renderDisplayObject(stage);
|
||||
//as
|
||||
|
@ -260,7 +260,7 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
var context = this.context;
|
||||
context.globalCompositeOperation = "source-over"
|
||||
//context.globalCompositeOperation = "source-over"
|
||||
var blit = false;
|
||||
|
||||
if(!displayObject.visible)return;
|
||||
|
@ -297,14 +297,18 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
else
|
||||
{*/
|
||||
blit = false;
|
||||
context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
|
||||
context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]);
|
||||
|
||||
context.drawImage(displayObject.texture.baseTexture.source,
|
||||
frame.x,
|
||||
frame.y,
|
||||
frame.width,
|
||||
frame.height,
|
||||
(displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width,
|
||||
(displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
|
||||
(displayObject.anchor.x) * -frame.width,
|
||||
(displayObject.anchor.y) * -frame.height,
|
||||
// (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width,
|
||||
// (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
|
||||
|
||||
frame.width,
|
||||
frame.height);
|
||||
//}
|
||||
|
@ -327,7 +331,7 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
this.renderDisplayObject(displayObject.children[i]);
|
||||
}
|
||||
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -544,73 +546,95 @@ PIXI.WebGLBatch.prototype.update = function()
|
|||
|
||||
while(displayObject)
|
||||
{
|
||||
width = displayObject.texture.frame.width;
|
||||
height = displayObject.texture.frame.height;
|
||||
|
||||
aX = displayObject.anchor.x - displayObject.texture.trim.x
|
||||
aY = displayObject.anchor.y - displayObject.texture.trim.y
|
||||
w0 = width * (1-aX);
|
||||
w1 = width * -aX;
|
||||
|
||||
h0 = height * (1-aY);
|
||||
h1 = height * -aY;
|
||||
|
||||
index = indexRun * 8;
|
||||
|
||||
worldTransform = displayObject.worldTransform;
|
||||
if(displayObject.worldVisible)
|
||||
{
|
||||
width = displayObject.texture.frame.width;
|
||||
height = displayObject.texture.frame.height;
|
||||
|
||||
// TODO trim??
|
||||
aX = displayObject.anchor.x;// - displayObject.texture.trim.x
|
||||
aY = displayObject.anchor.y; //- displayObject.texture.trim.y
|
||||
w0 = width * (1-aX);
|
||||
w1 = width * -aX;
|
||||
|
||||
h0 = height * (1-aY);
|
||||
h1 = height * -aY;
|
||||
|
||||
index = indexRun * 8;
|
||||
|
||||
a = worldTransform[0];
|
||||
b = worldTransform[3];
|
||||
c = worldTransform[1];
|
||||
d = worldTransform[4];
|
||||
tx = worldTransform[2];
|
||||
ty = worldTransform[5];
|
||||
worldTransform = displayObject.worldTransform;
|
||||
|
||||
this.verticies[index + 0 ] = a * w1 + c * h1 + tx;
|
||||
this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
|
||||
|
||||
this.verticies[index + 2 ] = a * w0 + c * h1 + tx;
|
||||
this.verticies[index + 3 ] = d * h1 + b * w0 + ty;
|
||||
a = worldTransform[0];
|
||||
b = worldTransform[3];
|
||||
c = worldTransform[1];
|
||||
d = worldTransform[4];
|
||||
tx = worldTransform[2];
|
||||
ty = worldTransform[5];
|
||||
|
||||
this.verticies[index + 4 ] = a * w0 + c * h0 + tx;
|
||||
this.verticies[index + 5 ] = d * h0 + b * w0 + ty;
|
||||
|
||||
this.verticies[index + 6] = a * w1 + c * h0 + tx;
|
||||
this.verticies[index + 7] = d * h0 + b * w1 + ty;
|
||||
|
||||
if(displayObject.updateFrame || displayObject.texture.updateFrame)
|
||||
{
|
||||
this.dirtyUVS = true;
|
||||
this.verticies[index + 0 ] = a * w1 + c * h1 + tx;
|
||||
this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
|
||||
|
||||
this.verticies[index + 2 ] = a * w0 + c * h1 + tx;
|
||||
this.verticies[index + 3 ] = d * h1 + b * w0 + ty;
|
||||
|
||||
var texture = displayObject.texture;
|
||||
this.verticies[index + 4 ] = a * w0 + c * h0 + tx;
|
||||
this.verticies[index + 5 ] = d * h0 + b * w0 + ty;
|
||||
|
||||
var frame = texture.frame;
|
||||
var tw = texture.baseTexture.width;
|
||||
var th = texture.baseTexture.height;
|
||||
this.verticies[index + 6] = a * w1 + c * h0 + tx;
|
||||
this.verticies[index + 7] = d * h0 + b * w1 + ty;
|
||||
|
||||
this.uvs[index + 0] = frame.x / tw;
|
||||
this.uvs[index +1] = frame.y / th;
|
||||
|
||||
this.uvs[index +2] = (frame.x + frame.width) / tw;
|
||||
this.uvs[index +3] = frame.y / th;
|
||||
if(displayObject.updateFrame || displayObject.texture.updateFrame)
|
||||
{
|
||||
this.dirtyUVS = true;
|
||||
|
||||
var texture = displayObject.texture;
|
||||
|
||||
var frame = texture.frame;
|
||||
var tw = texture.baseTexture.width;
|
||||
var th = texture.baseTexture.height;
|
||||
|
||||
this.uvs[index + 0] = frame.x / tw;
|
||||
this.uvs[index +1] = frame.y / th;
|
||||
|
||||
this.uvs[index +2] = (frame.x + frame.width) / tw;
|
||||
this.uvs[index +3] = frame.y / th;
|
||||
|
||||
this.uvs[index +4] = (frame.x + frame.width) / tw;
|
||||
this.uvs[index +5] = (frame.y + frame.height) / th;
|
||||
|
||||
this.uvs[index +6] = frame.x / tw;
|
||||
this.uvs[index +7] = (frame.y + frame.height) / th;
|
||||
|
||||
displayObject.updateFrame = false;
|
||||
}
|
||||
|
||||
this.uvs[index +4] = (frame.x + frame.width) / tw;
|
||||
this.uvs[index +5] = (frame.y + frame.height) / th;
|
||||
|
||||
this.uvs[index +6] = frame.x / tw;
|
||||
this.uvs[index +7] = (frame.y + frame.height) / th;
|
||||
|
||||
displayObject.updateFrame = false;
|
||||
// TODO this probably could do with some optimisation....
|
||||
if(displayObject.cacheAlpha != displayObject.worldAlpha)
|
||||
{
|
||||
displayObject.cacheAlpha = displayObject.worldAlpha;
|
||||
|
||||
var colorIndex = indexRun * 4;
|
||||
this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
|
||||
this.dirtyColors = true;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO this probably could do with some optimisation....
|
||||
if(displayObject.cacheAlpha != displayObject.worldAlpha)
|
||||
else
|
||||
{
|
||||
displayObject.cacheAlpha = displayObject.worldAlpha;
|
||||
index = indexRun * 8;
|
||||
|
||||
var colorIndex = indexRun * 4;
|
||||
this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
|
||||
this.dirtyColors = true;
|
||||
this.verticies[index + 0 ] = 0;
|
||||
this.verticies[index + 1 ] = 0;
|
||||
|
||||
this.verticies[index + 2 ] = 0;
|
||||
this.verticies[index + 3 ] = 0;
|
||||
|
||||
this.verticies[index + 4 ] = 0;
|
||||
this.verticies[index + 5 ] = 0;
|
||||
|
||||
this.verticies[index + 6] = 0;
|
||||
this.verticies[index + 7] = 0;
|
||||
}
|
||||
|
||||
indexRun++;
|
||||
|
@ -622,8 +646,13 @@ PIXI.WebGLBatch.prototype.update = function()
|
|||
* Draws the batch to the frame buffer
|
||||
* @method render
|
||||
*/
|
||||
PIXI.WebGLBatch.prototype.render = function()
|
||||
PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||
{
|
||||
// console.log(start + " :: " + end + " : " + this.size);
|
||||
start = start || 0;
|
||||
//end = end || this.size;
|
||||
if(end == undefined)end = this.size;
|
||||
|
||||
if(this.dirty)
|
||||
{
|
||||
this.refresh();
|
||||
|
@ -636,16 +665,10 @@ PIXI.WebGLBatch.prototype.render = function()
|
|||
var gl = this.gl;
|
||||
|
||||
//TODO optimize this!
|
||||
if(this.blendMode == PIXI.blendModes.NORMAL)
|
||||
{
|
||||
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
else
|
||||
{
|
||||
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
|
||||
}
|
||||
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
var shaderProgram = PIXI.shaderProgram;
|
||||
gl.useProgram(shaderProgram);
|
||||
|
||||
// update the verts..
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
|
||||
|
@ -680,9 +703,13 @@ PIXI.WebGLBatch.prototype.render = function()
|
|||
|
||||
// dont need to upload!
|
||||
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
|
||||
|
||||
|
||||
|
||||
//var startIndex = 0//1;
|
||||
var len = end - start;
|
||||
// console.log(this.size)
|
||||
// DRAW THAT this!
|
||||
gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
|
||||
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||
}
|
||||
|
||||
|
||||
|
|
708
docs/files/src_pixi_renderers_WebGLRenderGroup.js.html
Normal file
708
docs/files/src_pixi_renderers_WebGLRenderGroup.js.html
Normal file
|
@ -0,0 +1,708 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>src/pixi/renderers/WebGLRenderGroup.js - Pixi.JS</title>
|
||||
<link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0/build/cssgrids/cssgrids-min.css">
|
||||
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
||||
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
||||
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
|
||||
<script src="http://yui.yahooapis.com/combo?3.8.0/build/yui/yui-min.js"></script>
|
||||
</head>
|
||||
<body class="yui3-skin-sam">
|
||||
|
||||
<div id="doc">
|
||||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.JS"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 1.0.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
||||
<div class="yui3-u-1-4">
|
||||
<div id="docs-sidebar" class="sidebar apidocs">
|
||||
<div id="api-list">
|
||||
<h2 class="off-left">APIs</h2>
|
||||
<div id="api-tabview" class="tabview">
|
||||
<ul class="tabs">
|
||||
<li><a href="#api-classes">Classes</a></li>
|
||||
<li><a href="#api-modules">Modules</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="api-tabview-filter">
|
||||
<input type="search" id="api-filter" placeholder="Type to filter APIs">
|
||||
</div>
|
||||
|
||||
<div id="api-tabview-panel">
|
||||
<ul id="api-classes" class="apis classes">
|
||||
|
||||
<li><a href="../classes/AssetLoader.html">AssetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/Stage.html">Stage</a></li>
|
||||
|
||||
<li><a href="../classes/Text.html">Text</a></li>
|
||||
|
||||
<li><a href="../classes/Texture.html">Texture</a></li>
|
||||
|
||||
<li><a href="../classes/TilingSprite.html">TilingSprite</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLBatch.html">WebGLBatch</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLRenderer.html">WebGLRenderer</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<ul id="api-modules" class="apis modules">
|
||||
|
||||
<li><a href="../modules/PIXI.html">PIXI</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="yui3-u-3-4">
|
||||
<div id="api-options">
|
||||
Show:
|
||||
<label for="api-show-inherited">
|
||||
<input type="checkbox" id="api-show-inherited" checked>
|
||||
Inherited
|
||||
</label>
|
||||
|
||||
<label for="api-show-protected">
|
||||
<input type="checkbox" id="api-show-protected">
|
||||
Protected
|
||||
</label>
|
||||
|
||||
<label for="api-show-private">
|
||||
<input type="checkbox" id="api-show-private">
|
||||
Private
|
||||
</label>
|
||||
<label for="api-show-deprecated">
|
||||
<input type="checkbox" id="api-show-deprecated">
|
||||
Deprecated
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="apidocs">
|
||||
<div id="docs-main">
|
||||
<div class="content">
|
||||
<h1 class="file-heading">File: src/pixi/renderers/WebGLRenderGroup.js</h1>
|
||||
|
||||
<div class="file">
|
||||
<pre class="code prettyprint linenums">
|
||||
/**
|
||||
* @author Mat Groves http://matgroves.com/ @Doormat23
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A WebGLBatch Enables a group of sprites to be drawn using the same settings.
|
||||
* if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.
|
||||
* @class WebGLBatch
|
||||
* @param an instance of the webGL context
|
||||
* @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
|
||||
*/
|
||||
PIXI.WebGLRenderGroup = function(gl)
|
||||
{
|
||||
this.gl = gl;
|
||||
this.root;
|
||||
|
||||
this.backgroundColor;
|
||||
this.batchs = [];
|
||||
this.toRemove = [];
|
||||
}
|
||||
|
||||
|
||||
// constructor
|
||||
PIXI.WebGLRenderGroup.constructor = PIXI.WebGLRenderGroup;
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.setRenderable = function(displayObject)
|
||||
{
|
||||
// has this changed??
|
||||
if(this.root)this.removeDisplayObjectAndChildren(this.root);
|
||||
|
||||
//console.log("!!!");
|
||||
// TODO what if its already has an object? should remove it
|
||||
this.root = displayObject;
|
||||
//displayObject.__renderGroup = this;
|
||||
this.addDisplayObjectAndChildren(displayObject);
|
||||
//displayObject
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.render = function(renderTexture)
|
||||
{
|
||||
|
||||
var gl = this.gl;
|
||||
|
||||
for (var i=0; i < this.toRemove.length; i++)
|
||||
{
|
||||
this.removeDisplayObjectAndChildren(this.toRemove[i]);
|
||||
};
|
||||
|
||||
this.toRemove = [];
|
||||
|
||||
this.checkVisibility(this.root, this.root.visible);
|
||||
|
||||
// will render all the elements in the group
|
||||
var renderable;
|
||||
for (var i=0; i < this.batchs.length; i++)
|
||||
{
|
||||
renderable = this.batchs[i];
|
||||
if(renderable instanceof PIXI.WebGLBatch)
|
||||
{
|
||||
this.batchs[i].render();
|
||||
}
|
||||
else if(renderable instanceof PIXI.TilingSprite)
|
||||
{
|
||||
if(renderable.visible)this.renderTilingSprite(renderable);
|
||||
}
|
||||
else if(renderable instanceof PIXI.Strip)
|
||||
{
|
||||
if(renderable.visible)this.renderStrip(renderable);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, renderTexture)
|
||||
{
|
||||
var gl = this.gl;
|
||||
this.checkVisibility(displayObject, displayObject.visible);
|
||||
|
||||
|
||||
//console.log("SPECIFIC");
|
||||
// to do!
|
||||
// render part of the scene...
|
||||
|
||||
var startIndex;
|
||||
var startBatchIndex;
|
||||
|
||||
var endIndex;
|
||||
var endBatchIndex;
|
||||
|
||||
// get NEXT Renderable!
|
||||
var nextRenderable = displayObject.renderable ? displayObject : this.getNextRenderable(displayObject);
|
||||
var startBatch = nextRenderable.batch;
|
||||
|
||||
if(nextRenderable instanceof PIXI.Sprite)
|
||||
{
|
||||
startBatch = nextRenderable.batch;
|
||||
|
||||
var head = startBatch.head;
|
||||
var next = head;
|
||||
|
||||
// ok now we have the batch.. need to find the start index!
|
||||
if(head == nextRenderable)
|
||||
{
|
||||
startIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
startIndex = 1;
|
||||
|
||||
while(head.__next != nextRenderable)
|
||||
{
|
||||
startIndex++;
|
||||
head = head.__next;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
startBatch = nextRenderable;
|
||||
}
|
||||
|
||||
// Get the LAST renderable object
|
||||
var lastRenderable = displayObject;
|
||||
var endBatch;
|
||||
var lastItem = displayObject;
|
||||
while(lastItem.children.length > 0)
|
||||
{
|
||||
lastItem = lastItem.children[lastItem.children.length-1];
|
||||
if(lastItem.renderable)lastRenderable = lastItem;
|
||||
}
|
||||
|
||||
if(lastRenderable instanceof PIXI.Sprite)
|
||||
{
|
||||
endBatch = lastRenderable.batch;
|
||||
|
||||
var head = endBatch.head;
|
||||
|
||||
if(head == lastRenderable)
|
||||
{
|
||||
endIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
endIndex = 1;
|
||||
|
||||
while(head.__next != lastRenderable)
|
||||
{
|
||||
endIndex++;
|
||||
head = head.__next;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
endBatch = lastRenderable;
|
||||
}
|
||||
|
||||
// now we have first and last!
|
||||
startBatchIndex = this.batchs.indexOf(startBatch);
|
||||
endBatchIndex = this.batchs.indexOf(endBatch);
|
||||
|
||||
// DO the first batch
|
||||
if(startBatch instanceof PIXI.WebGLBatch)
|
||||
{
|
||||
startBatch.render(startIndex);
|
||||
}
|
||||
else if(startBatch instanceof PIXI.TilingSprite)
|
||||
{
|
||||
if(startBatch.visible)this.renderTilingSprite(startBatch);
|
||||
}
|
||||
else if(startBatch instanceof PIXI.Strip)
|
||||
{
|
||||
if(startBatch.visible)this.renderStrip(startBatch);
|
||||
}
|
||||
|
||||
// DO the middle batchs..
|
||||
for (var i=startBatchIndex+1; i < endBatchIndex; i++)
|
||||
{
|
||||
renderable = this.batchs[i];
|
||||
|
||||
if(renderable instanceof PIXI.WebGLBatch)
|
||||
{
|
||||
this.batchs[i].render();
|
||||
}
|
||||
else if(renderable instanceof PIXI.TilingSprite)
|
||||
{
|
||||
if(renderable.visible)this.renderTilingSprite(renderable);
|
||||
}
|
||||
else if(renderable instanceof PIXI.Strip)
|
||||
{
|
||||
if(renderable.visible)this.renderStrip(renderable);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// DO the last batch..
|
||||
if(endBatch instanceof PIXI.WebGLBatch)
|
||||
{
|
||||
endBatch.render(0, endIndex+1);
|
||||
}
|
||||
else if(endBatch instanceof PIXI.TilingSprite)
|
||||
{
|
||||
if(endBatch.visible)this.renderTilingSprite(endBatch);
|
||||
}
|
||||
else if(endBatch instanceof PIXI.Strip)
|
||||
{
|
||||
if(endBatch.visible)this.renderStrip(endBatch);
|
||||
}
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, globalVisible)
|
||||
{
|
||||
// give the dp a refference to its renderGroup...
|
||||
var children = displayObject.children;
|
||||
//displayObject.worldVisible = globalVisible;
|
||||
for (var i=0; i < children.length; i++)
|
||||
{
|
||||
var child = children[i];
|
||||
|
||||
// TODO optimize... shouldt need to loop through everything all the time
|
||||
child.worldVisible = child.visible && globalVisible;
|
||||
|
||||
// everything should have a batch!
|
||||
// time to see whats new!
|
||||
if(child.textureChange)
|
||||
{
|
||||
child.textureChange = false;
|
||||
if(child.worldVisible)
|
||||
{
|
||||
this.removeDisplayObject(child)
|
||||
this.addDisplayObject(child)
|
||||
}
|
||||
// update texture!!
|
||||
}
|
||||
|
||||
if(child.children.length > 0)
|
||||
{
|
||||
this.checkVisibility(child, child.worldVisible);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject)
|
||||
{
|
||||
// add a child to the render group..
|
||||
displayObject.batch = null;
|
||||
displayObject.__renderGroup = this;
|
||||
|
||||
//displayObject.cacheVisible = true;
|
||||
if(!displayObject.renderable)return;
|
||||
|
||||
// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
|
||||
//displayObject.__inWebGL = true;
|
||||
|
||||
var previousSprite = this.getPreviousRenderable(displayObject);
|
||||
var nextSprite = this.getNextRenderable(displayObject);
|
||||
|
||||
|
||||
/*
|
||||
* so now we have the next renderable and the previous renderable
|
||||
*
|
||||
*/
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
{
|
||||
var previousBatch
|
||||
var nextBatch
|
||||
|
||||
//console.log( previousSprite)
|
||||
if(previousSprite instanceof PIXI.Sprite)
|
||||
{
|
||||
previousBatch = previousSprite.batch;
|
||||
if(previousBatch)
|
||||
{
|
||||
if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
|
||||
{
|
||||
previousBatch.insertAfter(displayObject, previousSprite);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO reword!
|
||||
previousBatch = previousSprite;
|
||||
}
|
||||
|
||||
if(nextSprite)
|
||||
{
|
||||
if(nextSprite instanceof PIXI.Sprite)
|
||||
{
|
||||
nextBatch = nextSprite.batch;
|
||||
|
||||
//batch may not exist if item was added to the display list but not to the webGL
|
||||
if(nextBatch)
|
||||
{
|
||||
if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
|
||||
{
|
||||
nextBatch.insertBefore(displayObject, nextSprite);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nextBatch == previousBatch)
|
||||
{
|
||||
// THERE IS A SPLIT IN THIS BATCH! //
|
||||
var splitBatch = previousBatch.split(nextSprite);
|
||||
// COOL!
|
||||
// add it back into the array
|
||||
/*
|
||||
* OOPS!
|
||||
* seems the new sprite is in the middle of a batch
|
||||
* lets split it..
|
||||
*/
|
||||
var batch = PIXI.WebGLRenderer.getBatch();
|
||||
|
||||
var index = this.batchs.indexOf( previousBatch );
|
||||
batch.init(displayObject);
|
||||
this.batchs.splice(index+1, 0, batch, splitBatch);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO re-word!
|
||||
nextBatch = nextSprite;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* looks like it does not belong to any batch!
|
||||
* but is also not intersecting one..
|
||||
* time to create anew one!
|
||||
*/
|
||||
|
||||
var batch = PIXI.WebGLRenderer.getBatch();
|
||||
batch.init(displayObject);
|
||||
|
||||
if(previousBatch) // if this is invalid it means
|
||||
{
|
||||
var index = this.batchs.indexOf( previousBatch );
|
||||
this.batchs.splice(index+1, 0, batch);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.batchs.push(batch);
|
||||
}
|
||||
|
||||
}
|
||||
else if(displayObject instanceof PIXI.TilingSprite)
|
||||
{
|
||||
// add to a batch!!
|
||||
this.initTilingSprite(displayObject);
|
||||
this.batchs.push(displayObject);
|
||||
|
||||
}
|
||||
else if(displayObject instanceof PIXI.Strip)
|
||||
{
|
||||
// add to a batch!!
|
||||
this.initStrip(displayObject);
|
||||
this.batchs.push(displayObject);
|
||||
}
|
||||
|
||||
// if its somthing else... then custom codes!
|
||||
this.batchUpdate = true;
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayObject)
|
||||
{
|
||||
// TODO - this can be faster - but not as important right now
|
||||
|
||||
this.addDisplayObject(displayObject);
|
||||
var children = displayObject.children;
|
||||
|
||||
for (var i=0; i < children.length; i++)
|
||||
{
|
||||
this.addDisplayObjectAndChildren(children[i]);
|
||||
};
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.removeDisplayObject = function(displayObject)
|
||||
{
|
||||
// loop through children..
|
||||
// display object //
|
||||
|
||||
// add a child from the render group..
|
||||
// remove it and all its children!
|
||||
//displayObject.cacheVisible = false;//displayObject.visible;
|
||||
displayObject.__renderGroup = null;
|
||||
|
||||
if(!displayObject.renderable)return;
|
||||
|
||||
/*
|
||||
* removing is a lot quicker..
|
||||
*
|
||||
*/
|
||||
var batchToRemove;
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
{
|
||||
// should always have a batch!
|
||||
var batch = displayObject.batch;
|
||||
if(!batch)return; // this means the display list has been altered befre rendering
|
||||
|
||||
batch.remove(displayObject);
|
||||
|
||||
if(batch.size==0)
|
||||
{
|
||||
batchToRemove = batch;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
batchToRemove = displayObject;
|
||||
}
|
||||
|
||||
/*
|
||||
* Looks like there is somthing that needs removing!
|
||||
*/
|
||||
if(batchToRemove)
|
||||
{
|
||||
var index = this.batchs.indexOf( batchToRemove );
|
||||
if(index == -1)return;// this means it was added then removed before rendered
|
||||
|
||||
// ok so.. check to see if you adjacent batchs should be joined.
|
||||
// TODO may optimise?
|
||||
if(index == 0 || index == this.batchs.length-1)
|
||||
{
|
||||
// wha - eva! just get of the empty batch!
|
||||
this.batchs.splice(index, 1);
|
||||
if(batchToRemove instanceof PIXI.WebGLBatch)PIXI.WebGLRenderer.returnBatch(batchToRemove);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
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 && this.batchs[index-1].blendMode == this.batchs[index+1].blendMode)
|
||||
{
|
||||
//console.log("MERGE")
|
||||
this.batchs[index-1].merge(this.batchs[index+1]);
|
||||
|
||||
if(batchToRemove instanceof PIXI.WebGLBatch)PIXI.WebGLRenderer.returnBatch(batchToRemove);
|
||||
PIXI.WebGLRenderer.returnBatch(this.batchs[index+1]);
|
||||
this.batchs.splice(index, 2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.batchs.splice(index, 1);
|
||||
if(batchToRemove instanceof PIXI.WebGLBatch)PIXI.WebGLRenderer.returnBatch(batchToRemove);
|
||||
}
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren = function(displayObject)
|
||||
{
|
||||
// TODO - this can be faster - but not as important right now
|
||||
if(displayObject.__renderGroup != this)return;
|
||||
|
||||
this.removeDisplayObject(displayObject);
|
||||
var children = displayObject.children;
|
||||
|
||||
for (var i=0; i < children.length; i++)
|
||||
{
|
||||
this.removeDisplayObjectAndChildren(children[i]);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.getNextRenderable = function(displayObject)
|
||||
{
|
||||
/*
|
||||
* LOOK FOR THE NEXT SPRITE
|
||||
* This part looks for the closest next sprite that can go into a batch
|
||||
* it keeps looking until it finds a sprite or gets to the end of the display
|
||||
* scene graph
|
||||
*
|
||||
* These look a lot scarier than the actually are...
|
||||
*/
|
||||
|
||||
var nextSprite = displayObject;
|
||||
do
|
||||
{
|
||||
// moving forward!
|
||||
// if it has no children..
|
||||
if(nextSprite.children.length == 0)
|
||||
{
|
||||
// go along to the parent..
|
||||
while(nextSprite.childIndex == nextSprite.parent.children.length-1)
|
||||
{
|
||||
nextSprite = nextSprite.parent;
|
||||
if(nextSprite == this.root)//displayObject.stage)
|
||||
{
|
||||
nextSprite = null
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
|
||||
}
|
||||
else
|
||||
{
|
||||
nextSprite = nextSprite.children[0];
|
||||
}
|
||||
|
||||
if(!nextSprite)break;
|
||||
}
|
||||
while(!nextSprite.renderable || !nextSprite.__renderGroup)
|
||||
|
||||
return nextSprite;
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.getPreviousRenderable = function(displayObject)
|
||||
{
|
||||
/*
|
||||
* LOOK FOR THE PREVIOUS SPRITE
|
||||
* This part looks for the closest previous sprite that can go into a batch
|
||||
* It keeps going back until it finds a sprite or the stage
|
||||
*/
|
||||
var previousSprite = displayObject;
|
||||
do
|
||||
{
|
||||
if(previousSprite.childIndex == 0)
|
||||
{
|
||||
previousSprite = previousSprite.parent;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
|
||||
// what if the bloop has children???
|
||||
while(previousSprite.children.length != 0)
|
||||
{
|
||||
// keep diggin till we get to the last child
|
||||
previousSprite = previousSprite.children[previousSprite.children.length-1];
|
||||
}
|
||||
}
|
||||
|
||||
if(previousSprite == this.root)break;
|
||||
}
|
||||
while(!previousSprite.renderable || !previousSprite.__renderGroup);
|
||||
|
||||
return previousSprite;
|
||||
}
|
||||
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../assets/vendor/prettify/prettify-min.js"></script>
|
||||
<script>prettyPrint();</script>
|
||||
<script src="../assets/js/yui-prettify.js"></script>
|
||||
<script src="../assets/../api.js"></script>
|
||||
<script src="../assets/js/api-filter.js"></script>
|
||||
<script src="../assets/js/api-list.js"></script>
|
||||
<script src="../assets/js/api-search.js"></script>
|
||||
<script src="../assets/js/apidocs.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -134,6 +136,10 @@
|
|||
|
||||
PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
|
||||
|
||||
// an instance of the gl context..
|
||||
// only one at the moment :/
|
||||
PIXI.gl;
|
||||
|
||||
/**
|
||||
* 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 :)
|
||||
|
@ -171,7 +177,7 @@ PIXI.WebGLRenderer = function(width, height, view, transparent)
|
|||
|
||||
try
|
||||
{
|
||||
this.gl = this.view.getContext("experimental-webgl", {
|
||||
PIXI.gl = this.gl = this.view.getContext("experimental-webgl", {
|
||||
alpha: this.transparent,
|
||||
antialias:false, // SPEED UP??
|
||||
premultipliedAlpha:true
|
||||
|
@ -186,15 +192,20 @@ PIXI.WebGLRenderer = function(width, height, view, transparent)
|
|||
|
||||
|
||||
var gl = this.gl;
|
||||
PIXI.WebGLRenderer.gl = gl;
|
||||
|
||||
this.batch = new PIXI.WebGLBatch(gl);
|
||||
gl.disable(gl.DEPTH_TEST);
|
||||
gl.disable(gl.CULL_FACE);
|
||||
gl.enable(gl.BLEND);
|
||||
gl.colorMask(true, true, true, this.transparent);
|
||||
|
||||
this.projectionMatrix = PIXI.mat4.create();
|
||||
this.resize(this.width, this.height)
|
||||
this.contextLost = false;
|
||||
|
||||
this.stageRenderGroup = new PIXI.WebGLRenderGroup(this.gl);
|
||||
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -203,11 +214,11 @@ PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
|
|||
/**
|
||||
* @private
|
||||
*/
|
||||
PIXI.WebGLRenderer.prototype.getBatch = function()
|
||||
PIXI.WebGLRenderer.getBatch = function()
|
||||
{
|
||||
if(PIXI._batchs.length == 0)
|
||||
{
|
||||
return new PIXI.WebGLBatch(this.gl);
|
||||
return new PIXI.WebGLBatch(PIXI.WebGLRenderer.gl);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -218,7 +229,7 @@ PIXI.WebGLRenderer.prototype.getBatch = function()
|
|||
/**
|
||||
* @private
|
||||
*/
|
||||
PIXI.WebGLRenderer.prototype.returnBatch = function(batch)
|
||||
PIXI.WebGLRenderer.returnBatch = function(batch)
|
||||
{
|
||||
batch.clean();
|
||||
PIXI._batchs.push(batch);
|
||||
|
@ -264,55 +275,6 @@ PIXI.WebGLRenderer.prototype.initShaders = function()
|
|||
PIXI.shaderProgram = this.shaderProgram;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
|
||||
{
|
||||
var children = displayObject.children;
|
||||
|
||||
|
||||
for (var i=0; i < children.length; i++)
|
||||
{
|
||||
var child = children[i];
|
||||
|
||||
// TODO optimize... shouldt need to loop through everything all the time
|
||||
var actualVisibility = child.visible && globalVisible;
|
||||
|
||||
// everything should have a batch!
|
||||
// time to see whats new!
|
||||
if(child.textureChange)
|
||||
{
|
||||
child.textureChange = false;
|
||||
if(actualVisibility)
|
||||
{
|
||||
this.removeDisplayObject(child)
|
||||
this.addDisplayObject(child)
|
||||
}
|
||||
// update texture!!
|
||||
}
|
||||
|
||||
if(child.cacheVisible != actualVisibility)
|
||||
{
|
||||
child.cacheVisible = actualVisibility;
|
||||
|
||||
if(child.cacheVisible)
|
||||
{
|
||||
this.addDisplayObject(child);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.removeDisplayObject(child);
|
||||
}
|
||||
}
|
||||
|
||||
if(child.children.length > 0)
|
||||
{
|
||||
this.checkVisibility(child, actualVisibility);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders the stage to its webGL view
|
||||
|
@ -327,19 +289,21 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
// if rendering a new stage clear the batchs..
|
||||
if(this.__stage !== stage)
|
||||
{
|
||||
// TODO make this work
|
||||
if(this.__stage)this.checkVisibility(this.__stage, false)
|
||||
this.__stage = stage;
|
||||
this.stageRenderGroup.setRenderable(stage);
|
||||
}
|
||||
|
||||
|
||||
// update children if need be
|
||||
// best to remove first!
|
||||
for (var i=0; i < stage.__childrenRemoved.length; i++)
|
||||
{
|
||||
this.removeDisplayObject(stage.__childrenRemoved[i]);
|
||||
var group = stage.__childrenRemoved[i].__renderGroup
|
||||
if(group)group.removeDisplayObject(stage.__childrenRemoved[i]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// update any textures
|
||||
for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
|
||||
for (var i=0; i < PIXI.texturesToDestroy.length; i++) this.destroyTexture(PIXI.texturesToDestroy[i]);
|
||||
|
@ -349,43 +313,31 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
stage.__childrenAdded = [];
|
||||
PIXI.texturesToUpdate = [];
|
||||
PIXI.texturesToDestroy = [];
|
||||
|
||||
// recursivly loop through all items!
|
||||
this.checkVisibility(stage, true);
|
||||
//this.checkVisibility(stage, true);
|
||||
|
||||
// update the scene graph
|
||||
stage.updateTransform();
|
||||
|
||||
var gl = this.gl;
|
||||
|
||||
gl.clear(gl.COLOR_BUFFER_BIT)
|
||||
|
||||
gl.clearColor(stage.backgroundColorSplit[0], stage.backgroundColorSplit[1], stage.backgroundColorSplit[2], 0);
|
||||
// -- Does this need to be set every frame? -- //
|
||||
gl.colorMask(true, true, true, this.transparent);
|
||||
gl.viewport(0, 0, this.width, this.height);
|
||||
|
||||
|
||||
// set the correct blend mode!
|
||||
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
||||
// set the correct matrix..
|
||||
gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
|
||||
|
||||
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
||||
|
||||
gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], this.transparent);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
|
||||
// render all the batchs!
|
||||
|
||||
|
||||
var renderable;
|
||||
for (var i=0; i < this.batchs.length; i++)
|
||||
{
|
||||
renderable = this.batchs[i];
|
||||
if(renderable instanceof PIXI.WebGLBatch)
|
||||
{
|
||||
this.batchs[i].render();
|
||||
}
|
||||
else if(renderable instanceof PIXI.TilingSprite)
|
||||
{
|
||||
if(renderable.visible)this.renderTilingSprite(renderable);
|
||||
}
|
||||
else if(renderable instanceof PIXI.Strip)
|
||||
{
|
||||
if(renderable.visible)this.renderStrip(renderable);
|
||||
}
|
||||
}
|
||||
this.stageRenderGroup.backgroundColor = stage.backgroundColorSplit;
|
||||
this.stageRenderGroup.render();
|
||||
|
||||
// interaction
|
||||
// run interaction!
|
||||
|
@ -427,6 +379,7 @@ PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
|
|||
{
|
||||
gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
|
||||
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
||||
|
@ -464,285 +417,7 @@ PIXI.WebGLRenderer.prototype.destroyTexture = function(texture)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
|
||||
{
|
||||
var objectDetaildisplayObject
|
||||
if(!displayObject.stage)return; // means it was removed
|
||||
if(displayObject.__inWebGL)return; //means it is already in webgL
|
||||
|
||||
//displayObject.cacheVisible = displayObject.visible;
|
||||
|
||||
// TODO if objects parent is not visible then dont add to stage!!!!
|
||||
//if(!displayObject.visible)return;
|
||||
|
||||
|
||||
displayObject.batch = null;
|
||||
|
||||
//displayObject.cacheVisible = true;
|
||||
if(!displayObject.renderable)return;
|
||||
|
||||
// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
|
||||
displayObject.__inWebGL = true;
|
||||
|
||||
/*
|
||||
* LOOK FOR THE PREVIOUS SPRITE
|
||||
* This part looks for the closest previous sprite that can go into a batch
|
||||
* It keeps going back until it finds a sprite or the stage
|
||||
*/
|
||||
var previousSprite = displayObject;
|
||||
do
|
||||
{
|
||||
if(previousSprite.childIndex == 0)
|
||||
{
|
||||
previousSprite = previousSprite.parent;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
|
||||
// what if the bloop has children???
|
||||
while(previousSprite.children.length != 0)
|
||||
{
|
||||
// keep diggin till we get to the last child
|
||||
previousSprite = previousSprite.children[previousSprite.children.length-1];
|
||||
}
|
||||
}
|
||||
|
||||
if(previousSprite == displayObject.stage)break;
|
||||
}
|
||||
while(!previousSprite.renderable || !previousSprite.__inWebGL)
|
||||
//while(!(previousSprite instanceof PIXI.Sprite))
|
||||
|
||||
/*
|
||||
* LOOK FOR THE NEXT SPRITE
|
||||
* This part looks for the closest next sprite that can go into a batch
|
||||
* it keeps looking until it finds a sprite or gets to the end of the display
|
||||
* scene graph
|
||||
*
|
||||
* These look a lot scarier than the actually are...
|
||||
*/
|
||||
var nextSprite = displayObject;
|
||||
do
|
||||
{
|
||||
// moving forward!
|
||||
// if it has no children..
|
||||
if(nextSprite.children.length == 0)
|
||||
{
|
||||
// go along to the parent..
|
||||
while(nextSprite.childIndex == nextSprite.parent.children.length-1)
|
||||
{
|
||||
nextSprite = nextSprite.parent;
|
||||
if(nextSprite == displayObject.stage)
|
||||
{
|
||||
nextSprite = null
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
nextSprite = nextSprite.children[0];
|
||||
}
|
||||
|
||||
if(!nextSprite)break;
|
||||
}
|
||||
while(!nextSprite.renderable || !nextSprite.__inWebGL)
|
||||
|
||||
/*
|
||||
* so now we have the next renderable and the previous renderable
|
||||
*
|
||||
*/
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
{
|
||||
var previousBatch
|
||||
var nextBatch
|
||||
|
||||
if(previousSprite instanceof PIXI.Sprite)
|
||||
{
|
||||
previousBatch = previousSprite.batch;
|
||||
|
||||
if(previousBatch)
|
||||
{
|
||||
if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
|
||||
{
|
||||
previousBatch.insertAfter(displayObject, previousSprite);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO reword!
|
||||
previousBatch = previousSprite;
|
||||
}
|
||||
|
||||
if(nextSprite)
|
||||
{
|
||||
if(nextSprite instanceof PIXI.Sprite)
|
||||
{
|
||||
nextBatch = nextSprite.batch;
|
||||
|
||||
//batch may not exist if item was added to the display list but not to the webGL
|
||||
if(nextBatch)
|
||||
{
|
||||
if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
|
||||
{
|
||||
nextBatch.insertBefore(displayObject, nextSprite);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nextBatch == previousBatch)
|
||||
{
|
||||
// THERE IS A SPLIT IN THIS BATCH! //
|
||||
var splitBatch = previousBatch.split(nextSprite);
|
||||
// COOL!
|
||||
// add it back into the array
|
||||
/*
|
||||
* OOPS!
|
||||
* seems the new sprite is in the middle of a batch
|
||||
* lets split it..
|
||||
*/
|
||||
var batch = this.getBatch();
|
||||
|
||||
var index = this.batchs.indexOf( previousBatch );
|
||||
batch.init(displayObject);
|
||||
this.batchs.splice(index+1, 0, batch, splitBatch);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO re-word!
|
||||
nextBatch = nextSprite;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* looks like it does not belong to any batch!
|
||||
* but is also not intersecting one..
|
||||
* time to create anew one!
|
||||
*/
|
||||
|
||||
var batch = this.getBatch();
|
||||
batch.init(displayObject);
|
||||
|
||||
if(previousBatch) // if this is invalid it means
|
||||
{
|
||||
var index = this.batchs.indexOf( previousBatch );
|
||||
this.batchs.splice(index+1, 0, batch);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.batchs.push(batch);
|
||||
}
|
||||
|
||||
}
|
||||
else if(displayObject instanceof PIXI.TilingSprite)
|
||||
{
|
||||
// add to a batch!!
|
||||
this.initTilingSprite(displayObject);
|
||||
this.batchs.push(displayObject);
|
||||
|
||||
}
|
||||
else if(displayObject instanceof PIXI.Strip)
|
||||
{
|
||||
// add to a batch!!
|
||||
this.initStrip(displayObject);
|
||||
this.batchs.push(displayObject);
|
||||
|
||||
}
|
||||
|
||||
// if its somthing else... then custom codes!
|
||||
this.batchUpdate = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
|
||||
{
|
||||
//if(displayObject.stage)return;
|
||||
displayObject.cacheVisible = false;//displayObject.visible;
|
||||
|
||||
if(!displayObject.renderable)return;
|
||||
|
||||
displayObject.__inWebGL = false;
|
||||
|
||||
/*
|
||||
* removing is a lot quicker..
|
||||
*
|
||||
*/
|
||||
var batchToRemove;
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
{
|
||||
// should always have a batch!
|
||||
var batch = displayObject.batch;
|
||||
if(!batch)return; // this means the display list has been altered befre rendering
|
||||
|
||||
batch.remove(displayObject);
|
||||
|
||||
if(batch.size==0)
|
||||
{
|
||||
batchToRemove = batch
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
batchToRemove = displayObject;
|
||||
}
|
||||
|
||||
/*
|
||||
* Looks like there is somthing that needs removing!
|
||||
*/
|
||||
if(batchToRemove)
|
||||
{
|
||||
var index = this.batchs.indexOf( batchToRemove );
|
||||
if(index == -1)return;// this means it was added then removed before rendered
|
||||
|
||||
// ok so.. check to see if you adjacent batchs should be joined.
|
||||
// TODO may optimise?
|
||||
if(index == 0 || index == this.batchs.length-1)
|
||||
{
|
||||
// wha - eva! just get of the empty batch!
|
||||
this.batchs.splice(index, 1);
|
||||
if(batchToRemove instanceof PIXI.WebGLBatch)this.returnBatch(batchToRemove);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
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 && this.batchs[index-1].blendMode == this.batchs[index+1].blendMode)
|
||||
{
|
||||
//console.log("MERGE")
|
||||
this.batchs[index-1].merge(this.batchs[index+1]);
|
||||
|
||||
if(batchToRemove instanceof PIXI.WebGLBatch)this.returnBatch(batchToRemove);
|
||||
this.returnBatch(this.batchs[index+1]);
|
||||
this.batchs.splice(index, 2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.batchs.splice(index, 1);
|
||||
if(batchToRemove instanceof PIXI.WebGLBatch)this.returnBatch(batchToRemove);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* resizes the webGL view to the specified width and height
|
||||
|
@ -774,9 +449,6 @@ PIXI.WebGLRenderer.prototype.resize = function(width, height)
|
|||
*/
|
||||
PIXI.WebGLRenderer.prototype.initTilingSprite = function(sprite)
|
||||
{
|
||||
|
||||
|
||||
|
||||
var gl = this.gl;
|
||||
|
||||
// make the texture tilable..
|
||||
|
@ -863,28 +535,25 @@ PIXI.WebGLRenderer.prototype.renderTilingSprite = function(sprite)
|
|||
var offsetX = tilePosition.x/sprite.texture.baseTexture.width;
|
||||
var offsetY = tilePosition.y/sprite.texture.baseTexture.height;
|
||||
|
||||
var scaleX = (sprite.width / sprite.texture.baseTexture.width) / tileScale.x///sprite.texture.baseTexture.width;
|
||||
var scaleY = (sprite.height / sprite.texture.baseTexture.height) / tileScale.y///sprite.texture.baseTexture.height;
|
||||
//
|
||||
//sprite.dirty = true;
|
||||
sprite.uvs[0] = 0 + offsetX
|
||||
var scaleX = (sprite.width / sprite.texture.baseTexture.width) / tileScale.x;
|
||||
var scaleY = (sprite.height / sprite.texture.baseTexture.height) / tileScale.y;
|
||||
|
||||
sprite.uvs[0] = 0 - offsetX;
|
||||
sprite.uvs[1] = 0 - offsetY;
|
||||
|
||||
sprite.uvs[2] = (1 * scaleX) +offsetX
|
||||
sprite.uvs[2] = (1 * scaleX) -offsetX;
|
||||
sprite.uvs[3] = 0 - offsetY;
|
||||
|
||||
sprite.uvs[4] = (1 *scaleX) + offsetX
|
||||
sprite.uvs[4] = (1 *scaleX) - offsetX;
|
||||
sprite.uvs[5] = (1 *scaleY) - offsetY;
|
||||
|
||||
sprite.uvs[6] = 0 + offsetX
|
||||
sprite.uvs[6] = 0 - offsetX;
|
||||
sprite.uvs[7] = (1 *scaleY) - offsetY;
|
||||
|
||||
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, sprite._uvBuffer);
|
||||
gl.bufferSubData(gl.ARRAY_BUFFER, 0, sprite.uvs)
|
||||
|
||||
this.renderStrip(sprite);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -153,8 +155,8 @@ PIXI.Text = function(text, style)
|
|||
|
||||
this.setText(text);
|
||||
this.setStyle(style);
|
||||
this.updateText();
|
||||
this.dirty = false;
|
||||
//this.updateText();
|
||||
this.dirty = true;
|
||||
};
|
||||
|
||||
// constructor
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -174,6 +176,8 @@ PIXI.BaseTexture = function(source)
|
|||
*/
|
||||
this.source = source//new Image();
|
||||
|
||||
if(!source)return;
|
||||
|
||||
if(this.source instanceof Image)
|
||||
{
|
||||
if(this.source.complete)
|
||||
|
@ -207,7 +211,6 @@ PIXI.BaseTexture = function(source)
|
|||
this.width = this.source.width;
|
||||
this.height = this.source.height;
|
||||
|
||||
//console.log(">!!",this.width)
|
||||
PIXI.texturesToUpdate.push(this);
|
||||
}
|
||||
|
||||
|
|
318
docs/files/src_pixi_textures_RenderTexture.js.html
Normal file
318
docs/files/src_pixi_textures_RenderTexture.js.html
Normal file
|
@ -0,0 +1,318 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>src/pixi/textures/RenderTexture.js - Pixi.JS</title>
|
||||
<link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0/build/cssgrids/cssgrids-min.css">
|
||||
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
||||
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
||||
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
|
||||
<script src="http://yui.yahooapis.com/combo?3.8.0/build/yui/yui-min.js"></script>
|
||||
</head>
|
||||
<body class="yui3-skin-sam">
|
||||
|
||||
<div id="doc">
|
||||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.JS"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 1.0.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
||||
<div class="yui3-u-1-4">
|
||||
<div id="docs-sidebar" class="sidebar apidocs">
|
||||
<div id="api-list">
|
||||
<h2 class="off-left">APIs</h2>
|
||||
<div id="api-tabview" class="tabview">
|
||||
<ul class="tabs">
|
||||
<li><a href="#api-classes">Classes</a></li>
|
||||
<li><a href="#api-modules">Modules</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="api-tabview-filter">
|
||||
<input type="search" id="api-filter" placeholder="Type to filter APIs">
|
||||
</div>
|
||||
|
||||
<div id="api-tabview-panel">
|
||||
<ul id="api-classes" class="apis classes">
|
||||
|
||||
<li><a href="../classes/AssetLoader.html">AssetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/Stage.html">Stage</a></li>
|
||||
|
||||
<li><a href="../classes/Text.html">Text</a></li>
|
||||
|
||||
<li><a href="../classes/Texture.html">Texture</a></li>
|
||||
|
||||
<li><a href="../classes/TilingSprite.html">TilingSprite</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLBatch.html">WebGLBatch</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLRenderer.html">WebGLRenderer</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<ul id="api-modules" class="apis modules">
|
||||
|
||||
<li><a href="../modules/PIXI.html">PIXI</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="yui3-u-3-4">
|
||||
<div id="api-options">
|
||||
Show:
|
||||
<label for="api-show-inherited">
|
||||
<input type="checkbox" id="api-show-inherited" checked>
|
||||
Inherited
|
||||
</label>
|
||||
|
||||
<label for="api-show-protected">
|
||||
<input type="checkbox" id="api-show-protected">
|
||||
Protected
|
||||
</label>
|
||||
|
||||
<label for="api-show-private">
|
||||
<input type="checkbox" id="api-show-private">
|
||||
Private
|
||||
</label>
|
||||
<label for="api-show-deprecated">
|
||||
<input type="checkbox" id="api-show-deprecated">
|
||||
Deprecated
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="apidocs">
|
||||
<div id="docs-main">
|
||||
<div class="content">
|
||||
<h1 class="file-heading">File: src/pixi/textures/RenderTexture.js</h1>
|
||||
|
||||
<div class="file">
|
||||
<pre class="code prettyprint linenums">
|
||||
/**
|
||||
* @author Mat Groves http://matgroves.com/ @Doormat23
|
||||
*/
|
||||
|
||||
/**
|
||||
* A RenderTexture is a special texture that allows any pixi displayObject to be rendered to it.
|
||||
* @class RenderTexture
|
||||
* @extends Texture
|
||||
* @constructor
|
||||
* @param width {Number}
|
||||
* @param height {Number}
|
||||
*/
|
||||
PIXI.RenderTexture = function(width, height)
|
||||
{
|
||||
PIXI.EventTarget.call( this );
|
||||
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
|
||||
this.indetityMatrix = PIXI.mat3.create();
|
||||
|
||||
this.frame = new PIXI.Rectangle(0, 0, this.width, this.height);
|
||||
|
||||
if(PIXI.gl)
|
||||
{
|
||||
this.initWebGL();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.initCanvas();
|
||||
}
|
||||
}
|
||||
|
||||
PIXI.RenderTexture.constructor = PIXI.RenderTexture;
|
||||
PIXI.RenderTexture.prototype = Object.create( PIXI.Texture.prototype );
|
||||
|
||||
PIXI.RenderTexture.prototype.initWebGL = function()
|
||||
{
|
||||
var gl = PIXI.gl;
|
||||
this.glFramebuffer = gl.createFramebuffer();
|
||||
|
||||
gl.bindFramebuffer(gl.FRAMEBUFFER, this.glFramebuffer );
|
||||
|
||||
this.glFramebuffer.width = this.width;
|
||||
this.glFramebuffer.height = this.height;
|
||||
|
||||
this.baseTexture = new PIXI.BaseTexture();
|
||||
|
||||
this.baseTexture.width = this.width;
|
||||
this.baseTexture.height = this.height;
|
||||
|
||||
this.baseTexture._glTexture = gl.createTexture();
|
||||
gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture);
|
||||
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
|
||||
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
||||
|
||||
this.baseTexture.isRender = true;
|
||||
|
||||
gl.bindFramebuffer(gl.FRAMEBUFFER, this.glFramebuffer );
|
||||
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.baseTexture._glTexture, 0);
|
||||
|
||||
// create a projection matrix..
|
||||
this.projectionMatrix = PIXI.mat4.create();
|
||||
|
||||
this.projectionMatrix[5] = 2/this.height// * 0.5;
|
||||
this.projectionMatrix[13] = -1;
|
||||
|
||||
this.projectionMatrix[0] = 2/this.width;
|
||||
this.projectionMatrix[12] = -1;
|
||||
|
||||
// set the correct render function..
|
||||
this.render = this.renderWebGL;
|
||||
}
|
||||
|
||||
PIXI.RenderTexture.prototype.initCanvas = function()
|
||||
{
|
||||
this.renderer = new PIXI.CanvasRenderer(this.width, this.height, null, 0);
|
||||
|
||||
this.baseTexture = new PIXI.BaseTexture(this.renderer.view);
|
||||
this.frame = new PIXI.Rectangle(0, 0, this.width, this.height);
|
||||
|
||||
this.render = this.renderCanvas;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will draw the display object to the texture.
|
||||
* @method render
|
||||
* @param displayObject {DisplayObject}
|
||||
* @param clear {Boolean} If true the texture will not be cleared before the displayObject is drawn
|
||||
*/
|
||||
PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, clear)
|
||||
{
|
||||
var gl = PIXI.gl;
|
||||
|
||||
// enable the alpha color mask..
|
||||
gl.colorMask(true, true, true, true);
|
||||
|
||||
gl.viewport(0, 0, this.width, this.height);
|
||||
|
||||
gl.bindFramebuffer(gl.FRAMEBUFFER, this.glFramebuffer );
|
||||
|
||||
if(clear)
|
||||
{
|
||||
gl.clearColor(0,0,0, 0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
// set the flipped matrix..
|
||||
gl.uniformMatrix4fv(renderer.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
|
||||
|
||||
// THIS WILL MESS WITH HIT TESTING!
|
||||
var children = displayObject.children;
|
||||
|
||||
//TODO -? create a new one??? dont think so!
|
||||
displayObject.worldTransform = this.indetityMatrix;
|
||||
|
||||
for(var i=0,j=children.length; i<j; i++)
|
||||
{
|
||||
children[i].updateTransform();
|
||||
}
|
||||
|
||||
var renderGroup = displayObject.__renderGroup ;
|
||||
|
||||
if(renderGroup)
|
||||
{
|
||||
if(displayObject == renderGroup.root)
|
||||
{
|
||||
renderGroup.render();
|
||||
}
|
||||
else
|
||||
{
|
||||
renderGroup.renderSpecific(displayObject);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!this.renderGroup)this.renderGroup = new PIXI.WebGLRenderGroup(gl);
|
||||
this.renderGroup.setRenderable(displayObject);
|
||||
|
||||
this.renderGroup.render();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PIXI.RenderTexture.prototype.renderCanvas = function(displayObject, clear)
|
||||
{
|
||||
var children = displayObject.children;
|
||||
|
||||
displayObject.worldTransform = this.indetityMatrix;
|
||||
|
||||
for(var i=0,j=children.length; i<j; i++)
|
||||
{
|
||||
children[i].updateTransform();
|
||||
}
|
||||
|
||||
if(clear)this.renderer.context.clearRect(0,0, this.width, this.height);
|
||||
this.renderer.renderDisplayObject(displayObject);
|
||||
|
||||
PIXI.texturesToUpdate.push(this.baseTexture);
|
||||
}
|
||||
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../assets/vendor/prettify/prettify-min.js"></script>
|
||||
<script>prettyPrint();</script>
|
||||
<script src="../assets/js/yui-prettify.js"></script>
|
||||
<script src="../assets/../api.js"></script>
|
||||
<script src="../assets/js/api-filter.js"></script>
|
||||
<script src="../assets/js/api-list.js"></script>
|
||||
<script src="../assets/js/api-search.js"></script>
|
||||
<script src="../assets/js/apidocs.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -288,6 +290,7 @@ PIXI.Texture.fromCanvas = function(canvas)
|
|||
/**
|
||||
*
|
||||
* Adds a texture to the textureCache.
|
||||
* @static
|
||||
* @method addTextureToCache
|
||||
* @param texture {Texture}
|
||||
* @param id {String} the id that the texture will be stored against.
|
||||
|
@ -300,6 +303,7 @@ PIXI.Texture.addTextureToCache = function(texture, id)
|
|||
/**
|
||||
*
|
||||
* Remove a texture from the textureCache.
|
||||
* @static
|
||||
* @method removeTextureFromCache
|
||||
* @param id {String} the id of the texture to be removed
|
||||
* @return {Texture} the texture that was removed
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="./classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="./classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="./classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="./classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/RenderTexture.html">RenderTexture</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
@ -232,6 +234,12 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<li class="module-class">
|
||||
<a href="../classes/RenderTexture.html">
|
||||
RenderTexture
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="module-class">
|
||||
<a href="../classes/Sprite.html">
|
||||
Sprite
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>pixi.js example 3 using a movieclip</title>
|
||||
<title>pixi.js example 10 using a movieclip</title>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
|
@ -10,6 +10,13 @@
|
|||
}
|
||||
</style>
|
||||
<script src="pixi.js"></script>
|
||||
<script src="../../src/pixi/DisplayObjectContainer.js"></script>
|
||||
<script src="../../src/pixi/renderers/WebGLRenderGroup.js"></script>
|
||||
<script src="../../src/pixi/renderers/WebGLRenderer.js"></script>
|
||||
<script src="../../src/pixi/textures/RenderTexture.js"></script>
|
||||
<script src="../../src/pixi/renderers/WebGLBatch.js"></script>
|
||||
<script src="../../src/pixi/renderers/CanvasRenderer.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
@ -33,7 +40,7 @@
|
|||
var count = 0;
|
||||
|
||||
// create an new instance of a pixi stage
|
||||
var stage = new PIXI.Stage(0xFFFFFF);;
|
||||
var stage = new PIXI.Stage(0xFFF0FF, true);;
|
||||
|
||||
// create a renderer instance.
|
||||
renderer = PIXI.autoDetectRenderer(800, 600);
|
||||
|
@ -41,6 +48,27 @@
|
|||
// add the renderer view element to the DOM
|
||||
document.body.appendChild(renderer.view);
|
||||
|
||||
// DOOMP
|
||||
var renderTexture = new PIXI.RenderTexture(256, 256)/////* 2, 128 * 2);
|
||||
var sprite = new PIXI.Sprite(renderTexture);
|
||||
|
||||
var renderTexture2 = new PIXI.RenderTexture(256, 256)/////* 2, 128 * 2);
|
||||
var sprite2 = new PIXI.Sprite(renderTexture2);
|
||||
//sprite.anchor.x = 0.5;
|
||||
//sprite.anchor.y = 0.5;
|
||||
//sprite.scale.y = .5;
|
||||
// sprite.position.x = 300;
|
||||
// sprite.position.y = 200;
|
||||
var bg = PIXI.Sprite.fromImage("button_test_BG.png");
|
||||
stage.addChild(bg)
|
||||
var container = new PIXI.DisplayObjectContainer();
|
||||
var container2 = new PIXI.DisplayObjectContainer();
|
||||
|
||||
stage.addChild(container);
|
||||
container.addChild(container2);
|
||||
//
|
||||
|
||||
stage.addChild(sprite2);
|
||||
function onAssetsLoaded()
|
||||
{
|
||||
// create an array to store the textures
|
||||
|
@ -52,40 +80,125 @@
|
|||
explosionTextures.push(texture);
|
||||
};
|
||||
|
||||
// explosionTextures.push(PIXI.Texture.fromImage("button_test_BG.png"));
|
||||
|
||||
// create a texture from an image path
|
||||
// add a bunch of aliens
|
||||
for (var i = 0; i < 50; i++)
|
||||
for (var i = 0; i < 150; i++)
|
||||
{
|
||||
// create an explosion MovieClip
|
||||
var explosion = new PIXI.MovieClip(explosionTextures);
|
||||
|
||||
|
||||
explosion.position.x = Math.random() * 800;
|
||||
explosion.position.y = Math.random() * 600;
|
||||
explosion.anchor.x = 0.5;
|
||||
explosion.anchor.y = 0.5;
|
||||
//if(i % 2)
|
||||
{
|
||||
explosion = new PIXI.MovieClip([PIXI.Texture.fromImage("button_test_BG.png")]);
|
||||
container2.addChild(explosion);
|
||||
}
|
||||
// else
|
||||
{
|
||||
// container.addChild(explosion);
|
||||
}
|
||||
|
||||
explosion.rotation = Math.random() * Math.PI;
|
||||
explosion.scale.x = explosion.scale.y = 0.75 + Math.random() * 0.5
|
||||
explosion.position.x = Math.random() * 800;
|
||||
explosion.position.y =Math.random() * 600;
|
||||
// explosion.anchor.x = 0.5;
|
||||
//explosion.anchor.y = 0.5;
|
||||
// 670 × 432
|
||||
// explosion.pivot.x = 670/2;
|
||||
explosion.pivot.y = 432/2;
|
||||
|
||||
//explosion.rotation = Math.random() * Math.PI;
|
||||
explosion.scale.x = explosion.scale.y = 1//0.3//0.75 + Math.random() * 0.5
|
||||
explosion.animationSpeed = 0.1
|
||||
explosion.gotoAndPlay(Math.random() * 27);
|
||||
|
||||
stage.addChild(explosion);
|
||||
|
||||
explosion.buttonMode = true;
|
||||
|
||||
// TODO BUG>??
|
||||
explosion.setInteractive(true);
|
||||
|
||||
explosion.click = function(){
|
||||
|
||||
// console.log("REMOVEIN!")
|
||||
//this.visible = false;
|
||||
this.rotation += Math.PI/10
|
||||
// this.parent.removeChild(this);
|
||||
}
|
||||
}
|
||||
|
||||
//∆∆container2.addChild();
|
||||
|
||||
stage.addChild(sprite);
|
||||
sprite.alpha = 1
|
||||
sprite.position.x = 300;
|
||||
sprite.position.y = 300;
|
||||
// start animating
|
||||
requestAnimFrame( animate );
|
||||
|
||||
//container.alpha = 0.5
|
||||
|
||||
}
|
||||
bloop= true;
|
||||
|
||||
function animate() {
|
||||
|
||||
|
||||
//sprite.rotation += 0.01;
|
||||
// console.log(stage.children)
|
||||
|
||||
requestAnimFrame( animate );
|
||||
|
||||
//stage.children[2]);
|
||||
renderer.render(stage);
|
||||
|
||||
// if(count < 100)
|
||||
{
|
||||
bloop = !bloop;
|
||||
|
||||
if(bloop )
|
||||
{
|
||||
// container.visible = false;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// container.visible = true;
|
||||
|
||||
renderTexture2.render(bg, true);
|
||||
}
|
||||
|
||||
}
|
||||
count++;
|
||||
|
||||
if(count == 100)
|
||||
{
|
||||
// alert("!")
|
||||
// stage.removeChild(container);
|
||||
// renderTexture.render(container, true);
|
||||
//}
|
||||
// else if(count > 200)
|
||||
//{
|
||||
}
|
||||
|
||||
if(count == 200)
|
||||
{
|
||||
//
|
||||
// stage.addChild(container);
|
||||
//container.removeChild(container2);
|
||||
}
|
||||
|
||||
if(count > 300)
|
||||
{
|
||||
// renderTexture2.render(container, true);
|
||||
//sprite2.scale.x = 10
|
||||
// renderTexture.render(container, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
renderTexture2.render(container, true);
|
||||
}
|
||||
// container.visible = false;
|
||||
}
|
||||
|
||||
|
||||
count = 0;
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -23,6 +23,13 @@ PIXI.DisplayObject = function()
|
|||
*/
|
||||
this.scale = new PIXI.Point(1,1);//{x:1, y:1};
|
||||
|
||||
/**
|
||||
* The pivot point of the displayObject that it rotates around
|
||||
* @property pivot
|
||||
* @type Point
|
||||
*/
|
||||
this.pivot = new PIXI.Point(0,0);
|
||||
|
||||
/**
|
||||
* The rotation of the object in radians.
|
||||
* @property rotation
|
||||
|
@ -43,7 +50,7 @@ PIXI.DisplayObject = function()
|
|||
* @type Boolean
|
||||
*/
|
||||
this.visible = true;
|
||||
this.cacheVisible = false;
|
||||
this.worldVisible = false;
|
||||
|
||||
/**
|
||||
* [read-only] The display object container that contains this display object.
|
||||
|
@ -204,9 +211,16 @@ PIXI.DisplayObject.prototype.updateTransform = function()
|
|||
localTransform[4] = this._cr * this.scale.y;
|
||||
|
||||
///AAARR GETTER SETTTER!
|
||||
localTransform[2] = this.position.x;
|
||||
localTransform[5] = this.position.y;
|
||||
//localTransform[2] = this.position.x;
|
||||
//localTransform[5] = this.position.y;
|
||||
|
||||
var px = this.pivot.x;
|
||||
var py = this.pivot.y;
|
||||
|
||||
///AAARR GETTER SETTTER!
|
||||
localTransform[2] = this.position.x - localTransform[0] * px - py * localTransform[1];
|
||||
localTransform[5] = this.position.y - localTransform[4] * py - px * localTransform[3];
|
||||
|
||||
// Cache the matrix values (makes for huge speed increases!)
|
||||
var a00 = localTransform[0], a01 = localTransform[1], a02 = localTransform[2],
|
||||
a10 = localTransform[3], a11 = localTransform[4], a12 = localTransform[5],
|
||||
|
@ -224,5 +238,7 @@ PIXI.DisplayObject.prototype.updateTransform = function()
|
|||
|
||||
// because we are using affine transformation, we can optimise the matrix concatenation process.. wooo!
|
||||
// mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
|
||||
this.worldAlpha = this.alpha * this.parent.worldAlpha;
|
||||
this.worldAlpha = this.alpha * this.parent.worldAlpha;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -35,17 +35,27 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
{
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
child.parent.removeChild(child)
|
||||
child.parent.removeChild(child);
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
child.childIndex = this.children.length;
|
||||
|
||||
this.children.push(child);
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
this.stage.__addChild(child);
|
||||
}
|
||||
|
||||
// need to remove any render groups..
|
||||
if(this.__renderGroup)
|
||||
{
|
||||
// being used by a renderTexture.. if it exists then it must be from a render texture;
|
||||
if(child.__renderGroup)child.__renderGroup.removeDisplayObjectAndChildren(child);
|
||||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -85,6 +95,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
{
|
||||
this.stage.__addChild(child);
|
||||
}
|
||||
|
||||
// little webGL!
|
||||
if(this.__renderGroup)
|
||||
{
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -160,12 +176,23 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
if(this.stage)this.stage.__removeChild(child);
|
||||
if(this.stage)
|
||||
{
|
||||
this.stage.__removeChild(child);
|
||||
}
|
||||
// console.log(child.__renderGroup);
|
||||
if(child.__renderGroup)
|
||||
{
|
||||
// console.log(">?")
|
||||
child.__renderGroup.removeDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
// console.log(">" + child.__renderGroup)
|
||||
child.parent = undefined;
|
||||
//child.childIndex = 0
|
||||
|
||||
this.children.splice( index, 1 );
|
||||
|
||||
// update in dexs!
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
|
||||
/**
|
||||
The interaction manager deals with mouse and touch events. At this moment only Sprite's can be interactive.
|
||||
The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive
|
||||
This manager also supports multitouch.
|
||||
@class InteractionManager
|
||||
@constructor
|
||||
|
@ -119,6 +119,8 @@ PIXI.InteractionManager.prototype.setTarget = function(target)
|
|||
|
||||
PIXI.InteractionManager.prototype.update = function()
|
||||
{
|
||||
if(!this.target)return;
|
||||
|
||||
// frequency of 30fps??
|
||||
var now = Date.now();
|
||||
var diff = now - this.last;
|
||||
|
@ -150,7 +152,7 @@ PIXI.InteractionManager.prototype.update = function()
|
|||
// loop through interactive objects!
|
||||
var length = this.interactiveItems.length;
|
||||
|
||||
if(this.target)this.target.view.style.cursor = "default";
|
||||
this.target.view.style.cursor = "default";
|
||||
|
||||
for (var i = 0; i < length; i++)
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@ PIXI.Stage = function(backgroundColor, interactive)
|
|||
{
|
||||
|
||||
PIXI.DisplayObjectContainer.call( this );
|
||||
this.worldTransform = PIXI.mat3.create()//.//identity();
|
||||
this.worldTransform = PIXI.mat3.create()
|
||||
this.__childrenAdded = [];
|
||||
this.__childrenRemoved = [];
|
||||
this.childIndex = 0;
|
||||
|
@ -27,6 +27,7 @@ PIXI.Stage = function(backgroundColor, interactive)
|
|||
this.interactionManager = new PIXI.InteractionManager(this);
|
||||
|
||||
this.setBackgroundColor(backgroundColor);
|
||||
this.worldVisible = true;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -99,15 +100,13 @@ PIXI.Stage.prototype.__removeChild = function(child)
|
|||
{
|
||||
if(child.interactive)this.dirty = true;
|
||||
|
||||
this.__childrenRemoved.push(child);
|
||||
|
||||
child.stage = undefined;
|
||||
|
||||
if(child.children)
|
||||
{
|
||||
for(var i=0,j=child.children.length; i<j; i++)
|
||||
{
|
||||
this.__removeChild(child.children[i])
|
||||
this.__removeChild(child.children[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,14 +79,12 @@ PIXI.CanvasRenderer.prototype.render = function(stage)
|
|||
PIXI.texturesToUpdate = [];
|
||||
PIXI.texturesToDestroy = [];
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
stage.updateTransform();
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
|
||||
// update the background color
|
||||
if(this.view.style.backgroundColor!=stage.backgroundColorString && !this.transparent)this.view.style.backgroundColor = stage.backgroundColorString;
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
this.context.clearRect(0, 0, this.width, this.height)
|
||||
this.renderDisplayObject(stage);
|
||||
//as
|
||||
|
@ -130,7 +128,7 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
var context = this.context;
|
||||
context.globalCompositeOperation = "source-over"
|
||||
//context.globalCompositeOperation = "source-over"
|
||||
var blit = false;
|
||||
|
||||
if(!displayObject.visible)return;
|
||||
|
@ -167,14 +165,18 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
else
|
||||
{*/
|
||||
blit = false;
|
||||
context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5])
|
||||
context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]);
|
||||
|
||||
context.drawImage(displayObject.texture.baseTexture.source,
|
||||
frame.x,
|
||||
frame.y,
|
||||
frame.width,
|
||||
frame.height,
|
||||
(displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width,
|
||||
(displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
|
||||
(displayObject.anchor.x) * -frame.width,
|
||||
(displayObject.anchor.y) * -frame.height,
|
||||
// (displayObject.anchor.x - displayObject.texture.trim.x) * -frame.width,
|
||||
// (displayObject.anchor.y - displayObject.texture.trim.y) * -frame.height,
|
||||
|
||||
frame.width,
|
||||
frame.height);
|
||||
//}
|
||||
|
@ -197,7 +199,7 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
this.renderDisplayObject(displayObject.children[i]);
|
||||
}
|
||||
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -414,73 +414,95 @@ PIXI.WebGLBatch.prototype.update = function()
|
|||
|
||||
while(displayObject)
|
||||
{
|
||||
width = displayObject.texture.frame.width;
|
||||
height = displayObject.texture.frame.height;
|
||||
|
||||
aX = displayObject.anchor.x - displayObject.texture.trim.x
|
||||
aY = displayObject.anchor.y - displayObject.texture.trim.y
|
||||
w0 = width * (1-aX);
|
||||
w1 = width * -aX;
|
||||
|
||||
h0 = height * (1-aY);
|
||||
h1 = height * -aY;
|
||||
|
||||
index = indexRun * 8;
|
||||
|
||||
worldTransform = displayObject.worldTransform;
|
||||
if(displayObject.worldVisible)
|
||||
{
|
||||
width = displayObject.texture.frame.width;
|
||||
height = displayObject.texture.frame.height;
|
||||
|
||||
// TODO trim??
|
||||
aX = displayObject.anchor.x;// - displayObject.texture.trim.x
|
||||
aY = displayObject.anchor.y; //- displayObject.texture.trim.y
|
||||
w0 = width * (1-aX);
|
||||
w1 = width * -aX;
|
||||
|
||||
h0 = height * (1-aY);
|
||||
h1 = height * -aY;
|
||||
|
||||
index = indexRun * 8;
|
||||
|
||||
a = worldTransform[0];
|
||||
b = worldTransform[3];
|
||||
c = worldTransform[1];
|
||||
d = worldTransform[4];
|
||||
tx = worldTransform[2];
|
||||
ty = worldTransform[5];
|
||||
worldTransform = displayObject.worldTransform;
|
||||
|
||||
this.verticies[index + 0 ] = a * w1 + c * h1 + tx;
|
||||
this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
|
||||
|
||||
this.verticies[index + 2 ] = a * w0 + c * h1 + tx;
|
||||
this.verticies[index + 3 ] = d * h1 + b * w0 + ty;
|
||||
a = worldTransform[0];
|
||||
b = worldTransform[3];
|
||||
c = worldTransform[1];
|
||||
d = worldTransform[4];
|
||||
tx = worldTransform[2];
|
||||
ty = worldTransform[5];
|
||||
|
||||
this.verticies[index + 4 ] = a * w0 + c * h0 + tx;
|
||||
this.verticies[index + 5 ] = d * h0 + b * w0 + ty;
|
||||
|
||||
this.verticies[index + 6] = a * w1 + c * h0 + tx;
|
||||
this.verticies[index + 7] = d * h0 + b * w1 + ty;
|
||||
|
||||
if(displayObject.updateFrame || displayObject.texture.updateFrame)
|
||||
{
|
||||
this.dirtyUVS = true;
|
||||
this.verticies[index + 0 ] = a * w1 + c * h1 + tx;
|
||||
this.verticies[index + 1 ] = d * h1 + b * w1 + ty;
|
||||
|
||||
this.verticies[index + 2 ] = a * w0 + c * h1 + tx;
|
||||
this.verticies[index + 3 ] = d * h1 + b * w0 + ty;
|
||||
|
||||
var texture = displayObject.texture;
|
||||
this.verticies[index + 4 ] = a * w0 + c * h0 + tx;
|
||||
this.verticies[index + 5 ] = d * h0 + b * w0 + ty;
|
||||
|
||||
var frame = texture.frame;
|
||||
var tw = texture.baseTexture.width;
|
||||
var th = texture.baseTexture.height;
|
||||
this.verticies[index + 6] = a * w1 + c * h0 + tx;
|
||||
this.verticies[index + 7] = d * h0 + b * w1 + ty;
|
||||
|
||||
this.uvs[index + 0] = frame.x / tw;
|
||||
this.uvs[index +1] = frame.y / th;
|
||||
|
||||
this.uvs[index +2] = (frame.x + frame.width) / tw;
|
||||
this.uvs[index +3] = frame.y / th;
|
||||
if(displayObject.updateFrame || displayObject.texture.updateFrame)
|
||||
{
|
||||
this.dirtyUVS = true;
|
||||
|
||||
var texture = displayObject.texture;
|
||||
|
||||
var frame = texture.frame;
|
||||
var tw = texture.baseTexture.width;
|
||||
var th = texture.baseTexture.height;
|
||||
|
||||
this.uvs[index + 0] = frame.x / tw;
|
||||
this.uvs[index +1] = frame.y / th;
|
||||
|
||||
this.uvs[index +2] = (frame.x + frame.width) / tw;
|
||||
this.uvs[index +3] = frame.y / th;
|
||||
|
||||
this.uvs[index +4] = (frame.x + frame.width) / tw;
|
||||
this.uvs[index +5] = (frame.y + frame.height) / th;
|
||||
|
||||
this.uvs[index +6] = frame.x / tw;
|
||||
this.uvs[index +7] = (frame.y + frame.height) / th;
|
||||
|
||||
displayObject.updateFrame = false;
|
||||
}
|
||||
|
||||
this.uvs[index +4] = (frame.x + frame.width) / tw;
|
||||
this.uvs[index +5] = (frame.y + frame.height) / th;
|
||||
|
||||
this.uvs[index +6] = frame.x / tw;
|
||||
this.uvs[index +7] = (frame.y + frame.height) / th;
|
||||
|
||||
displayObject.updateFrame = false;
|
||||
// TODO this probably could do with some optimisation....
|
||||
if(displayObject.cacheAlpha != displayObject.worldAlpha)
|
||||
{
|
||||
displayObject.cacheAlpha = displayObject.worldAlpha;
|
||||
|
||||
var colorIndex = indexRun * 4;
|
||||
this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
|
||||
this.dirtyColors = true;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO this probably could do with some optimisation....
|
||||
if(displayObject.cacheAlpha != displayObject.worldAlpha)
|
||||
else
|
||||
{
|
||||
displayObject.cacheAlpha = displayObject.worldAlpha;
|
||||
index = indexRun * 8;
|
||||
|
||||
var colorIndex = indexRun * 4;
|
||||
this.colors[colorIndex] = this.colors[colorIndex + 1] = this.colors[colorIndex + 2] = this.colors[colorIndex + 3] = displayObject.worldAlpha;
|
||||
this.dirtyColors = true;
|
||||
this.verticies[index + 0 ] = 0;
|
||||
this.verticies[index + 1 ] = 0;
|
||||
|
||||
this.verticies[index + 2 ] = 0;
|
||||
this.verticies[index + 3 ] = 0;
|
||||
|
||||
this.verticies[index + 4 ] = 0;
|
||||
this.verticies[index + 5 ] = 0;
|
||||
|
||||
this.verticies[index + 6] = 0;
|
||||
this.verticies[index + 7] = 0;
|
||||
}
|
||||
|
||||
indexRun++;
|
||||
|
@ -492,8 +514,13 @@ PIXI.WebGLBatch.prototype.update = function()
|
|||
* Draws the batch to the frame buffer
|
||||
* @method render
|
||||
*/
|
||||
PIXI.WebGLBatch.prototype.render = function()
|
||||
PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||
{
|
||||
// console.log(start + " :: " + end + " : " + this.size);
|
||||
start = start || 0;
|
||||
//end = end || this.size;
|
||||
if(end == undefined)end = this.size;
|
||||
|
||||
if(this.dirty)
|
||||
{
|
||||
this.refresh();
|
||||
|
@ -506,16 +533,10 @@ PIXI.WebGLBatch.prototype.render = function()
|
|||
var gl = this.gl;
|
||||
|
||||
//TODO optimize this!
|
||||
if(this.blendMode == PIXI.blendModes.NORMAL)
|
||||
{
|
||||
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
else
|
||||
{
|
||||
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
|
||||
}
|
||||
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
var shaderProgram = PIXI.shaderProgram;
|
||||
gl.useProgram(shaderProgram);
|
||||
|
||||
// update the verts..
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
|
||||
|
@ -550,8 +571,12 @@ PIXI.WebGLBatch.prototype.render = function()
|
|||
|
||||
// dont need to upload!
|
||||
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
|
||||
|
||||
|
||||
|
||||
//var startIndex = 0//1;
|
||||
var len = end - start;
|
||||
// console.log(this.size)
|
||||
// DRAW THAT this!
|
||||
gl.drawElements(gl.TRIANGLES, this.size * 6, gl.UNSIGNED_SHORT, 0);
|
||||
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||
}
|
||||
|
||||
|
|
556
src/pixi/renderers/WebGLRenderGroup.js
Normal file
556
src/pixi/renderers/WebGLRenderGroup.js
Normal file
|
@ -0,0 +1,556 @@
|
|||
/**
|
||||
* @author Mat Groves http://matgroves.com/ @Doormat23
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A WebGLBatch Enables a group of sprites to be drawn using the same settings.
|
||||
* if a group of sprites all have the same baseTexture and blendMode then they can be grouped into a batch. All the sprites in a batch can then be drawn in one go by the GPU which is hugely efficient. ALL sprites in the webGL renderer are added to a batch even if the batch only contains one sprite. Batching is handled automatically by the webGL renderer. A good tip is: the smaller the number of batchs there are, the faster the webGL renderer will run.
|
||||
* @class WebGLBatch
|
||||
* @param an instance of the webGL context
|
||||
* @return {PIXI.renderers.WebGLBatch} WebGLBatch {@link PIXI.renderers.WebGLBatch}
|
||||
*/
|
||||
PIXI.WebGLRenderGroup = function(gl)
|
||||
{
|
||||
this.gl = gl;
|
||||
this.root;
|
||||
|
||||
this.backgroundColor;
|
||||
this.batchs = [];
|
||||
this.toRemove = [];
|
||||
}
|
||||
|
||||
|
||||
// constructor
|
||||
PIXI.WebGLRenderGroup.constructor = PIXI.WebGLRenderGroup;
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.setRenderable = function(displayObject)
|
||||
{
|
||||
// has this changed??
|
||||
if(this.root)this.removeDisplayObjectAndChildren(this.root);
|
||||
|
||||
//console.log("!!!");
|
||||
// TODO what if its already has an object? should remove it
|
||||
this.root = displayObject;
|
||||
//displayObject.__renderGroup = this;
|
||||
this.addDisplayObjectAndChildren(displayObject);
|
||||
//displayObject
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.render = function(renderTexture)
|
||||
{
|
||||
|
||||
var gl = this.gl;
|
||||
|
||||
for (var i=0; i < this.toRemove.length; i++)
|
||||
{
|
||||
this.removeDisplayObjectAndChildren(this.toRemove[i]);
|
||||
};
|
||||
|
||||
this.toRemove = [];
|
||||
|
||||
this.checkVisibility(this.root, this.root.visible);
|
||||
|
||||
// will render all the elements in the group
|
||||
var renderable;
|
||||
for (var i=0; i < this.batchs.length; i++)
|
||||
{
|
||||
renderable = this.batchs[i];
|
||||
if(renderable instanceof PIXI.WebGLBatch)
|
||||
{
|
||||
this.batchs[i].render();
|
||||
}
|
||||
else if(renderable instanceof PIXI.TilingSprite)
|
||||
{
|
||||
if(renderable.visible)this.renderTilingSprite(renderable);
|
||||
}
|
||||
else if(renderable instanceof PIXI.Strip)
|
||||
{
|
||||
if(renderable.visible)this.renderStrip(renderable);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.renderSpecific = function(displayObject, renderTexture)
|
||||
{
|
||||
var gl = this.gl;
|
||||
this.checkVisibility(displayObject, displayObject.visible);
|
||||
|
||||
|
||||
//console.log("SPECIFIC");
|
||||
// to do!
|
||||
// render part of the scene...
|
||||
|
||||
var startIndex;
|
||||
var startBatchIndex;
|
||||
|
||||
var endIndex;
|
||||
var endBatchIndex;
|
||||
|
||||
// get NEXT Renderable!
|
||||
var nextRenderable = displayObject.renderable ? displayObject : this.getNextRenderable(displayObject);
|
||||
var startBatch = nextRenderable.batch;
|
||||
|
||||
if(nextRenderable instanceof PIXI.Sprite)
|
||||
{
|
||||
startBatch = nextRenderable.batch;
|
||||
|
||||
var head = startBatch.head;
|
||||
var next = head;
|
||||
|
||||
// ok now we have the batch.. need to find the start index!
|
||||
if(head == nextRenderable)
|
||||
{
|
||||
startIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
startIndex = 1;
|
||||
|
||||
while(head.__next != nextRenderable)
|
||||
{
|
||||
startIndex++;
|
||||
head = head.__next;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
startBatch = nextRenderable;
|
||||
}
|
||||
|
||||
// Get the LAST renderable object
|
||||
var lastRenderable = displayObject;
|
||||
var endBatch;
|
||||
var lastItem = displayObject;
|
||||
while(lastItem.children.length > 0)
|
||||
{
|
||||
lastItem = lastItem.children[lastItem.children.length-1];
|
||||
if(lastItem.renderable)lastRenderable = lastItem;
|
||||
}
|
||||
|
||||
if(lastRenderable instanceof PIXI.Sprite)
|
||||
{
|
||||
endBatch = lastRenderable.batch;
|
||||
|
||||
var head = endBatch.head;
|
||||
|
||||
if(head == lastRenderable)
|
||||
{
|
||||
endIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
endIndex = 1;
|
||||
|
||||
while(head.__next != lastRenderable)
|
||||
{
|
||||
endIndex++;
|
||||
head = head.__next;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
endBatch = lastRenderable;
|
||||
}
|
||||
|
||||
// now we have first and last!
|
||||
startBatchIndex = this.batchs.indexOf(startBatch);
|
||||
endBatchIndex = this.batchs.indexOf(endBatch);
|
||||
|
||||
// DO the first batch
|
||||
if(startBatch instanceof PIXI.WebGLBatch)
|
||||
{
|
||||
startBatch.render(startIndex);
|
||||
}
|
||||
else if(startBatch instanceof PIXI.TilingSprite)
|
||||
{
|
||||
if(startBatch.visible)this.renderTilingSprite(startBatch);
|
||||
}
|
||||
else if(startBatch instanceof PIXI.Strip)
|
||||
{
|
||||
if(startBatch.visible)this.renderStrip(startBatch);
|
||||
}
|
||||
|
||||
// DO the middle batchs..
|
||||
for (var i=startBatchIndex+1; i < endBatchIndex; i++)
|
||||
{
|
||||
renderable = this.batchs[i];
|
||||
|
||||
if(renderable instanceof PIXI.WebGLBatch)
|
||||
{
|
||||
this.batchs[i].render();
|
||||
}
|
||||
else if(renderable instanceof PIXI.TilingSprite)
|
||||
{
|
||||
if(renderable.visible)this.renderTilingSprite(renderable);
|
||||
}
|
||||
else if(renderable instanceof PIXI.Strip)
|
||||
{
|
||||
if(renderable.visible)this.renderStrip(renderable);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// DO the last batch..
|
||||
if(endBatch instanceof PIXI.WebGLBatch)
|
||||
{
|
||||
endBatch.render(0, endIndex+1);
|
||||
}
|
||||
else if(endBatch instanceof PIXI.TilingSprite)
|
||||
{
|
||||
if(endBatch.visible)this.renderTilingSprite(endBatch);
|
||||
}
|
||||
else if(endBatch instanceof PIXI.Strip)
|
||||
{
|
||||
if(endBatch.visible)this.renderStrip(endBatch);
|
||||
}
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.checkVisibility = function(displayObject, globalVisible)
|
||||
{
|
||||
// give the dp a refference to its renderGroup...
|
||||
var children = displayObject.children;
|
||||
//displayObject.worldVisible = globalVisible;
|
||||
for (var i=0; i < children.length; i++)
|
||||
{
|
||||
var child = children[i];
|
||||
|
||||
// TODO optimize... shouldt need to loop through everything all the time
|
||||
child.worldVisible = child.visible && globalVisible;
|
||||
|
||||
// everything should have a batch!
|
||||
// time to see whats new!
|
||||
if(child.textureChange)
|
||||
{
|
||||
child.textureChange = false;
|
||||
if(child.worldVisible)
|
||||
{
|
||||
this.removeDisplayObject(child)
|
||||
this.addDisplayObject(child)
|
||||
}
|
||||
// update texture!!
|
||||
}
|
||||
|
||||
if(child.children.length > 0)
|
||||
{
|
||||
this.checkVisibility(child, child.worldVisible);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.addDisplayObject = function(displayObject)
|
||||
{
|
||||
// add a child to the render group..
|
||||
displayObject.batch = null;
|
||||
displayObject.__renderGroup = this;
|
||||
|
||||
//displayObject.cacheVisible = true;
|
||||
if(!displayObject.renderable)return;
|
||||
|
||||
// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
|
||||
//displayObject.__inWebGL = true;
|
||||
|
||||
var previousSprite = this.getPreviousRenderable(displayObject);
|
||||
var nextSprite = this.getNextRenderable(displayObject);
|
||||
|
||||
|
||||
/*
|
||||
* so now we have the next renderable and the previous renderable
|
||||
*
|
||||
*/
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
{
|
||||
var previousBatch
|
||||
var nextBatch
|
||||
|
||||
//console.log( previousSprite)
|
||||
if(previousSprite instanceof PIXI.Sprite)
|
||||
{
|
||||
previousBatch = previousSprite.batch;
|
||||
if(previousBatch)
|
||||
{
|
||||
if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
|
||||
{
|
||||
previousBatch.insertAfter(displayObject, previousSprite);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO reword!
|
||||
previousBatch = previousSprite;
|
||||
}
|
||||
|
||||
if(nextSprite)
|
||||
{
|
||||
if(nextSprite instanceof PIXI.Sprite)
|
||||
{
|
||||
nextBatch = nextSprite.batch;
|
||||
|
||||
//batch may not exist if item was added to the display list but not to the webGL
|
||||
if(nextBatch)
|
||||
{
|
||||
if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
|
||||
{
|
||||
nextBatch.insertBefore(displayObject, nextSprite);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nextBatch == previousBatch)
|
||||
{
|
||||
// THERE IS A SPLIT IN THIS BATCH! //
|
||||
var splitBatch = previousBatch.split(nextSprite);
|
||||
// COOL!
|
||||
// add it back into the array
|
||||
/*
|
||||
* OOPS!
|
||||
* seems the new sprite is in the middle of a batch
|
||||
* lets split it..
|
||||
*/
|
||||
var batch = PIXI.WebGLRenderer.getBatch();
|
||||
|
||||
var index = this.batchs.indexOf( previousBatch );
|
||||
batch.init(displayObject);
|
||||
this.batchs.splice(index+1, 0, batch, splitBatch);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO re-word!
|
||||
nextBatch = nextSprite;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* looks like it does not belong to any batch!
|
||||
* but is also not intersecting one..
|
||||
* time to create anew one!
|
||||
*/
|
||||
|
||||
var batch = PIXI.WebGLRenderer.getBatch();
|
||||
batch.init(displayObject);
|
||||
|
||||
if(previousBatch) // if this is invalid it means
|
||||
{
|
||||
var index = this.batchs.indexOf( previousBatch );
|
||||
this.batchs.splice(index+1, 0, batch);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.batchs.push(batch);
|
||||
}
|
||||
|
||||
}
|
||||
else if(displayObject instanceof PIXI.TilingSprite)
|
||||
{
|
||||
// add to a batch!!
|
||||
this.initTilingSprite(displayObject);
|
||||
this.batchs.push(displayObject);
|
||||
|
||||
}
|
||||
else if(displayObject instanceof PIXI.Strip)
|
||||
{
|
||||
// add to a batch!!
|
||||
this.initStrip(displayObject);
|
||||
this.batchs.push(displayObject);
|
||||
}
|
||||
|
||||
// if its somthing else... then custom codes!
|
||||
this.batchUpdate = true;
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayObject)
|
||||
{
|
||||
// TODO - this can be faster - but not as important right now
|
||||
|
||||
this.addDisplayObject(displayObject);
|
||||
var children = displayObject.children;
|
||||
|
||||
for (var i=0; i < children.length; i++)
|
||||
{
|
||||
this.addDisplayObjectAndChildren(children[i]);
|
||||
};
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.removeDisplayObject = function(displayObject)
|
||||
{
|
||||
// loop through children..
|
||||
// display object //
|
||||
|
||||
// add a child from the render group..
|
||||
// remove it and all its children!
|
||||
//displayObject.cacheVisible = false;//displayObject.visible;
|
||||
displayObject.__renderGroup = null;
|
||||
|
||||
if(!displayObject.renderable)return;
|
||||
|
||||
/*
|
||||
* removing is a lot quicker..
|
||||
*
|
||||
*/
|
||||
var batchToRemove;
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
{
|
||||
// should always have a batch!
|
||||
var batch = displayObject.batch;
|
||||
if(!batch)return; // this means the display list has been altered befre rendering
|
||||
|
||||
batch.remove(displayObject);
|
||||
|
||||
if(batch.size==0)
|
||||
{
|
||||
batchToRemove = batch;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
batchToRemove = displayObject;
|
||||
}
|
||||
|
||||
/*
|
||||
* Looks like there is somthing that needs removing!
|
||||
*/
|
||||
if(batchToRemove)
|
||||
{
|
||||
var index = this.batchs.indexOf( batchToRemove );
|
||||
if(index == -1)return;// this means it was added then removed before rendered
|
||||
|
||||
// ok so.. check to see if you adjacent batchs should be joined.
|
||||
// TODO may optimise?
|
||||
if(index == 0 || index == this.batchs.length-1)
|
||||
{
|
||||
// wha - eva! just get of the empty batch!
|
||||
this.batchs.splice(index, 1);
|
||||
if(batchToRemove instanceof PIXI.WebGLBatch)PIXI.WebGLRenderer.returnBatch(batchToRemove);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
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 && this.batchs[index-1].blendMode == this.batchs[index+1].blendMode)
|
||||
{
|
||||
//console.log("MERGE")
|
||||
this.batchs[index-1].merge(this.batchs[index+1]);
|
||||
|
||||
if(batchToRemove instanceof PIXI.WebGLBatch)PIXI.WebGLRenderer.returnBatch(batchToRemove);
|
||||
PIXI.WebGLRenderer.returnBatch(this.batchs[index+1]);
|
||||
this.batchs.splice(index, 2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.batchs.splice(index, 1);
|
||||
if(batchToRemove instanceof PIXI.WebGLBatch)PIXI.WebGLRenderer.returnBatch(batchToRemove);
|
||||
}
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.removeDisplayObjectAndChildren = function(displayObject)
|
||||
{
|
||||
// TODO - this can be faster - but not as important right now
|
||||
if(displayObject.__renderGroup != this)return;
|
||||
|
||||
this.removeDisplayObject(displayObject);
|
||||
var children = displayObject.children;
|
||||
|
||||
for (var i=0; i < children.length; i++)
|
||||
{
|
||||
this.removeDisplayObjectAndChildren(children[i]);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.getNextRenderable = function(displayObject)
|
||||
{
|
||||
/*
|
||||
* LOOK FOR THE NEXT SPRITE
|
||||
* This part looks for the closest next sprite that can go into a batch
|
||||
* it keeps looking until it finds a sprite or gets to the end of the display
|
||||
* scene graph
|
||||
*
|
||||
* These look a lot scarier than the actually are...
|
||||
*/
|
||||
|
||||
var nextSprite = displayObject;
|
||||
do
|
||||
{
|
||||
// moving forward!
|
||||
// if it has no children..
|
||||
if(nextSprite.children.length == 0)
|
||||
{
|
||||
// go along to the parent..
|
||||
while(nextSprite.childIndex == nextSprite.parent.children.length-1)
|
||||
{
|
||||
nextSprite = nextSprite.parent;
|
||||
if(nextSprite == this.root)//displayObject.stage)
|
||||
{
|
||||
nextSprite = null
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
|
||||
}
|
||||
else
|
||||
{
|
||||
nextSprite = nextSprite.children[0];
|
||||
}
|
||||
|
||||
if(!nextSprite)break;
|
||||
}
|
||||
while(!nextSprite.renderable || !nextSprite.__renderGroup)
|
||||
|
||||
return nextSprite;
|
||||
}
|
||||
|
||||
PIXI.WebGLRenderGroup.prototype.getPreviousRenderable = function(displayObject)
|
||||
{
|
||||
/*
|
||||
* LOOK FOR THE PREVIOUS SPRITE
|
||||
* This part looks for the closest previous sprite that can go into a batch
|
||||
* It keeps going back until it finds a sprite or the stage
|
||||
*/
|
||||
var previousSprite = displayObject;
|
||||
do
|
||||
{
|
||||
if(previousSprite.childIndex == 0)
|
||||
{
|
||||
previousSprite = previousSprite.parent;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
|
||||
// what if the bloop has children???
|
||||
while(previousSprite.children.length != 0)
|
||||
{
|
||||
// keep diggin till we get to the last child
|
||||
previousSprite = previousSprite.children[previousSprite.children.length-1];
|
||||
}
|
||||
}
|
||||
|
||||
if(previousSprite == this.root)break;
|
||||
}
|
||||
while(!previousSprite.renderable || !previousSprite.__renderGroup);
|
||||
|
||||
return previousSprite;
|
||||
}
|
||||
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
|
||||
|
||||
// an instance of the gl context..
|
||||
// only one at the moment :/
|
||||
PIXI.gl;
|
||||
|
||||
/**
|
||||
* 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 :)
|
||||
|
@ -41,7 +45,7 @@ PIXI.WebGLRenderer = function(width, height, view, transparent)
|
|||
|
||||
try
|
||||
{
|
||||
this.gl = this.view.getContext("experimental-webgl", {
|
||||
PIXI.gl = this.gl = this.view.getContext("experimental-webgl", {
|
||||
alpha: this.transparent,
|
||||
antialias:false, // SPEED UP??
|
||||
premultipliedAlpha:true
|
||||
|
@ -56,15 +60,20 @@ PIXI.WebGLRenderer = function(width, height, view, transparent)
|
|||
|
||||
|
||||
var gl = this.gl;
|
||||
PIXI.WebGLRenderer.gl = gl;
|
||||
|
||||
this.batch = new PIXI.WebGLBatch(gl);
|
||||
gl.disable(gl.DEPTH_TEST);
|
||||
gl.disable(gl.CULL_FACE);
|
||||
gl.enable(gl.BLEND);
|
||||
gl.colorMask(true, true, true, this.transparent);
|
||||
|
||||
this.projectionMatrix = PIXI.mat4.create();
|
||||
this.resize(this.width, this.height)
|
||||
this.contextLost = false;
|
||||
|
||||
this.stageRenderGroup = new PIXI.WebGLRenderGroup(this.gl);
|
||||
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -73,11 +82,11 @@ PIXI.WebGLRenderer.constructor = PIXI.WebGLRenderer;
|
|||
/**
|
||||
* @private
|
||||
*/
|
||||
PIXI.WebGLRenderer.prototype.getBatch = function()
|
||||
PIXI.WebGLRenderer.getBatch = function()
|
||||
{
|
||||
if(PIXI._batchs.length == 0)
|
||||
{
|
||||
return new PIXI.WebGLBatch(this.gl);
|
||||
return new PIXI.WebGLBatch(PIXI.WebGLRenderer.gl);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -88,7 +97,7 @@ PIXI.WebGLRenderer.prototype.getBatch = function()
|
|||
/**
|
||||
* @private
|
||||
*/
|
||||
PIXI.WebGLRenderer.prototype.returnBatch = function(batch)
|
||||
PIXI.WebGLRenderer.returnBatch = function(batch)
|
||||
{
|
||||
batch.clean();
|
||||
PIXI._batchs.push(batch);
|
||||
|
@ -134,55 +143,6 @@ PIXI.WebGLRenderer.prototype.initShaders = function()
|
|||
PIXI.shaderProgram = this.shaderProgram;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PIXI.WebGLRenderer.prototype.checkVisibility = function(displayObject, globalVisible)
|
||||
{
|
||||
var children = displayObject.children;
|
||||
|
||||
|
||||
for (var i=0; i < children.length; i++)
|
||||
{
|
||||
var child = children[i];
|
||||
|
||||
// TODO optimize... shouldt need to loop through everything all the time
|
||||
var actualVisibility = child.visible && globalVisible;
|
||||
|
||||
// everything should have a batch!
|
||||
// time to see whats new!
|
||||
if(child.textureChange)
|
||||
{
|
||||
child.textureChange = false;
|
||||
if(actualVisibility)
|
||||
{
|
||||
this.removeDisplayObject(child)
|
||||
this.addDisplayObject(child)
|
||||
}
|
||||
// update texture!!
|
||||
}
|
||||
|
||||
if(child.cacheVisible != actualVisibility)
|
||||
{
|
||||
child.cacheVisible = actualVisibility;
|
||||
|
||||
if(child.cacheVisible)
|
||||
{
|
||||
this.addDisplayObject(child);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.removeDisplayObject(child);
|
||||
}
|
||||
}
|
||||
|
||||
if(child.children.length > 0)
|
||||
{
|
||||
this.checkVisibility(child, actualVisibility);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders the stage to its webGL view
|
||||
|
@ -197,19 +157,21 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
// if rendering a new stage clear the batchs..
|
||||
if(this.__stage !== stage)
|
||||
{
|
||||
// TODO make this work
|
||||
if(this.__stage)this.checkVisibility(this.__stage, false)
|
||||
this.__stage = stage;
|
||||
this.stageRenderGroup.setRenderable(stage);
|
||||
}
|
||||
|
||||
|
||||
// update children if need be
|
||||
// best to remove first!
|
||||
for (var i=0; i < stage.__childrenRemoved.length; i++)
|
||||
{
|
||||
this.removeDisplayObject(stage.__childrenRemoved[i]);
|
||||
var group = stage.__childrenRemoved[i].__renderGroup
|
||||
if(group)group.removeDisplayObject(stage.__childrenRemoved[i]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// update any textures
|
||||
for (var i=0; i < PIXI.texturesToUpdate.length; i++) this.updateTexture(PIXI.texturesToUpdate[i]);
|
||||
for (var i=0; i < PIXI.texturesToDestroy.length; i++) this.destroyTexture(PIXI.texturesToDestroy[i]);
|
||||
|
@ -219,43 +181,31 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
stage.__childrenAdded = [];
|
||||
PIXI.texturesToUpdate = [];
|
||||
PIXI.texturesToDestroy = [];
|
||||
|
||||
// recursivly loop through all items!
|
||||
this.checkVisibility(stage, true);
|
||||
//this.checkVisibility(stage, true);
|
||||
|
||||
// update the scene graph
|
||||
stage.updateTransform();
|
||||
|
||||
var gl = this.gl;
|
||||
|
||||
gl.clear(gl.COLOR_BUFFER_BIT)
|
||||
|
||||
gl.clearColor(stage.backgroundColorSplit[0], stage.backgroundColorSplit[1], stage.backgroundColorSplit[2], 0);
|
||||
// -- Does this need to be set every frame? -- //
|
||||
gl.colorMask(true, true, true, this.transparent);
|
||||
gl.viewport(0, 0, this.width, this.height);
|
||||
|
||||
|
||||
// set the correct blend mode!
|
||||
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
||||
// set the correct matrix..
|
||||
gl.uniformMatrix4fv(this.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
|
||||
|
||||
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
||||
|
||||
gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], this.transparent);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
|
||||
// render all the batchs!
|
||||
|
||||
|
||||
var renderable;
|
||||
for (var i=0; i < this.batchs.length; i++)
|
||||
{
|
||||
renderable = this.batchs[i];
|
||||
if(renderable instanceof PIXI.WebGLBatch)
|
||||
{
|
||||
this.batchs[i].render();
|
||||
}
|
||||
else if(renderable instanceof PIXI.TilingSprite)
|
||||
{
|
||||
if(renderable.visible)this.renderTilingSprite(renderable);
|
||||
}
|
||||
else if(renderable instanceof PIXI.Strip)
|
||||
{
|
||||
if(renderable.visible)this.renderStrip(renderable);
|
||||
}
|
||||
}
|
||||
this.stageRenderGroup.backgroundColor = stage.backgroundColorSplit;
|
||||
this.stageRenderGroup.render();
|
||||
|
||||
// interaction
|
||||
// run interaction!
|
||||
|
@ -297,6 +247,7 @@ PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
|
|||
{
|
||||
gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
|
||||
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
||||
|
@ -334,285 +285,7 @@ PIXI.WebGLRenderer.prototype.destroyTexture = function(texture)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PIXI.WebGLRenderer.prototype.addDisplayObject = function(displayObject)
|
||||
{
|
||||
var objectDetaildisplayObject
|
||||
if(!displayObject.stage)return; // means it was removed
|
||||
if(displayObject.__inWebGL)return; //means it is already in webgL
|
||||
|
||||
//displayObject.cacheVisible = displayObject.visible;
|
||||
|
||||
// TODO if objects parent is not visible then dont add to stage!!!!
|
||||
//if(!displayObject.visible)return;
|
||||
|
||||
|
||||
displayObject.batch = null;
|
||||
|
||||
//displayObject.cacheVisible = true;
|
||||
if(!displayObject.renderable)return;
|
||||
|
||||
// while looping below THE OBJECT MAY NOT HAVE BEEN ADDED
|
||||
displayObject.__inWebGL = true;
|
||||
|
||||
/*
|
||||
* LOOK FOR THE PREVIOUS SPRITE
|
||||
* This part looks for the closest previous sprite that can go into a batch
|
||||
* It keeps going back until it finds a sprite or the stage
|
||||
*/
|
||||
var previousSprite = displayObject;
|
||||
do
|
||||
{
|
||||
if(previousSprite.childIndex == 0)
|
||||
{
|
||||
previousSprite = previousSprite.parent;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
previousSprite = previousSprite.parent.children[previousSprite.childIndex-1];
|
||||
// what if the bloop has children???
|
||||
while(previousSprite.children.length != 0)
|
||||
{
|
||||
// keep diggin till we get to the last child
|
||||
previousSprite = previousSprite.children[previousSprite.children.length-1];
|
||||
}
|
||||
}
|
||||
|
||||
if(previousSprite == displayObject.stage)break;
|
||||
}
|
||||
while(!previousSprite.renderable || !previousSprite.__inWebGL)
|
||||
//while(!(previousSprite instanceof PIXI.Sprite))
|
||||
|
||||
/*
|
||||
* LOOK FOR THE NEXT SPRITE
|
||||
* This part looks for the closest next sprite that can go into a batch
|
||||
* it keeps looking until it finds a sprite or gets to the end of the display
|
||||
* scene graph
|
||||
*
|
||||
* These look a lot scarier than the actually are...
|
||||
*/
|
||||
var nextSprite = displayObject;
|
||||
do
|
||||
{
|
||||
// moving forward!
|
||||
// if it has no children..
|
||||
if(nextSprite.children.length == 0)
|
||||
{
|
||||
// go along to the parent..
|
||||
while(nextSprite.childIndex == nextSprite.parent.children.length-1)
|
||||
{
|
||||
nextSprite = nextSprite.parent;
|
||||
if(nextSprite == displayObject.stage)
|
||||
{
|
||||
nextSprite = null
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(nextSprite)nextSprite = nextSprite.parent.children[nextSprite.childIndex+1];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
nextSprite = nextSprite.children[0];
|
||||
}
|
||||
|
||||
if(!nextSprite)break;
|
||||
}
|
||||
while(!nextSprite.renderable || !nextSprite.__inWebGL)
|
||||
|
||||
/*
|
||||
* so now we have the next renderable and the previous renderable
|
||||
*
|
||||
*/
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
{
|
||||
var previousBatch
|
||||
var nextBatch
|
||||
|
||||
if(previousSprite instanceof PIXI.Sprite)
|
||||
{
|
||||
previousBatch = previousSprite.batch;
|
||||
|
||||
if(previousBatch)
|
||||
{
|
||||
if(previousBatch.texture == displayObject.texture.baseTexture && previousBatch.blendMode == displayObject.blendMode)
|
||||
{
|
||||
previousBatch.insertAfter(displayObject, previousSprite);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO reword!
|
||||
previousBatch = previousSprite;
|
||||
}
|
||||
|
||||
if(nextSprite)
|
||||
{
|
||||
if(nextSprite instanceof PIXI.Sprite)
|
||||
{
|
||||
nextBatch = nextSprite.batch;
|
||||
|
||||
//batch may not exist if item was added to the display list but not to the webGL
|
||||
if(nextBatch)
|
||||
{
|
||||
if(nextBatch.texture == displayObject.texture.baseTexture && nextBatch.blendMode == displayObject.blendMode)
|
||||
{
|
||||
nextBatch.insertBefore(displayObject, nextSprite);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nextBatch == previousBatch)
|
||||
{
|
||||
// THERE IS A SPLIT IN THIS BATCH! //
|
||||
var splitBatch = previousBatch.split(nextSprite);
|
||||
// COOL!
|
||||
// add it back into the array
|
||||
/*
|
||||
* OOPS!
|
||||
* seems the new sprite is in the middle of a batch
|
||||
* lets split it..
|
||||
*/
|
||||
var batch = this.getBatch();
|
||||
|
||||
var index = this.batchs.indexOf( previousBatch );
|
||||
batch.init(displayObject);
|
||||
this.batchs.splice(index+1, 0, batch, splitBatch);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO re-word!
|
||||
nextBatch = nextSprite;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* looks like it does not belong to any batch!
|
||||
* but is also not intersecting one..
|
||||
* time to create anew one!
|
||||
*/
|
||||
|
||||
var batch = this.getBatch();
|
||||
batch.init(displayObject);
|
||||
|
||||
if(previousBatch) // if this is invalid it means
|
||||
{
|
||||
var index = this.batchs.indexOf( previousBatch );
|
||||
this.batchs.splice(index+1, 0, batch);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.batchs.push(batch);
|
||||
}
|
||||
|
||||
}
|
||||
else if(displayObject instanceof PIXI.TilingSprite)
|
||||
{
|
||||
// add to a batch!!
|
||||
this.initTilingSprite(displayObject);
|
||||
this.batchs.push(displayObject);
|
||||
|
||||
}
|
||||
else if(displayObject instanceof PIXI.Strip)
|
||||
{
|
||||
// add to a batch!!
|
||||
this.initStrip(displayObject);
|
||||
this.batchs.push(displayObject);
|
||||
|
||||
}
|
||||
|
||||
// if its somthing else... then custom codes!
|
||||
this.batchUpdate = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PIXI.WebGLRenderer.prototype.removeDisplayObject = function(displayObject)
|
||||
{
|
||||
//if(displayObject.stage)return;
|
||||
displayObject.cacheVisible = false;//displayObject.visible;
|
||||
|
||||
if(!displayObject.renderable)return;
|
||||
|
||||
displayObject.__inWebGL = false;
|
||||
|
||||
/*
|
||||
* removing is a lot quicker..
|
||||
*
|
||||
*/
|
||||
var batchToRemove;
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
{
|
||||
// should always have a batch!
|
||||
var batch = displayObject.batch;
|
||||
if(!batch)return; // this means the display list has been altered befre rendering
|
||||
|
||||
batch.remove(displayObject);
|
||||
|
||||
if(batch.size==0)
|
||||
{
|
||||
batchToRemove = batch
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
batchToRemove = displayObject;
|
||||
}
|
||||
|
||||
/*
|
||||
* Looks like there is somthing that needs removing!
|
||||
*/
|
||||
if(batchToRemove)
|
||||
{
|
||||
var index = this.batchs.indexOf( batchToRemove );
|
||||
if(index == -1)return;// this means it was added then removed before rendered
|
||||
|
||||
// ok so.. check to see if you adjacent batchs should be joined.
|
||||
// TODO may optimise?
|
||||
if(index == 0 || index == this.batchs.length-1)
|
||||
{
|
||||
// wha - eva! just get of the empty batch!
|
||||
this.batchs.splice(index, 1);
|
||||
if(batchToRemove instanceof PIXI.WebGLBatch)this.returnBatch(batchToRemove);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
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 && this.batchs[index-1].blendMode == this.batchs[index+1].blendMode)
|
||||
{
|
||||
//console.log("MERGE")
|
||||
this.batchs[index-1].merge(this.batchs[index+1]);
|
||||
|
||||
if(batchToRemove instanceof PIXI.WebGLBatch)this.returnBatch(batchToRemove);
|
||||
this.returnBatch(this.batchs[index+1]);
|
||||
this.batchs.splice(index, 2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.batchs.splice(index, 1);
|
||||
if(batchToRemove instanceof PIXI.WebGLBatch)this.returnBatch(batchToRemove);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* resizes the webGL view to the specified width and height
|
||||
|
@ -644,9 +317,6 @@ PIXI.WebGLRenderer.prototype.resize = function(width, height)
|
|||
*/
|
||||
PIXI.WebGLRenderer.prototype.initTilingSprite = function(sprite)
|
||||
{
|
||||
|
||||
|
||||
|
||||
var gl = this.gl;
|
||||
|
||||
// make the texture tilable..
|
||||
|
@ -733,28 +403,25 @@ PIXI.WebGLRenderer.prototype.renderTilingSprite = function(sprite)
|
|||
var offsetX = tilePosition.x/sprite.texture.baseTexture.width;
|
||||
var offsetY = tilePosition.y/sprite.texture.baseTexture.height;
|
||||
|
||||
var scaleX = (sprite.width / sprite.texture.baseTexture.width) / tileScale.x///sprite.texture.baseTexture.width;
|
||||
var scaleY = (sprite.height / sprite.texture.baseTexture.height) / tileScale.y///sprite.texture.baseTexture.height;
|
||||
//
|
||||
//sprite.dirty = true;
|
||||
sprite.uvs[0] = 0 + offsetX
|
||||
var scaleX = (sprite.width / sprite.texture.baseTexture.width) / tileScale.x;
|
||||
var scaleY = (sprite.height / sprite.texture.baseTexture.height) / tileScale.y;
|
||||
|
||||
sprite.uvs[0] = 0 - offsetX;
|
||||
sprite.uvs[1] = 0 - offsetY;
|
||||
|
||||
sprite.uvs[2] = (1 * scaleX) +offsetX
|
||||
sprite.uvs[2] = (1 * scaleX) -offsetX;
|
||||
sprite.uvs[3] = 0 - offsetY;
|
||||
|
||||
sprite.uvs[4] = (1 *scaleX) + offsetX
|
||||
sprite.uvs[4] = (1 *scaleX) - offsetX;
|
||||
sprite.uvs[5] = (1 *scaleY) - offsetY;
|
||||
|
||||
sprite.uvs[6] = 0 + offsetX
|
||||
sprite.uvs[6] = 0 - offsetX;
|
||||
sprite.uvs[7] = (1 *scaleY) - offsetY;
|
||||
|
||||
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, sprite._uvBuffer);
|
||||
gl.bufferSubData(gl.ARRAY_BUFFER, 0, sprite.uvs)
|
||||
|
||||
this.renderStrip(sprite);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -44,6 +44,8 @@ PIXI.BaseTexture = function(source)
|
|||
*/
|
||||
this.source = source//new Image();
|
||||
|
||||
if(!source)return;
|
||||
|
||||
if(this.source instanceof Image)
|
||||
{
|
||||
if(this.source.complete)
|
||||
|
@ -77,7 +79,6 @@ PIXI.BaseTexture = function(source)
|
|||
this.width = this.source.width;
|
||||
this.height = this.source.height;
|
||||
|
||||
//console.log(">!!",this.width)
|
||||
PIXI.texturesToUpdate.push(this);
|
||||
}
|
||||
|
||||
|
|
166
src/pixi/textures/RenderTexture.js
Normal file
166
src/pixi/textures/RenderTexture.js
Normal file
|
@ -0,0 +1,166 @@
|
|||
/**
|
||||
* @author Mat Groves http://matgroves.com/ @Doormat23
|
||||
*/
|
||||
|
||||
/**
|
||||
* A RenderTexture is a special texture that allows any pixi displayObject to be rendered to it.
|
||||
* @class RenderTexture
|
||||
* @extends Texture
|
||||
* @constructor
|
||||
* @param width {Number}
|
||||
* @param height {Number}
|
||||
*/
|
||||
PIXI.RenderTexture = function(width, height)
|
||||
{
|
||||
PIXI.EventTarget.call( this );
|
||||
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
|
||||
this.indetityMatrix = PIXI.mat3.create();
|
||||
|
||||
this.frame = new PIXI.Rectangle(0, 0, this.width, this.height);
|
||||
|
||||
if(PIXI.gl)
|
||||
{
|
||||
this.initWebGL();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.initCanvas();
|
||||
}
|
||||
}
|
||||
|
||||
PIXI.RenderTexture.constructor = PIXI.RenderTexture;
|
||||
PIXI.RenderTexture.prototype = Object.create( PIXI.Texture.prototype );
|
||||
|
||||
PIXI.RenderTexture.prototype.initWebGL = function()
|
||||
{
|
||||
var gl = PIXI.gl;
|
||||
this.glFramebuffer = gl.createFramebuffer();
|
||||
|
||||
gl.bindFramebuffer(gl.FRAMEBUFFER, this.glFramebuffer );
|
||||
|
||||
this.glFramebuffer.width = this.width;
|
||||
this.glFramebuffer.height = this.height;
|
||||
|
||||
this.baseTexture = new PIXI.BaseTexture();
|
||||
|
||||
this.baseTexture.width = this.width;
|
||||
this.baseTexture.height = this.height;
|
||||
|
||||
this.baseTexture._glTexture = gl.createTexture();
|
||||
gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture);
|
||||
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
|
||||
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
||||
|
||||
this.baseTexture.isRender = true;
|
||||
|
||||
gl.bindFramebuffer(gl.FRAMEBUFFER, this.glFramebuffer );
|
||||
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.baseTexture._glTexture, 0);
|
||||
|
||||
// create a projection matrix..
|
||||
this.projectionMatrix = PIXI.mat4.create();
|
||||
|
||||
this.projectionMatrix[5] = 2/this.height// * 0.5;
|
||||
this.projectionMatrix[13] = -1;
|
||||
|
||||
this.projectionMatrix[0] = 2/this.width;
|
||||
this.projectionMatrix[12] = -1;
|
||||
|
||||
// set the correct render function..
|
||||
this.render = this.renderWebGL;
|
||||
}
|
||||
|
||||
PIXI.RenderTexture.prototype.initCanvas = function()
|
||||
{
|
||||
this.renderer = new PIXI.CanvasRenderer(this.width, this.height, null, 0);
|
||||
|
||||
this.baseTexture = new PIXI.BaseTexture(this.renderer.view);
|
||||
this.frame = new PIXI.Rectangle(0, 0, this.width, this.height);
|
||||
|
||||
this.render = this.renderCanvas;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will draw the display object to the texture.
|
||||
* @method render
|
||||
* @param displayObject {DisplayObject}
|
||||
* @param clear {Boolean} If true the texture will not be cleared before the displayObject is drawn
|
||||
*/
|
||||
PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, clear)
|
||||
{
|
||||
var gl = PIXI.gl;
|
||||
|
||||
// enable the alpha color mask..
|
||||
gl.colorMask(true, true, true, true);
|
||||
|
||||
gl.viewport(0, 0, this.width, this.height);
|
||||
|
||||
gl.bindFramebuffer(gl.FRAMEBUFFER, this.glFramebuffer );
|
||||
|
||||
if(clear)
|
||||
{
|
||||
gl.clearColor(0,0,0, 0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
// set the flipped matrix..
|
||||
gl.uniformMatrix4fv(renderer.shaderProgram.mvMatrixUniform, false, this.projectionMatrix);
|
||||
|
||||
// THIS WILL MESS WITH HIT TESTING!
|
||||
var children = displayObject.children;
|
||||
|
||||
//TODO -? create a new one??? dont think so!
|
||||
displayObject.worldTransform = this.indetityMatrix;
|
||||
|
||||
for(var i=0,j=children.length; i<j; i++)
|
||||
{
|
||||
children[i].updateTransform();
|
||||
}
|
||||
|
||||
var renderGroup = displayObject.__renderGroup ;
|
||||
|
||||
if(renderGroup)
|
||||
{
|
||||
if(displayObject == renderGroup.root)
|
||||
{
|
||||
renderGroup.render();
|
||||
}
|
||||
else
|
||||
{
|
||||
renderGroup.renderSpecific(displayObject);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!this.renderGroup)this.renderGroup = new PIXI.WebGLRenderGroup(gl);
|
||||
this.renderGroup.setRenderable(displayObject);
|
||||
|
||||
this.renderGroup.render();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PIXI.RenderTexture.prototype.renderCanvas = function(displayObject, clear)
|
||||
{
|
||||
var children = displayObject.children;
|
||||
|
||||
displayObject.worldTransform = this.indetityMatrix;
|
||||
|
||||
for(var i=0,j=children.length; i<j; i++)
|
||||
{
|
||||
children[i].updateTransform();
|
||||
}
|
||||
|
||||
if(clear)this.renderer.context.clearRect(0,0, this.width, this.height);
|
||||
this.renderer.renderDisplayObject(displayObject);
|
||||
|
||||
PIXI.texturesToUpdate.push(this.baseTexture);
|
||||
}
|
||||
|
|
@ -158,6 +158,7 @@ PIXI.Texture.fromCanvas = function(canvas)
|
|||
/**
|
||||
*
|
||||
* Adds a texture to the textureCache.
|
||||
* @static
|
||||
* @method addTextureToCache
|
||||
* @param texture {Texture}
|
||||
* @param id {String} the id that the texture will be stored against.
|
||||
|
@ -170,6 +171,7 @@ PIXI.Texture.addTextureToCache = function(texture, id)
|
|||
/**
|
||||
*
|
||||
* Remove a texture from the textureCache.
|
||||
* @static
|
||||
* @method removeTextureFromCache
|
||||
* @param id {String} the id of the texture to be removed
|
||||
* @return {Texture} the texture that was removed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue