WebGL Render Bug Fix
This commit is contained in:
parent
953a19ff5c
commit
c6e6f7458e
36 changed files with 729 additions and 340 deletions
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2012, Mat Groves
|
* Copyright (c) 2012, Mat Groves
|
||||||
* http://goodboydigital.com/
|
* http://goodboydigital.com/
|
||||||
*
|
*
|
||||||
* Compiled: 2013-06-23
|
* Compiled: 2013-06-24
|
||||||
*
|
*
|
||||||
* Pixi.JS is licensed under the MIT License.
|
* Pixi.JS is licensed under the MIT License.
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
@ -1836,6 +1836,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -1861,6 +1862,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
// loop through inteaction tree...
|
// loop through inteaction tree...
|
||||||
// hit test each item! ->
|
// hit test each item! ->
|
||||||
|
@ -1898,7 +1900,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var global = this.mouse.global;
|
var global = this.mouse.global;
|
||||||
|
|
||||||
|
@ -2031,6 +2033,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2055,6 +2058,7 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -2097,6 +2101,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2181,6 +2186,13 @@ PIXI.InteractionData = function()
|
||||||
* @type Sprite
|
* @type Sprite
|
||||||
*/
|
*/
|
||||||
this.target;
|
this.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When passed to an event handler, this will be the original DOM Event that was captured
|
||||||
|
* @property originalEvent
|
||||||
|
* @type Event
|
||||||
|
*/
|
||||||
|
this.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2817,21 +2829,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType)
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.activateDefaultShader = function()
|
|
||||||
{
|
|
||||||
var gl = PIXI.gl;
|
|
||||||
var shaderProgram = PIXI.shaderProgram;
|
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
{
|
{
|
||||||
|
@ -2852,6 +2849,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
return shaderProgram;
|
return shaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activateDefaultShader = function()
|
||||||
|
{
|
||||||
|
var gl = PIXI.gl;
|
||||||
|
var shaderProgram = PIXI.shaderProgram;
|
||||||
|
|
||||||
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PIXI.activatePrimitiveShader = function()
|
PIXI.activatePrimitiveShader = function()
|
||||||
{
|
{
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
@ -4240,7 +4253,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5671,6 +5684,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
10
bin/pixi.js
10
bin/pixi.js
File diff suppressed because one or more lines are too long
|
@ -166,7 +166,9 @@
|
||||||
|
|
||||||
|
|
||||||
<div class="box intro">
|
<div class="box intro">
|
||||||
<p>The Graphics class contains a set of methods that you can use to create primitive shapes and lines.</p>
|
<p>The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -765,7 +767,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../files/src_pixi_primitives_Graphics.js.html#l83"><code>src/pixi/primitives/Graphics.js:83</code></a>
|
<a href="../files/src_pixi_primitives_Graphics.js.html#l85"><code>src/pixi/primitives/Graphics.js:85</code></a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -857,7 +859,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../files/src_pixi_primitives_Graphics.js.html#l165"><code>src/pixi/primitives/Graphics.js:165</code></a>
|
<a href="../files/src_pixi_primitives_Graphics.js.html#l167"><code>src/pixi/primitives/Graphics.js:167</code></a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -1017,7 +1019,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../files/src_pixi_primitives_Graphics.js.html#l126"><code>src/pixi/primitives/Graphics.js:126</code></a>
|
<a href="../files/src_pixi_primitives_Graphics.js.html#l128"><code>src/pixi/primitives/Graphics.js:128</code></a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -1152,7 +1154,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../files/src_pixi_primitives_Graphics.js.html#l145"><code>src/pixi/primitives/Graphics.js:145</code></a>
|
<a href="../files/src_pixi_primitives_Graphics.js.html#l147"><code>src/pixi/primitives/Graphics.js:147</code></a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -1302,7 +1304,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../files/src_pixi_primitives_Graphics.js.html#l107"><code>src/pixi/primitives/Graphics.js:107</code></a>
|
<a href="../files/src_pixi_primitives_Graphics.js.html#l109"><code>src/pixi/primitives/Graphics.js:109</code></a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -1424,7 +1426,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../files/src_pixi_primitives_Graphics.js.html#l96"><code>src/pixi/primitives/Graphics.js:96</code></a>
|
<a href="../files/src_pixi_primitives_Graphics.js.html#l98"><code>src/pixi/primitives/Graphics.js:98</code></a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -1584,7 +1586,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../files/src_pixi_primitives_Graphics.js.html#l32"><code>src/pixi/primitives/Graphics.js:32</code></a>
|
<a href="../files/src_pixi_primitives_Graphics.js.html#l34"><code>src/pixi/primitives/Graphics.js:34</code></a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -1707,7 +1709,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../files/src_pixi_primitives_Graphics.js.html#l71"><code>src/pixi/primitives/Graphics.js:71</code></a>
|
<a href="../files/src_pixi_primitives_Graphics.js.html#l73"><code>src/pixi/primitives/Graphics.js:73</code></a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -2237,7 +2239,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../files/src_pixi_primitives_Graphics.js.html#l53"><code>src/pixi/primitives/Graphics.js:53</code></a>
|
<a href="../files/src_pixi_primitives_Graphics.js.html#l55"><code>src/pixi/primitives/Graphics.js:55</code></a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@
|
||||||
|
|
||||||
|
|
||||||
<div class="foundat">
|
<div class="foundat">
|
||||||
Defined in: <a href="../files/src_pixi_InteractionManager.js.html#l519"><code>src/pixi/InteractionManager.js:519</code></a>
|
Defined in: <a href="../files/src_pixi_InteractionManager.js.html#l524"><code>src/pixi/InteractionManager.js:524</code></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -200,7 +200,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#l524"><code>src/pixi/InteractionManager.js:524</code></a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -270,6 +270,13 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="index-item property">
|
||||||
|
<a href="#property_originalEvent">originalEvent</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="index-item property">
|
<li class="index-item property">
|
||||||
|
@ -339,7 +346,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../files/src_pixi_InteractionManager.js.html#l543"><code>src/pixi/InteractionManager.js:543</code></a>
|
<a href="../files/src_pixi_InteractionManager.js.html#l555"><code>src/pixi/InteractionManager.js:555</code></a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -428,7 +435,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../files/src_pixi_InteractionManager.js.html#l525"><code>src/pixi/InteractionManager.js:525</code></a>
|
<a href="../files/src_pixi_InteractionManager.js.html#l530"><code>src/pixi/InteractionManager.js:530</code></a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -446,6 +453,50 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="property_originalEvent" class="property item">
|
||||||
|
<h3 class="name"><code>originalEvent</code></h3>
|
||||||
|
<span class="type">Event</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="meta">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
Defined in
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="../files/src_pixi_InteractionManager.js.html#l547"><code>src/pixi/InteractionManager.js:547</code></a>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="description">
|
||||||
|
<p>When passed to an event handler, this will be the original DOM Event that was captured</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -472,7 +523,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../files/src_pixi_InteractionManager.js.html#l535"><code>src/pixi/InteractionManager.js:535</code></a>
|
<a href="../files/src_pixi_InteractionManager.js.html#l540"><code>src/pixi/InteractionManager.js:540</code></a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
@ -167,6 +167,27 @@
|
||||||
|
|
||||||
<div class="box intro">
|
<div class="box intro">
|
||||||
<p>A RenderTexture is a special texture that allows any pixi displayObject to be rendered to it.</p>
|
<p>A RenderTexture is a special texture that allows any pixi displayObject to be rendered to it.</p>
|
||||||
|
|
||||||
|
<p><strong>Hint</strong>: All DisplayObjects (exmpl. Sprites) that renders on RenderTexture should be preloaded.
|
||||||
|
Otherwise black rectangles will be drawn instead. </p>
|
||||||
|
|
||||||
|
<p>RenderTexture takes snapshot of DisplayObject passed to render method. If DisplayObject is passed to render method, position and rotation of it will be ignored. For example:</p>
|
||||||
|
|
||||||
|
<pre class="code prettyprint"><code>var renderTexture = new PIXI.RenderTexture(800, 600);
|
||||||
|
var sprite = PIXI.Sprite.fromImage("spinObj_01.png");
|
||||||
|
sprite.position.x = 800/2;
|
||||||
|
sprite.position.y = 600/2;
|
||||||
|
sprite.anchor.x = 0.5;
|
||||||
|
sprite.anchor.y = 0.5;
|
||||||
|
renderTexture.render(sprite);
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Sprite in this case will be rendered to 0,0 position. To render this sprite at center DisplayObjectContainer should be used:</p>
|
||||||
|
|
||||||
|
<pre class="code prettyprint"><code>var doc = new PIXI.DisplayObjectContainer();
|
||||||
|
doc.addChild(sprite);
|
||||||
|
renderTexture.render(doc); // Renders to center of renderTexture
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -513,7 +534,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../files/src_pixi_textures_RenderTexture.js.html#l92"><code>src/pixi/textures/RenderTexture.js:92</code></a>
|
<a href="../files/src_pixi_textures_RenderTexture.js.html#l112"><code>src/pixi/textures/RenderTexture.js:112</code></a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
@ -376,7 +376,7 @@
|
||||||
"namespaces": {},
|
"namespaces": {},
|
||||||
"tag": "module",
|
"tag": "module",
|
||||||
"file": "src/pixi/InteractionManager.js",
|
"file": "src/pixi/InteractionManager.js",
|
||||||
"line": 519
|
"line": 524
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"classes": {
|
"classes": {
|
||||||
|
@ -772,7 +772,7 @@
|
||||||
"module": "PIXI",
|
"module": "PIXI",
|
||||||
"file": "src/pixi/primitives/Graphics.js",
|
"file": "src/pixi/primitives/Graphics.js",
|
||||||
"line": 6,
|
"line": 6,
|
||||||
"description": "The Graphics class contains a set of methods that you can use to create primitive shapes and lines.",
|
"description": "The Graphics class contains a set of methods that you can use to create primitive shapes and lines. \nIt is important to know that with the webGL renderer only simple polys can be filled at this stage\nComplex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png",
|
||||||
"extends": "DisplayObjectContainer",
|
"extends": "DisplayObjectContainer",
|
||||||
"is_constructor": 1
|
"is_constructor": 1
|
||||||
},
|
},
|
||||||
|
@ -1037,7 +1037,7 @@
|
||||||
"module": "PIXI",
|
"module": "PIXI",
|
||||||
"file": "src/pixi/textures/RenderTexture.js",
|
"file": "src/pixi/textures/RenderTexture.js",
|
||||||
"line": 5,
|
"line": 5,
|
||||||
"description": "A RenderTexture is a special texture that allows any pixi displayObject to be rendered to it.",
|
"description": "A RenderTexture is a special texture that allows any pixi displayObject to be rendered to it.\n\n__Hint__: All DisplayObjects (exmpl. Sprites) that renders on RenderTexture should be preloaded. \nOtherwise black rectangles will be drawn instead. \n\nRenderTexture takes snapshot of DisplayObject passed to render method. If DisplayObject is passed to render method, position and rotation of it will be ignored. For example:\n\n\tvar renderTexture = new PIXI.RenderTexture(800, 600);\n\tvar sprite = PIXI.Sprite.fromImage(\"spinObj_01.png\");\n\tsprite.position.x = 800/2;\n\tsprite.position.y = 600/2;\n\tsprite.anchor.x = 0.5;\n\tsprite.anchor.y = 0.5;\n\trenderTexture.render(sprite);\n\nSprite in this case will be rendered to 0,0 position. To render this sprite at center DisplayObjectContainer should be used:\n\n\tvar doc = new PIXI.DisplayObjectContainer();\n\tdoc.addChild(sprite);\n\trenderTexture.render(doc); // Renders to center of renderTexture",
|
||||||
"extends": "Texture",
|
"extends": "Texture",
|
||||||
"is_constructor": 1,
|
"is_constructor": 1,
|
||||||
"params": [
|
"params": [
|
||||||
|
@ -1112,7 +1112,7 @@
|
||||||
"extension_for": [],
|
"extension_for": [],
|
||||||
"module": "PIXI",
|
"module": "PIXI",
|
||||||
"file": "src/pixi/InteractionManager.js",
|
"file": "src/pixi/InteractionManager.js",
|
||||||
"line": 519,
|
"line": 524,
|
||||||
"is_constructor": 1
|
"is_constructor": 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -2200,7 +2200,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/primitives/Graphics.js",
|
"file": "src/pixi/primitives/Graphics.js",
|
||||||
"line": 32,
|
"line": 34,
|
||||||
"description": "Specifies a line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.",
|
"description": "Specifies a line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.",
|
||||||
"itemtype": "method",
|
"itemtype": "method",
|
||||||
"name": "lineStyle",
|
"name": "lineStyle",
|
||||||
|
@ -2225,7 +2225,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/primitives/Graphics.js",
|
"file": "src/pixi/primitives/Graphics.js",
|
||||||
"line": 53,
|
"line": 55,
|
||||||
"description": "Moves the current drawing position to (x, y).",
|
"description": "Moves the current drawing position to (x, y).",
|
||||||
"itemtype": "method",
|
"itemtype": "method",
|
||||||
"name": "moveTo",
|
"name": "moveTo",
|
||||||
|
@ -2245,7 +2245,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/primitives/Graphics.js",
|
"file": "src/pixi/primitives/Graphics.js",
|
||||||
"line": 71,
|
"line": 73,
|
||||||
"description": "Draws a line using the current line style from the current drawing position to (x, y); the current drawing position is then set to (x, y).",
|
"description": "Draws a line using the current line style from the current drawing position to (x, y); the current drawing position is then set to (x, y).",
|
||||||
"itemtype": "method",
|
"itemtype": "method",
|
||||||
"name": "lineTo",
|
"name": "lineTo",
|
||||||
|
@ -2265,7 +2265,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/primitives/Graphics.js",
|
"file": "src/pixi/primitives/Graphics.js",
|
||||||
"line": 83,
|
"line": 85,
|
||||||
"description": "Specifies a simple one-color fill that subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) use when drawing.",
|
"description": "Specifies a simple one-color fill that subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) use when drawing.",
|
||||||
"itemtype": "method",
|
"itemtype": "method",
|
||||||
"name": "beginFill",
|
"name": "beginFill",
|
||||||
|
@ -2285,7 +2285,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/primitives/Graphics.js",
|
"file": "src/pixi/primitives/Graphics.js",
|
||||||
"line": 96,
|
"line": 98,
|
||||||
"description": "Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.",
|
"description": "Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.",
|
||||||
"itemtype": "method",
|
"itemtype": "method",
|
||||||
"name": "endFill",
|
"name": "endFill",
|
||||||
|
@ -2293,7 +2293,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/primitives/Graphics.js",
|
"file": "src/pixi/primitives/Graphics.js",
|
||||||
"line": 107,
|
"line": 109,
|
||||||
"itemtype": "method",
|
"itemtype": "method",
|
||||||
"name": "drawRect",
|
"name": "drawRect",
|
||||||
"params": [
|
"params": [
|
||||||
|
@ -2322,7 +2322,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/primitives/Graphics.js",
|
"file": "src/pixi/primitives/Graphics.js",
|
||||||
"line": 126,
|
"line": 128,
|
||||||
"description": "Draws a circle.",
|
"description": "Draws a circle.",
|
||||||
"itemtype": "method",
|
"itemtype": "method",
|
||||||
"name": "drawCircle",
|
"name": "drawCircle",
|
||||||
|
@ -2347,7 +2347,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/primitives/Graphics.js",
|
"file": "src/pixi/primitives/Graphics.js",
|
||||||
"line": 145,
|
"line": 147,
|
||||||
"description": "Draws an elipse.",
|
"description": "Draws an elipse.",
|
||||||
"itemtype": "method",
|
"itemtype": "method",
|
||||||
"name": "drawElipse",
|
"name": "drawElipse",
|
||||||
|
@ -2377,7 +2377,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/primitives/Graphics.js",
|
"file": "src/pixi/primitives/Graphics.js",
|
||||||
"line": 165,
|
"line": 167,
|
||||||
"description": "Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.",
|
"description": "Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.",
|
||||||
"itemtype": "method",
|
"itemtype": "method",
|
||||||
"name": "clear",
|
"name": "clear",
|
||||||
|
@ -2487,7 +2487,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/renderers/canvas/CanvasRenderer.js",
|
"file": "src/pixi/renderers/canvas/CanvasRenderer.js",
|
||||||
"line": 282,
|
"line": 284,
|
||||||
"access": "private",
|
"access": "private",
|
||||||
"tagname": "",
|
"tagname": "",
|
||||||
"class": "CanvasRenderer"
|
"class": "CanvasRenderer"
|
||||||
|
@ -2695,14 +2695,14 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/renderers/webgl/WebGLRenderGroup.js",
|
"file": "src/pixi/renderers/webgl/WebGLRenderGroup.js",
|
||||||
"line": 849,
|
"line": 853,
|
||||||
"access": "private",
|
"access": "private",
|
||||||
"tagname": "",
|
"tagname": "",
|
||||||
"class": "WebGLBatch"
|
"class": "WebGLBatch"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/renderers/webgl/WebGLRenderGroup.js",
|
"file": "src/pixi/renderers/webgl/WebGLRenderGroup.js",
|
||||||
"line": 886,
|
"line": 890,
|
||||||
"access": "private",
|
"access": "private",
|
||||||
"tagname": "",
|
"tagname": "",
|
||||||
"class": "WebGLBatch"
|
"class": "WebGLBatch"
|
||||||
|
@ -3037,7 +3037,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/textures/RenderTexture.js",
|
"file": "src/pixi/textures/RenderTexture.js",
|
||||||
"line": 92,
|
"line": 112,
|
||||||
"description": "This function will draw the display object to the texture.",
|
"description": "This function will draw the display object to the texture.",
|
||||||
"itemtype": "method",
|
"itemtype": "method",
|
||||||
"name": "render",
|
"name": "render",
|
||||||
|
@ -3276,7 +3276,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/InteractionManager.js",
|
"file": "src/pixi/InteractionManager.js",
|
||||||
"line": 525,
|
"line": 530,
|
||||||
"description": "This point stores the global coords of where the touch/mouse event happened",
|
"description": "This point stores the global coords of where the touch/mouse event happened",
|
||||||
"itemtype": "property",
|
"itemtype": "property",
|
||||||
"name": "global",
|
"name": "global",
|
||||||
|
@ -3285,7 +3285,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/InteractionManager.js",
|
"file": "src/pixi/InteractionManager.js",
|
||||||
"line": 535,
|
"line": 540,
|
||||||
"description": "The target Sprite that was interacted with",
|
"description": "The target Sprite that was interacted with",
|
||||||
"itemtype": "property",
|
"itemtype": "property",
|
||||||
"name": "target",
|
"name": "target",
|
||||||
|
@ -3294,7 +3294,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/pixi/InteractionManager.js",
|
"file": "src/pixi/InteractionManager.js",
|
||||||
"line": 543,
|
"line": 547,
|
||||||
|
"description": "When passed to an event handler, this will be the original DOM Event that was captured",
|
||||||
|
"itemtype": "property",
|
||||||
|
"name": "originalEvent",
|
||||||
|
"type": "Event",
|
||||||
|
"class": "InteractionData"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file": "src/pixi/InteractionManager.js",
|
||||||
|
"line": 555,
|
||||||
"description": "This will return the local coords of the specified displayObject for this InteractionData",
|
"description": "This will return the local coords of the specified displayObject for this InteractionData",
|
||||||
"itemtype": "method",
|
"itemtype": "method",
|
||||||
"name": "getLocalPosition",
|
"name": "getLocalPosition",
|
||||||
|
@ -3617,7 +3626,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"message": "Missing item type",
|
"message": "Missing item type",
|
||||||
"line": " src/pixi/renderers/canvas/CanvasRenderer.js:282"
|
"line": " src/pixi/renderers/canvas/CanvasRenderer.js:284"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"message": "Missing item type",
|
"message": "Missing item type",
|
||||||
|
@ -3665,11 +3674,11 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"message": "Missing item type",
|
"message": "Missing item type",
|
||||||
"line": " src/pixi/renderers/webgl/WebGLRenderGroup.js:849"
|
"line": " src/pixi/renderers/webgl/WebGLRenderGroup.js:853"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"message": "Missing item type",
|
"message": "Missing item type",
|
||||||
"line": " src/pixi/renderers/webgl/WebGLRenderGroup.js:886"
|
"line": " src/pixi/renderers/webgl/WebGLRenderGroup.js:890"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"message": "Missing item type",
|
"message": "Missing item type",
|
||||||
|
|
|
@ -337,6 +337,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -362,6 +363,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
// loop through inteaction tree...
|
// loop through inteaction tree...
|
||||||
// hit test each item! ->
|
// hit test each item! ->
|
||||||
|
@ -399,7 +401,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var global = this.mouse.global;
|
var global = this.mouse.global;
|
||||||
|
|
||||||
|
@ -532,6 +534,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -556,6 +559,7 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -598,6 +602,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -682,6 +687,13 @@ PIXI.InteractionData = function()
|
||||||
* @type Sprite
|
* @type Sprite
|
||||||
*/
|
*/
|
||||||
this.target;
|
this.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When passed to an event handler, this will be the original DOM Event that was captured
|
||||||
|
* @property originalEvent
|
||||||
|
* @type Event
|
||||||
|
*/
|
||||||
|
this.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -236,6 +236,7 @@ PIXI.SpriteSheetLoader.prototype.onLoaded = function () {
|
||||||
content: this
|
content: this
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -149,6 +149,8 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
|
@ -166,6 +166,7 @@ PIXI.CanvasGraphics = function()
|
||||||
*/
|
*/
|
||||||
PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
{
|
{
|
||||||
|
var worldAlpha = graphics.worldAlpha;
|
||||||
|
|
||||||
for (var i=0; i < graphics.graphicsData.length; i++)
|
for (var i=0; i < graphics.graphicsData.length; i++)
|
||||||
{
|
{
|
||||||
|
@ -198,13 +199,13 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
if(data.fill)
|
if(data.fill)
|
||||||
{
|
{
|
||||||
context.globalAlpha = data.fillAlpha;
|
context.globalAlpha = data.fillAlpha * worldAlpha;
|
||||||
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
|
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
|
||||||
context.fill();
|
context.fill();
|
||||||
}
|
}
|
||||||
if(data.lineWidth)
|
if(data.lineWidth)
|
||||||
{
|
{
|
||||||
context.globalAlpha = data.lineAlpha;
|
context.globalAlpha = data.lineAlpha * worldAlpha;
|
||||||
context.stroke();
|
context.stroke();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,14 +214,14 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
// TODO - need to be Undefined!
|
// TODO - need to be Undefined!
|
||||||
if(data.fillColor)
|
if(data.fillColor)
|
||||||
{
|
{
|
||||||
context.globalAlpha = data.fillAlpha;
|
context.globalAlpha = data.fillAlpha * worldAlpha;
|
||||||
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
|
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
|
||||||
context.fillRect(points[0], points[1], points[2], points[3]);
|
context.fillRect(points[0], points[1], points[2], points[3]);
|
||||||
|
|
||||||
}
|
}
|
||||||
if(data.lineWidth)
|
if(data.lineWidth)
|
||||||
{
|
{
|
||||||
context.globalAlpha = data.lineAlpha;
|
context.globalAlpha = data.lineAlpha * worldAlpha;
|
||||||
context.strokeRect(points[0], points[1], points[2], points[3]);
|
context.strokeRect(points[0], points[1], points[2], points[3]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -233,13 +234,13 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
if(data.fill)
|
if(data.fill)
|
||||||
{
|
{
|
||||||
context.globalAlpha = data.fillAlpha;
|
context.globalAlpha = data.fillAlpha * worldAlpha;
|
||||||
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
|
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
|
||||||
context.fill();
|
context.fill();
|
||||||
}
|
}
|
||||||
if(data.lineWidth)
|
if(data.lineWidth)
|
||||||
{
|
{
|
||||||
context.globalAlpha = data.lineAlpha;
|
context.globalAlpha = data.lineAlpha * worldAlpha;
|
||||||
context.stroke();
|
context.stroke();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -276,13 +277,13 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
if(data.fill)
|
if(data.fill)
|
||||||
{
|
{
|
||||||
context.globalAlpha = data.fillAlpha;
|
context.globalAlpha = data.fillAlpha * worldAlpha;
|
||||||
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
|
context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
|
||||||
context.fill();
|
context.fill();
|
||||||
}
|
}
|
||||||
if(data.lineWidth)
|
if(data.lineWidth)
|
||||||
{
|
{
|
||||||
context.globalAlpha = data.lineAlpha;
|
context.globalAlpha = data.lineAlpha * worldAlpha;
|
||||||
context.stroke();
|
context.stroke();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -401,6 +401,8 @@ PIXI.CanvasRenderer.prototype.renderTilingSprite = function(sprite)
|
||||||
{
|
{
|
||||||
var context = this.context;
|
var context = this.context;
|
||||||
|
|
||||||
|
context.globalAlpha = sprite.worldAlpha;
|
||||||
|
|
||||||
if(!sprite.__tilePattern) sprite.__tilePattern = context.createPattern(sprite.texture.baseTexture.source, "repeat");
|
if(!sprite.__tilePattern) sprite.__tilePattern = context.createPattern(sprite.texture.baseTexture.source, "repeat");
|
||||||
|
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
|
|
|
@ -660,6 +660,7 @@ PIXI.WebGLBatch.prototype.update = function()
|
||||||
*/
|
*/
|
||||||
PIXI.WebGLBatch.prototype.render = function(start, end)
|
PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
{
|
{
|
||||||
|
|
||||||
// console.log(start + " :: " + end + " : " + this.size);
|
// console.log(start + " :: " + end + " : " + this.size);
|
||||||
start = start || 0;
|
start = start || 0;
|
||||||
//end = end || this.size;
|
//end = end || this.size;
|
||||||
|
@ -672,6 +673,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (this.size == 0)return;
|
if (this.size == 0)return;
|
||||||
|
|
||||||
this.update();
|
this.update();
|
||||||
|
@ -688,7 +690,6 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
// ok..
|
// ok..
|
||||||
gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
|
gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies)
|
||||||
gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
|
gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
|
||||||
|
|
||||||
// update the uvs
|
// update the uvs
|
||||||
gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
|
gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
|
||||||
|
|
||||||
|
@ -722,7 +723,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ PIXI.WebGLGraphics = function()
|
||||||
|
|
||||||
PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
{
|
{
|
||||||
PIXI.activatePrimitiveShader();
|
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
|
||||||
if(!graphics._webGL)graphics._webGL = {points:[], indices:[], lastIndex:0,
|
if(!graphics._webGL)graphics._webGL = {points:[], indices:[], lastIndex:0,
|
||||||
|
@ -176,27 +176,47 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activatePrimitiveShader();
|
||||||
|
|
||||||
// This could be speeded up fo sure!
|
// This could be speeded up fo sure!
|
||||||
var m = PIXI.mat3.clone(graphics.worldTransform);
|
var m = PIXI.mat3.clone(graphics.worldTransform);
|
||||||
|
|
||||||
PIXI.mat3.transpose(m);
|
PIXI.mat3.transpose(m);
|
||||||
|
|
||||||
// set the matrix transform for the
|
// set the matrix transform for the
|
||||||
|
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
gl.uniformMatrix3fv(PIXI.primitiveProgram.translationMatrix, false, m);
|
gl.uniformMatrix3fv(PIXI.primitiveProgram.translationMatrix, false, m);
|
||||||
|
|
||||||
gl.uniform2f(PIXI.primitiveProgram.projectionVector, projection.x, projection.y);
|
gl.uniform2f(PIXI.primitiveProgram.projectionVector, projection.x, projection.y);
|
||||||
|
|
||||||
|
gl.uniform1f(PIXI.primitiveProgram.alpha, graphics.worldAlpha);
|
||||||
|
|
||||||
gl.bindBuffer(gl.ARRAY_BUFFER, graphics._webGL.buffer);
|
gl.bindBuffer(gl.ARRAY_BUFFER, graphics._webGL.buffer);
|
||||||
|
|
||||||
|
// WHY DOES THIS LINE NEED TO BE THERE???
|
||||||
|
gl.vertexAttribPointer(PIXI.shaderProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
|
||||||
|
// its not even used.. but need to be set or it breaks?
|
||||||
|
// only on pc though..
|
||||||
|
|
||||||
gl.vertexAttribPointer(PIXI.primitiveProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 4 * 6, 0);
|
gl.vertexAttribPointer(PIXI.primitiveProgram.vertexPositionAttribute, 2, gl.FLOAT, false, 4 * 6, 0);
|
||||||
gl.vertexAttribPointer(PIXI.primitiveProgram.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4);
|
gl.vertexAttribPointer(PIXI.primitiveProgram.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4);
|
||||||
|
|
||||||
|
// console.log(PIXI.primitiveProgram.vertexPositionAttribute);
|
||||||
|
//console.log("Color " + PIXI.primitiveProgram.colorAttribute);
|
||||||
|
|
||||||
// set the index buffer!
|
// set the index buffer!
|
||||||
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, graphics._webGL.indexBuffer);
|
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, graphics._webGL.indexBuffer);
|
||||||
|
|
||||||
|
|
||||||
gl.drawElements(gl.TRIANGLE_STRIP, graphics._webGL.indices.length, gl.UNSIGNED_SHORT, 0 );
|
gl.drawElements(gl.TRIANGLE_STRIP, graphics._webGL.indices.length, gl.UNSIGNED_SHORT, 0 );
|
||||||
|
|
||||||
// return to default shader...
|
// return to default shader...
|
||||||
|
@ -237,6 +257,7 @@ PIXI.WebGLGraphics.updateGraphics = function(graphics)
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
|
||||||
graphics._webGL.glPoints = new Float32Array(graphics._webGL.points);
|
graphics._webGL.glPoints = new Float32Array(graphics._webGL.points);
|
||||||
|
|
||||||
gl.bindBuffer(gl.ARRAY_BUFFER, graphics._webGL.buffer);
|
gl.bindBuffer(gl.ARRAY_BUFFER, graphics._webGL.buffer);
|
||||||
gl.bufferData(gl.ARRAY_BUFFER, graphics._webGL.glPoints, gl.STATIC_DRAW);
|
gl.bufferData(gl.ARRAY_BUFFER, graphics._webGL.glPoints, gl.STATIC_DRAW);
|
||||||
|
|
||||||
|
|
|
@ -928,6 +928,8 @@ PIXI.WebGLRenderGroup.prototype.renderStrip = function(strip, projection)
|
||||||
// set the matrix transform for the
|
// set the matrix transform for the
|
||||||
gl.uniformMatrix3fv(PIXI.stripShaderProgram.translationMatrix, false, m);
|
gl.uniformMatrix3fv(PIXI.stripShaderProgram.translationMatrix, false, m);
|
||||||
gl.uniform2f(PIXI.stripShaderProgram.projectionVector, projection.x, projection.y);
|
gl.uniform2f(PIXI.stripShaderProgram.projectionVector, projection.x, projection.y);
|
||||||
|
gl.uniform1f(PIXI.stripShaderProgram.alpha, strip.worldAlpha);
|
||||||
|
|
||||||
|
|
||||||
if(strip.blendMode == PIXI.blendModes.NORMAL)
|
if(strip.blendMode == PIXI.blendModes.NORMAL)
|
||||||
{
|
{
|
||||||
|
@ -938,6 +940,8 @@ PIXI.WebGLRenderGroup.prototype.renderStrip = function(strip, projection)
|
||||||
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
|
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!strip.dirty)
|
if(!strip.dirty)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -1030,7 +1034,7 @@ PIXI.WebGLRenderGroup.prototype.renderTilingSprite = function(sprite, projection
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
PIXI.WebGLRenderer.prototype.initStrip = function(strip)
|
PIXI.WebGLRenderGroup.prototype.initStrip = function(strip)
|
||||||
{
|
{
|
||||||
// build the strip!
|
// build the strip!
|
||||||
var gl = this.gl;
|
var gl = this.gl;
|
||||||
|
|
|
@ -191,7 +191,7 @@ PIXI.WebGLRenderer = function(width, height, view, transparent)
|
||||||
{
|
{
|
||||||
PIXI.gl = this.gl = this.view.getContext("experimental-webgl", {
|
PIXI.gl = this.gl = this.view.getContext("experimental-webgl", {
|
||||||
alpha: this.transparent,
|
alpha: this.transparent,
|
||||||
antialias:false, // SPEED UP??
|
antialias:true, // SPEED UP??
|
||||||
premultipliedAlpha:false
|
premultipliedAlpha:false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -446,9 +446,11 @@ PIXI.WebGLRenderer.prototype.handleContextRestored = function(event)
|
||||||
|
|
||||||
this.initShaders();
|
this.initShaders();
|
||||||
|
|
||||||
for (var i=0; i < PIXI.TextureCache.length; i++)
|
for(var key in PIXI.TextureCache)
|
||||||
{
|
{
|
||||||
this.updateTexture(PIXI.TextureCache[i]);
|
var texture = PIXI.TextureCache[key].baseTexture;
|
||||||
|
texture._glTexture = null;
|
||||||
|
PIXI.WebGLRenderer.updateTexture(texture);
|
||||||
};
|
};
|
||||||
|
|
||||||
for (var i=0; i < this.batchs.length; i++)
|
for (var i=0; i < this.batchs.length; i++)
|
||||||
|
|
|
@ -168,6 +168,7 @@ PIXI.shaderVertexSrc = [
|
||||||
"attribute vec2 aTextureCoord;",
|
"attribute vec2 aTextureCoord;",
|
||||||
"attribute float aColor;",
|
"attribute float aColor;",
|
||||||
//"uniform mat4 uMVMatrix;",
|
//"uniform mat4 uMVMatrix;",
|
||||||
|
|
||||||
"uniform vec2 projectionVector;",
|
"uniform vec2 projectionVector;",
|
||||||
"varying vec2 vTextureCoord;",
|
"varying vec2 vTextureCoord;",
|
||||||
"varying float vColor;",
|
"varying float vColor;",
|
||||||
|
@ -182,6 +183,20 @@ PIXI.shaderVertexSrc = [
|
||||||
/*
|
/*
|
||||||
* the triangle strip shader..
|
* the triangle strip shader..
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
PIXI.stripShaderFragmentSrc = [
|
||||||
|
"precision mediump float;",
|
||||||
|
"varying vec2 vTextureCoord;",
|
||||||
|
"varying float vColor;",
|
||||||
|
"uniform float alpha;",
|
||||||
|
"uniform sampler2D uSampler;",
|
||||||
|
"void main(void) {",
|
||||||
|
"gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));",
|
||||||
|
"gl_FragColor = gl_FragColor * alpha;",
|
||||||
|
"}"
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
PIXI.stripShaderVertexSrc = [
|
PIXI.stripShaderVertexSrc = [
|
||||||
"attribute vec2 aVertexPosition;",
|
"attribute vec2 aVertexPosition;",
|
||||||
"attribute vec2 aTextureCoord;",
|
"attribute vec2 aTextureCoord;",
|
||||||
|
@ -216,16 +231,18 @@ PIXI.primitiveShaderVertexSrc = [
|
||||||
"attribute vec4 aColor;",
|
"attribute vec4 aColor;",
|
||||||
"uniform mat3 translationMatrix;",
|
"uniform mat3 translationMatrix;",
|
||||||
"uniform vec2 projectionVector;",
|
"uniform vec2 projectionVector;",
|
||||||
|
"uniform float alpha;",
|
||||||
"varying vec4 vColor;",
|
"varying vec4 vColor;",
|
||||||
"void main(void) {",
|
"void main(void) {",
|
||||||
"vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);",
|
"vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);",
|
||||||
"gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);",
|
"gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);",
|
||||||
"vColor = aColor;",
|
"vColor = aColor * alpha;",
|
||||||
"}"
|
"}"
|
||||||
];
|
];
|
||||||
|
|
||||||
PIXI.initPrimitiveShader = function()
|
PIXI.initPrimitiveShader = function()
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
|
||||||
var shaderProgram = PIXI.compileProgram(PIXI.primitiveShaderVertexSrc, PIXI.primitiveShaderFragmentSrc)
|
var shaderProgram = PIXI.compileProgram(PIXI.primitiveShaderVertexSrc, PIXI.primitiveShaderFragmentSrc)
|
||||||
|
@ -234,8 +251,11 @@ PIXI.initPrimitiveShader = function()
|
||||||
|
|
||||||
shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
|
shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
|
||||||
shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
|
shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
|
||||||
|
|
||||||
shaderProgram.projectionVector = gl.getUniformLocation(shaderProgram, "projectionVector");
|
shaderProgram.projectionVector = gl.getUniformLocation(shaderProgram, "projectionVector");
|
||||||
shaderProgram.translationMatrix = gl.getUniformLocation(shaderProgram, "translationMatrix");
|
shaderProgram.translationMatrix = gl.getUniformLocation(shaderProgram, "translationMatrix");
|
||||||
|
|
||||||
|
shaderProgram.alpha = gl.getUniformLocation(shaderProgram, "alpha");
|
||||||
|
|
||||||
PIXI.primitiveProgram = shaderProgram;
|
PIXI.primitiveProgram = shaderProgram;
|
||||||
}
|
}
|
||||||
|
@ -252,7 +272,7 @@ PIXI.initDefaultShader = function()
|
||||||
shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
|
shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
|
||||||
shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
|
shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
|
||||||
|
|
||||||
shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
|
// shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
|
||||||
shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
|
shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
|
||||||
|
|
||||||
PIXI.shaderProgram = shaderProgram;
|
PIXI.shaderProgram = shaderProgram;
|
||||||
|
@ -261,7 +281,7 @@ PIXI.initDefaultShader = function()
|
||||||
PIXI.initDefaultStripShader = function()
|
PIXI.initDefaultStripShader = function()
|
||||||
{
|
{
|
||||||
var gl = this.gl;
|
var gl = this.gl;
|
||||||
var shaderProgram = PIXI.compileProgram(PIXI.stripShaderVertexSrc, PIXI.shaderFragmentSrc)
|
var shaderProgram = PIXI.compileProgram(PIXI.stripShaderVertexSrc, PIXI.stripShaderFragmentSrc)
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
@ -269,6 +289,7 @@ PIXI.initDefaultStripShader = function()
|
||||||
shaderProgram.projectionVector = gl.getUniformLocation(shaderProgram, "projectionVector");
|
shaderProgram.projectionVector = gl.getUniformLocation(shaderProgram, "projectionVector");
|
||||||
shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
|
shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
|
||||||
shaderProgram.translationMatrix = gl.getUniformLocation(shaderProgram, "translationMatrix");
|
shaderProgram.translationMatrix = gl.getUniformLocation(shaderProgram, "translationMatrix");
|
||||||
|
shaderProgram.alpha = gl.getUniformLocation(shaderProgram, "alpha");
|
||||||
|
|
||||||
shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
|
shaderProgram.colorAttribute = gl.getAttribLocation(shaderProgram, "aColor");
|
||||||
|
|
||||||
|
@ -311,9 +332,13 @@ PIXI.activateDefaultShader = function()
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
|
|
|
@ -256,7 +256,9 @@ PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin)
|
||||||
var baseTexture = PIXI.BaseTextureCache[imageUrl];
|
var baseTexture = PIXI.BaseTextureCache[imageUrl];
|
||||||
if(!baseTexture)
|
if(!baseTexture)
|
||||||
{
|
{
|
||||||
var image = new Image();
|
// new Image() breaks tex loading in some versions of Chrome.
|
||||||
|
// See https://code.google.com/p/chromium/issues/detail?id=238071
|
||||||
|
var image = new Image();//document.createElement('img');
|
||||||
if (crossorigin)
|
if (crossorigin)
|
||||||
{
|
{
|
||||||
image.crossOrigin = '';
|
image.crossOrigin = '';
|
||||||
|
|
|
@ -147,13 +147,33 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A RenderTexture is a special texture that allows any pixi displayObject to be rendered to it.
|
A RenderTexture is a special texture that allows any pixi displayObject to be rendered to it.
|
||||||
* @class RenderTexture
|
|
||||||
* @extends Texture
|
__Hint__: All DisplayObjects (exmpl. Sprites) that renders on RenderTexture should be preloaded.
|
||||||
* @constructor
|
Otherwise black rectangles will be drawn instead.
|
||||||
* @param width {Number}
|
|
||||||
* @param height {Number}
|
RenderTexture takes snapshot of DisplayObject passed to render method. If DisplayObject is passed to render method, position and rotation of it will be ignored. For example:
|
||||||
*/
|
|
||||||
|
var renderTexture = new PIXI.RenderTexture(800, 600);
|
||||||
|
var sprite = PIXI.Sprite.fromImage("spinObj_01.png");
|
||||||
|
sprite.position.x = 800/2;
|
||||||
|
sprite.position.y = 600/2;
|
||||||
|
sprite.anchor.x = 0.5;
|
||||||
|
sprite.anchor.y = 0.5;
|
||||||
|
renderTexture.render(sprite);
|
||||||
|
|
||||||
|
Sprite in this case will be rendered to 0,0 position. To render this sprite at center DisplayObjectContainer should be used:
|
||||||
|
|
||||||
|
var doc = new PIXI.DisplayObjectContainer();
|
||||||
|
doc.addChild(sprite);
|
||||||
|
renderTexture.render(doc); // Renders to center of renderTexture
|
||||||
|
|
||||||
|
@class RenderTexture
|
||||||
|
@extends Texture
|
||||||
|
@constructor
|
||||||
|
@param width {Number}
|
||||||
|
@param height {Number}
|
||||||
|
**/
|
||||||
PIXI.RenderTexture = function(width, height)
|
PIXI.RenderTexture = function(width, height)
|
||||||
{
|
{
|
||||||
PIXI.EventTarget.call( this );
|
PIXI.EventTarget.call( this );
|
||||||
|
|
|
@ -146,7 +146,7 @@
|
||||||
|
|
||||||
|
|
||||||
<div class="foundat">
|
<div class="foundat">
|
||||||
Defined in: <a href="../files/src_pixi_InteractionManager.js.html#l519"><code>src/pixi/InteractionManager.js:519</code></a>
|
Defined in: <a href="../files/src_pixi_InteractionManager.js.html#l524"><code>src/pixi/InteractionManager.js:524</code></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2012, Mat Groves
|
* Copyright (c) 2012, Mat Groves
|
||||||
* http://goodboydigital.com/
|
* http://goodboydigital.com/
|
||||||
*
|
*
|
||||||
* Compiled: 2013-06-23
|
* Compiled: 2013-06-24
|
||||||
*
|
*
|
||||||
* Pixi.JS is licensed under the MIT License.
|
* Pixi.JS is licensed under the MIT License.
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
@ -1836,6 +1836,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -1861,6 +1862,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
// loop through inteaction tree...
|
// loop through inteaction tree...
|
||||||
// hit test each item! ->
|
// hit test each item! ->
|
||||||
|
@ -1898,7 +1900,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var global = this.mouse.global;
|
var global = this.mouse.global;
|
||||||
|
|
||||||
|
@ -2031,6 +2033,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2055,6 +2058,7 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -2097,6 +2101,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2181,6 +2186,13 @@ PIXI.InteractionData = function()
|
||||||
* @type Sprite
|
* @type Sprite
|
||||||
*/
|
*/
|
||||||
this.target;
|
this.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When passed to an event handler, this will be the original DOM Event that was captured
|
||||||
|
* @property originalEvent
|
||||||
|
* @type Event
|
||||||
|
*/
|
||||||
|
this.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2817,21 +2829,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType)
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.activateDefaultShader = function()
|
|
||||||
{
|
|
||||||
var gl = PIXI.gl;
|
|
||||||
var shaderProgram = PIXI.shaderProgram;
|
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
{
|
{
|
||||||
|
@ -2852,6 +2849,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
return shaderProgram;
|
return shaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activateDefaultShader = function()
|
||||||
|
{
|
||||||
|
var gl = PIXI.gl;
|
||||||
|
var shaderProgram = PIXI.shaderProgram;
|
||||||
|
|
||||||
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PIXI.activatePrimitiveShader = function()
|
PIXI.activatePrimitiveShader = function()
|
||||||
{
|
{
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
@ -4240,7 +4253,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5671,6 +5684,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2012, Mat Groves
|
* Copyright (c) 2012, Mat Groves
|
||||||
* http://goodboydigital.com/
|
* http://goodboydigital.com/
|
||||||
*
|
*
|
||||||
* Compiled: 2013-06-23
|
* Compiled: 2013-06-24
|
||||||
*
|
*
|
||||||
* Pixi.JS is licensed under the MIT License.
|
* Pixi.JS is licensed under the MIT License.
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
@ -1836,6 +1836,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -1861,6 +1862,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
// loop through inteaction tree...
|
// loop through inteaction tree...
|
||||||
// hit test each item! ->
|
// hit test each item! ->
|
||||||
|
@ -1898,7 +1900,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var global = this.mouse.global;
|
var global = this.mouse.global;
|
||||||
|
|
||||||
|
@ -2031,6 +2033,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2055,6 +2058,7 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -2097,6 +2101,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2181,6 +2186,13 @@ PIXI.InteractionData = function()
|
||||||
* @type Sprite
|
* @type Sprite
|
||||||
*/
|
*/
|
||||||
this.target;
|
this.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When passed to an event handler, this will be the original DOM Event that was captured
|
||||||
|
* @property originalEvent
|
||||||
|
* @type Event
|
||||||
|
*/
|
||||||
|
this.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2817,21 +2829,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType)
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.activateDefaultShader = function()
|
|
||||||
{
|
|
||||||
var gl = PIXI.gl;
|
|
||||||
var shaderProgram = PIXI.shaderProgram;
|
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
{
|
{
|
||||||
|
@ -2852,6 +2849,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
return shaderProgram;
|
return shaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activateDefaultShader = function()
|
||||||
|
{
|
||||||
|
var gl = PIXI.gl;
|
||||||
|
var shaderProgram = PIXI.shaderProgram;
|
||||||
|
|
||||||
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PIXI.activatePrimitiveShader = function()
|
PIXI.activatePrimitiveShader = function()
|
||||||
{
|
{
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
@ -4240,7 +4253,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5671,6 +5684,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2012, Mat Groves
|
* Copyright (c) 2012, Mat Groves
|
||||||
* http://goodboydigital.com/
|
* http://goodboydigital.com/
|
||||||
*
|
*
|
||||||
* Compiled: 2013-06-23
|
* Compiled: 2013-06-24
|
||||||
*
|
*
|
||||||
* Pixi.JS is licensed under the MIT License.
|
* Pixi.JS is licensed under the MIT License.
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
@ -1836,6 +1836,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -1861,6 +1862,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
// loop through inteaction tree...
|
// loop through inteaction tree...
|
||||||
// hit test each item! ->
|
// hit test each item! ->
|
||||||
|
@ -1898,7 +1900,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var global = this.mouse.global;
|
var global = this.mouse.global;
|
||||||
|
|
||||||
|
@ -2031,6 +2033,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2055,6 +2058,7 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -2097,6 +2101,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2181,6 +2186,13 @@ PIXI.InteractionData = function()
|
||||||
* @type Sprite
|
* @type Sprite
|
||||||
*/
|
*/
|
||||||
this.target;
|
this.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When passed to an event handler, this will be the original DOM Event that was captured
|
||||||
|
* @property originalEvent
|
||||||
|
* @type Event
|
||||||
|
*/
|
||||||
|
this.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2817,21 +2829,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType)
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.activateDefaultShader = function()
|
|
||||||
{
|
|
||||||
var gl = PIXI.gl;
|
|
||||||
var shaderProgram = PIXI.shaderProgram;
|
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
{
|
{
|
||||||
|
@ -2852,6 +2849,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
return shaderProgram;
|
return shaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activateDefaultShader = function()
|
||||||
|
{
|
||||||
|
var gl = PIXI.gl;
|
||||||
|
var shaderProgram = PIXI.shaderProgram;
|
||||||
|
|
||||||
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PIXI.activatePrimitiveShader = function()
|
PIXI.activatePrimitiveShader = function()
|
||||||
{
|
{
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
@ -4240,7 +4253,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5671,6 +5684,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2012, Mat Groves
|
* Copyright (c) 2012, Mat Groves
|
||||||
* http://goodboydigital.com/
|
* http://goodboydigital.com/
|
||||||
*
|
*
|
||||||
* Compiled: 2013-06-23
|
* Compiled: 2013-06-24
|
||||||
*
|
*
|
||||||
* Pixi.JS is licensed under the MIT License.
|
* Pixi.JS is licensed under the MIT License.
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
@ -1836,6 +1836,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -1861,6 +1862,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
// loop through inteaction tree...
|
// loop through inteaction tree...
|
||||||
// hit test each item! ->
|
// hit test each item! ->
|
||||||
|
@ -1898,7 +1900,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var global = this.mouse.global;
|
var global = this.mouse.global;
|
||||||
|
|
||||||
|
@ -2031,6 +2033,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2055,6 +2058,7 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -2097,6 +2101,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2181,6 +2186,13 @@ PIXI.InteractionData = function()
|
||||||
* @type Sprite
|
* @type Sprite
|
||||||
*/
|
*/
|
||||||
this.target;
|
this.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When passed to an event handler, this will be the original DOM Event that was captured
|
||||||
|
* @property originalEvent
|
||||||
|
* @type Event
|
||||||
|
*/
|
||||||
|
this.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2817,21 +2829,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType)
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.activateDefaultShader = function()
|
|
||||||
{
|
|
||||||
var gl = PIXI.gl;
|
|
||||||
var shaderProgram = PIXI.shaderProgram;
|
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
{
|
{
|
||||||
|
@ -2852,6 +2849,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
return shaderProgram;
|
return shaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activateDefaultShader = function()
|
||||||
|
{
|
||||||
|
var gl = PIXI.gl;
|
||||||
|
var shaderProgram = PIXI.shaderProgram;
|
||||||
|
|
||||||
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PIXI.activatePrimitiveShader = function()
|
PIXI.activatePrimitiveShader = function()
|
||||||
{
|
{
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
@ -4240,7 +4253,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5671,6 +5684,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2012, Mat Groves
|
* Copyright (c) 2012, Mat Groves
|
||||||
* http://goodboydigital.com/
|
* http://goodboydigital.com/
|
||||||
*
|
*
|
||||||
* Compiled: 2013-06-23
|
* Compiled: 2013-06-24
|
||||||
*
|
*
|
||||||
* Pixi.JS is licensed under the MIT License.
|
* Pixi.JS is licensed under the MIT License.
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
@ -1836,6 +1836,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -1861,6 +1862,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
// loop through inteaction tree...
|
// loop through inteaction tree...
|
||||||
// hit test each item! ->
|
// hit test each item! ->
|
||||||
|
@ -1898,7 +1900,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var global = this.mouse.global;
|
var global = this.mouse.global;
|
||||||
|
|
||||||
|
@ -2031,6 +2033,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2055,6 +2058,7 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -2097,6 +2101,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2181,6 +2186,13 @@ PIXI.InteractionData = function()
|
||||||
* @type Sprite
|
* @type Sprite
|
||||||
*/
|
*/
|
||||||
this.target;
|
this.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When passed to an event handler, this will be the original DOM Event that was captured
|
||||||
|
* @property originalEvent
|
||||||
|
* @type Event
|
||||||
|
*/
|
||||||
|
this.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2817,21 +2829,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType)
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.activateDefaultShader = function()
|
|
||||||
{
|
|
||||||
var gl = PIXI.gl;
|
|
||||||
var shaderProgram = PIXI.shaderProgram;
|
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
{
|
{
|
||||||
|
@ -2852,6 +2849,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
return shaderProgram;
|
return shaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activateDefaultShader = function()
|
||||||
|
{
|
||||||
|
var gl = PIXI.gl;
|
||||||
|
var shaderProgram = PIXI.shaderProgram;
|
||||||
|
|
||||||
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PIXI.activatePrimitiveShader = function()
|
PIXI.activatePrimitiveShader = function()
|
||||||
{
|
{
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
@ -4240,7 +4253,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5671,6 +5684,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
BIN
examples/example 13.zip
Normal file
BIN
examples/example 13.zip
Normal file
Binary file not shown.
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2012, Mat Groves
|
* Copyright (c) 2012, Mat Groves
|
||||||
* http://goodboydigital.com/
|
* http://goodboydigital.com/
|
||||||
*
|
*
|
||||||
* Compiled: 2013-06-23
|
* Compiled: 2013-06-24
|
||||||
*
|
*
|
||||||
* Pixi.JS is licensed under the MIT License.
|
* Pixi.JS is licensed under the MIT License.
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
@ -1836,6 +1836,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -1861,6 +1862,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
// loop through inteaction tree...
|
// loop through inteaction tree...
|
||||||
// hit test each item! ->
|
// hit test each item! ->
|
||||||
|
@ -1898,7 +1900,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var global = this.mouse.global;
|
var global = this.mouse.global;
|
||||||
|
|
||||||
|
@ -2031,6 +2033,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2055,6 +2058,7 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -2097,6 +2101,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2181,6 +2186,13 @@ PIXI.InteractionData = function()
|
||||||
* @type Sprite
|
* @type Sprite
|
||||||
*/
|
*/
|
||||||
this.target;
|
this.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When passed to an event handler, this will be the original DOM Event that was captured
|
||||||
|
* @property originalEvent
|
||||||
|
* @type Event
|
||||||
|
*/
|
||||||
|
this.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2817,21 +2829,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType)
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.activateDefaultShader = function()
|
|
||||||
{
|
|
||||||
var gl = PIXI.gl;
|
|
||||||
var shaderProgram = PIXI.shaderProgram;
|
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
{
|
{
|
||||||
|
@ -2852,6 +2849,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
return shaderProgram;
|
return shaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activateDefaultShader = function()
|
||||||
|
{
|
||||||
|
var gl = PIXI.gl;
|
||||||
|
var shaderProgram = PIXI.shaderProgram;
|
||||||
|
|
||||||
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PIXI.activatePrimitiveShader = function()
|
PIXI.activatePrimitiveShader = function()
|
||||||
{
|
{
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
@ -4240,7 +4253,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5671,6 +5684,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2012, Mat Groves
|
* Copyright (c) 2012, Mat Groves
|
||||||
* http://goodboydigital.com/
|
* http://goodboydigital.com/
|
||||||
*
|
*
|
||||||
* Compiled: 2013-06-23
|
* Compiled: 2013-06-24
|
||||||
*
|
*
|
||||||
* Pixi.JS is licensed under the MIT License.
|
* Pixi.JS is licensed under the MIT License.
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
@ -1836,6 +1836,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -1861,6 +1862,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
// loop through inteaction tree...
|
// loop through inteaction tree...
|
||||||
// hit test each item! ->
|
// hit test each item! ->
|
||||||
|
@ -1898,7 +1900,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var global = this.mouse.global;
|
var global = this.mouse.global;
|
||||||
|
|
||||||
|
@ -2031,6 +2033,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2055,6 +2058,7 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -2097,6 +2101,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2181,6 +2186,13 @@ PIXI.InteractionData = function()
|
||||||
* @type Sprite
|
* @type Sprite
|
||||||
*/
|
*/
|
||||||
this.target;
|
this.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When passed to an event handler, this will be the original DOM Event that was captured
|
||||||
|
* @property originalEvent
|
||||||
|
* @type Event
|
||||||
|
*/
|
||||||
|
this.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2817,21 +2829,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType)
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.activateDefaultShader = function()
|
|
||||||
{
|
|
||||||
var gl = PIXI.gl;
|
|
||||||
var shaderProgram = PIXI.shaderProgram;
|
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
{
|
{
|
||||||
|
@ -2852,6 +2849,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
return shaderProgram;
|
return shaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activateDefaultShader = function()
|
||||||
|
{
|
||||||
|
var gl = PIXI.gl;
|
||||||
|
var shaderProgram = PIXI.shaderProgram;
|
||||||
|
|
||||||
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PIXI.activatePrimitiveShader = function()
|
PIXI.activatePrimitiveShader = function()
|
||||||
{
|
{
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
@ -4240,7 +4253,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5671,6 +5684,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2012, Mat Groves
|
* Copyright (c) 2012, Mat Groves
|
||||||
* http://goodboydigital.com/
|
* http://goodboydigital.com/
|
||||||
*
|
*
|
||||||
* Compiled: 2013-06-23
|
* Compiled: 2013-06-24
|
||||||
*
|
*
|
||||||
* Pixi.JS is licensed under the MIT License.
|
* Pixi.JS is licensed under the MIT License.
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
@ -1836,6 +1836,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -1861,6 +1862,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
// loop through inteaction tree...
|
// loop through inteaction tree...
|
||||||
// hit test each item! ->
|
// hit test each item! ->
|
||||||
|
@ -1898,7 +1900,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var global = this.mouse.global;
|
var global = this.mouse.global;
|
||||||
|
|
||||||
|
@ -2031,6 +2033,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2055,6 +2058,7 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -2097,6 +2101,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2181,6 +2186,13 @@ PIXI.InteractionData = function()
|
||||||
* @type Sprite
|
* @type Sprite
|
||||||
*/
|
*/
|
||||||
this.target;
|
this.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When passed to an event handler, this will be the original DOM Event that was captured
|
||||||
|
* @property originalEvent
|
||||||
|
* @type Event
|
||||||
|
*/
|
||||||
|
this.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2817,21 +2829,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType)
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.activateDefaultShader = function()
|
|
||||||
{
|
|
||||||
var gl = PIXI.gl;
|
|
||||||
var shaderProgram = PIXI.shaderProgram;
|
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
{
|
{
|
||||||
|
@ -2852,6 +2849,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
return shaderProgram;
|
return shaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activateDefaultShader = function()
|
||||||
|
{
|
||||||
|
var gl = PIXI.gl;
|
||||||
|
var shaderProgram = PIXI.shaderProgram;
|
||||||
|
|
||||||
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PIXI.activatePrimitiveShader = function()
|
PIXI.activatePrimitiveShader = function()
|
||||||
{
|
{
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
@ -4240,7 +4253,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5671,6 +5684,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2012, Mat Groves
|
* Copyright (c) 2012, Mat Groves
|
||||||
* http://goodboydigital.com/
|
* http://goodboydigital.com/
|
||||||
*
|
*
|
||||||
* Compiled: 2013-06-23
|
* Compiled: 2013-06-24
|
||||||
*
|
*
|
||||||
* Pixi.JS is licensed under the MIT License.
|
* Pixi.JS is licensed under the MIT License.
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
@ -1836,6 +1836,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -1861,6 +1862,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
// loop through inteaction tree...
|
// loop through inteaction tree...
|
||||||
// hit test each item! ->
|
// hit test each item! ->
|
||||||
|
@ -1898,7 +1900,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var global = this.mouse.global;
|
var global = this.mouse.global;
|
||||||
|
|
||||||
|
@ -2031,6 +2033,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2055,6 +2058,7 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -2097,6 +2101,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2181,6 +2186,13 @@ PIXI.InteractionData = function()
|
||||||
* @type Sprite
|
* @type Sprite
|
||||||
*/
|
*/
|
||||||
this.target;
|
this.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When passed to an event handler, this will be the original DOM Event that was captured
|
||||||
|
* @property originalEvent
|
||||||
|
* @type Event
|
||||||
|
*/
|
||||||
|
this.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2817,21 +2829,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType)
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.activateDefaultShader = function()
|
|
||||||
{
|
|
||||||
var gl = PIXI.gl;
|
|
||||||
var shaderProgram = PIXI.shaderProgram;
|
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
{
|
{
|
||||||
|
@ -2852,6 +2849,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
return shaderProgram;
|
return shaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activateDefaultShader = function()
|
||||||
|
{
|
||||||
|
var gl = PIXI.gl;
|
||||||
|
var shaderProgram = PIXI.shaderProgram;
|
||||||
|
|
||||||
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PIXI.activatePrimitiveShader = function()
|
PIXI.activatePrimitiveShader = function()
|
||||||
{
|
{
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
@ -4240,7 +4253,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5671,6 +5684,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2012, Mat Groves
|
* Copyright (c) 2012, Mat Groves
|
||||||
* http://goodboydigital.com/
|
* http://goodboydigital.com/
|
||||||
*
|
*
|
||||||
* Compiled: 2013-06-23
|
* Compiled: 2013-06-24
|
||||||
*
|
*
|
||||||
* Pixi.JS is licensed under the MIT License.
|
* Pixi.JS is licensed under the MIT License.
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
@ -1836,6 +1836,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -1861,6 +1862,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
// loop through inteaction tree...
|
// loop through inteaction tree...
|
||||||
// hit test each item! ->
|
// hit test each item! ->
|
||||||
|
@ -1898,7 +1900,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var global = this.mouse.global;
|
var global = this.mouse.global;
|
||||||
|
|
||||||
|
@ -2031,6 +2033,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2055,6 +2058,7 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -2097,6 +2101,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2181,6 +2186,13 @@ PIXI.InteractionData = function()
|
||||||
* @type Sprite
|
* @type Sprite
|
||||||
*/
|
*/
|
||||||
this.target;
|
this.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When passed to an event handler, this will be the original DOM Event that was captured
|
||||||
|
* @property originalEvent
|
||||||
|
* @type Event
|
||||||
|
*/
|
||||||
|
this.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2817,21 +2829,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType)
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.activateDefaultShader = function()
|
|
||||||
{
|
|
||||||
var gl = PIXI.gl;
|
|
||||||
var shaderProgram = PIXI.shaderProgram;
|
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
{
|
{
|
||||||
|
@ -2852,6 +2849,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
return shaderProgram;
|
return shaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activateDefaultShader = function()
|
||||||
|
{
|
||||||
|
var gl = PIXI.gl;
|
||||||
|
var shaderProgram = PIXI.shaderProgram;
|
||||||
|
|
||||||
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PIXI.activatePrimitiveShader = function()
|
PIXI.activatePrimitiveShader = function()
|
||||||
{
|
{
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
@ -4240,7 +4253,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5671,6 +5684,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2012, Mat Groves
|
* Copyright (c) 2012, Mat Groves
|
||||||
* http://goodboydigital.com/
|
* http://goodboydigital.com/
|
||||||
*
|
*
|
||||||
* Compiled: 2013-06-23
|
* Compiled: 2013-06-24
|
||||||
*
|
*
|
||||||
* Pixi.JS is licensed under the MIT License.
|
* Pixi.JS is licensed under the MIT License.
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
@ -1836,6 +1836,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -1861,6 +1862,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
// loop through inteaction tree...
|
// loop through inteaction tree...
|
||||||
// hit test each item! ->
|
// hit test each item! ->
|
||||||
|
@ -1898,7 +1900,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var global = this.mouse.global;
|
var global = this.mouse.global;
|
||||||
|
|
||||||
|
@ -2031,6 +2033,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2055,6 +2058,7 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -2097,6 +2101,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2181,6 +2186,13 @@ PIXI.InteractionData = function()
|
||||||
* @type Sprite
|
* @type Sprite
|
||||||
*/
|
*/
|
||||||
this.target;
|
this.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When passed to an event handler, this will be the original DOM Event that was captured
|
||||||
|
* @property originalEvent
|
||||||
|
* @type Event
|
||||||
|
*/
|
||||||
|
this.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2817,21 +2829,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType)
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.activateDefaultShader = function()
|
|
||||||
{
|
|
||||||
var gl = PIXI.gl;
|
|
||||||
var shaderProgram = PIXI.shaderProgram;
|
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
{
|
{
|
||||||
|
@ -2852,6 +2849,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
return shaderProgram;
|
return shaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activateDefaultShader = function()
|
||||||
|
{
|
||||||
|
var gl = PIXI.gl;
|
||||||
|
var shaderProgram = PIXI.shaderProgram;
|
||||||
|
|
||||||
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PIXI.activatePrimitiveShader = function()
|
PIXI.activatePrimitiveShader = function()
|
||||||
{
|
{
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
@ -4240,7 +4253,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5671,6 +5684,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2012, Mat Groves
|
* Copyright (c) 2012, Mat Groves
|
||||||
* http://goodboydigital.com/
|
* http://goodboydigital.com/
|
||||||
*
|
*
|
||||||
* Compiled: 2013-06-23
|
* Compiled: 2013-06-24
|
||||||
*
|
*
|
||||||
* Pixi.JS is licensed under the MIT License.
|
* Pixi.JS is licensed under the MIT License.
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
@ -1836,6 +1836,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -1861,6 +1862,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
// loop through inteaction tree...
|
// loop through inteaction tree...
|
||||||
// hit test each item! ->
|
// hit test each item! ->
|
||||||
|
@ -1898,7 +1900,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var global = this.mouse.global;
|
var global = this.mouse.global;
|
||||||
|
|
||||||
|
@ -2031,6 +2033,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2055,6 +2058,7 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -2097,6 +2101,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2181,6 +2186,13 @@ PIXI.InteractionData = function()
|
||||||
* @type Sprite
|
* @type Sprite
|
||||||
*/
|
*/
|
||||||
this.target;
|
this.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When passed to an event handler, this will be the original DOM Event that was captured
|
||||||
|
* @property originalEvent
|
||||||
|
* @type Event
|
||||||
|
*/
|
||||||
|
this.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2817,21 +2829,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType)
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.activateDefaultShader = function()
|
|
||||||
{
|
|
||||||
var gl = PIXI.gl;
|
|
||||||
var shaderProgram = PIXI.shaderProgram;
|
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
{
|
{
|
||||||
|
@ -2852,6 +2849,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
return shaderProgram;
|
return shaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activateDefaultShader = function()
|
||||||
|
{
|
||||||
|
var gl = PIXI.gl;
|
||||||
|
var shaderProgram = PIXI.shaderProgram;
|
||||||
|
|
||||||
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PIXI.activatePrimitiveShader = function()
|
PIXI.activatePrimitiveShader = function()
|
||||||
{
|
{
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
@ -4240,7 +4253,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5671,6 +5684,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2012, Mat Groves
|
* Copyright (c) 2012, Mat Groves
|
||||||
* http://goodboydigital.com/
|
* http://goodboydigital.com/
|
||||||
*
|
*
|
||||||
* Compiled: 2013-06-23
|
* Compiled: 2013-06-24
|
||||||
*
|
*
|
||||||
* Pixi.JS is licensed under the MIT License.
|
* Pixi.JS is licensed under the MIT License.
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
@ -1836,6 +1836,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -1861,6 +1862,7 @@ PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
// loop through inteaction tree...
|
// loop through inteaction tree...
|
||||||
// hit test each item! ->
|
// hit test each item! ->
|
||||||
|
@ -1898,7 +1900,7 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var global = this.mouse.global;
|
var global = this.mouse.global;
|
||||||
|
|
||||||
|
@ -2031,6 +2033,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2055,6 +2058,7 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
|
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
|
|
||||||
|
@ -2097,6 +2101,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||||
|
|
||||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||||
{
|
{
|
||||||
|
this.mouse.originalEvent = event || window.event; //IE uses window.event
|
||||||
var rect = this.target.view.getBoundingClientRect();
|
var rect = this.target.view.getBoundingClientRect();
|
||||||
var changedTouches = event.changedTouches;
|
var changedTouches = event.changedTouches;
|
||||||
|
|
||||||
|
@ -2181,6 +2186,13 @@ PIXI.InteractionData = function()
|
||||||
* @type Sprite
|
* @type Sprite
|
||||||
*/
|
*/
|
||||||
this.target;
|
this.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When passed to an event handler, this will be the original DOM Event that was captured
|
||||||
|
* @property originalEvent
|
||||||
|
* @type Event
|
||||||
|
*/
|
||||||
|
this.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2817,21 +2829,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType)
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.activateDefaultShader = function()
|
|
||||||
{
|
|
||||||
var gl = PIXI.gl;
|
|
||||||
var shaderProgram = PIXI.shaderProgram;
|
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
{
|
{
|
||||||
|
@ -2852,6 +2849,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
return shaderProgram;
|
return shaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activateDefaultShader = function()
|
||||||
|
{
|
||||||
|
var gl = PIXI.gl;
|
||||||
|
var shaderProgram = PIXI.shaderProgram;
|
||||||
|
|
||||||
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PIXI.activatePrimitiveShader = function()
|
PIXI.activatePrimitiveShader = function()
|
||||||
{
|
{
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
@ -4240,7 +4253,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5671,6 +5684,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
|
||||||
|
* It is important to know that with the webGL renderer only simple polys can be filled at this stage
|
||||||
|
* Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
|
||||||
* @class Graphics
|
* @class Graphics
|
||||||
* @extends DisplayObjectContainer
|
* @extends DisplayObjectContainer
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
|
@ -579,6 +579,6 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
|
||||||
var len = end - start;
|
var len = end - start;
|
||||||
// console.log(this.size)
|
// console.log(this.size)
|
||||||
// DRAW THAT this!
|
// DRAW THAT this!
|
||||||
// gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
gl.drawElements(gl.TRIANGLES, len * 6, gl.UNSIGNED_SHORT, start * 2 * 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -180,21 +180,6 @@ PIXI._CompileShader = function(gl, shaderSrc, shaderType)
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.activateDefaultShader = function()
|
|
||||||
{
|
|
||||||
var gl = PIXI.gl;
|
|
||||||
var shaderProgram = PIXI.shaderProgram;
|
|
||||||
|
|
||||||
gl.useProgram(shaderProgram);
|
|
||||||
|
|
||||||
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
|
||||||
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
{
|
{
|
||||||
|
@ -215,6 +200,22 @@ PIXI.compileProgram = function(vertexSrc, fragmentSrc)
|
||||||
return shaderProgram;
|
return shaderProgram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIXI.activateDefaultShader = function()
|
||||||
|
{
|
||||||
|
var gl = PIXI.gl;
|
||||||
|
var shaderProgram = PIXI.shaderProgram;
|
||||||
|
|
||||||
|
gl.useProgram(shaderProgram);
|
||||||
|
|
||||||
|
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);
|
||||||
|
gl.enableVertexAttribArray(shaderProgram.colorAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PIXI.activatePrimitiveShader = function()
|
PIXI.activatePrimitiveShader = function()
|
||||||
{
|
{
|
||||||
var gl = PIXI.gl;
|
var gl = PIXI.gl;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue