Interactivity Added
-Interaction Manager added to pixi.js to enable mouse and touch interactivity. - Interactive example added to examples folder - docs updated - build file updated
This commit is contained in:
parent
9a0cd873b5
commit
f5cc062922
63 changed files with 4844 additions and 280 deletions
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
@ -187,6 +191,9 @@ PIXI.DisplayObject = function()
|
|||
this._cr = 1;
|
||||
|
||||
this.renderable = false;
|
||||
|
||||
// NOT YET :/ This only applies to children within the container..
|
||||
this.interactive = true;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -200,7 +207,7 @@ PIXI.DisplayObject.prototype.updateTransform = function()
|
|||
// TODO OPTIMIZE THIS!! with dirty
|
||||
if(this.rotation != this.rotationCache)
|
||||
{
|
||||
this.rotationCach = this.rotation;
|
||||
this.rotationCache = this.rotation;
|
||||
this._sr = Math.sin(this.rotation);
|
||||
this._cr = Math.cos(this.rotation);
|
||||
}
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
@ -134,7 +138,7 @@ PIXI.DisplayObjectContainer = function()
|
|||
* @property children {Array}
|
||||
*/
|
||||
this.children = [];
|
||||
|
||||
//s
|
||||
this.renderable = false;
|
||||
}
|
||||
|
||||
|
@ -247,7 +251,7 @@ PIXI.DisplayObjectContainer.prototype.updateTransform = function()
|
|||
if(!this.visible)return;
|
||||
|
||||
PIXI.DisplayObject.prototype.updateTransform.call( this );
|
||||
|
||||
|
||||
for(var i=0,j=this.children.length; i<j; i++)
|
||||
{
|
||||
this.children[i].updateTransform();
|
||||
|
|
483
docs/files/pixi_InteractionManager.js.html
Normal file
483
docs/files/pixi_InteractionManager.js.html
Normal file
|
@ -0,0 +1,483 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>pixi/InteractionManager.js - Pixi.js API</title>
|
||||
<link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0pr2/build/cssgrids/cssgrids-min.css">
|
||||
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
||||
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
||||
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
|
||||
<script src="http://yui.yahooapis.com/combo?3.8.0pr2/build/yui/yui-min.js"></script>
|
||||
</head>
|
||||
<body class="yui3-skin-sam">
|
||||
|
||||
<div id="doc">
|
||||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
||||
<div class="yui3-u-1-4">
|
||||
<div id="docs-sidebar" class="sidebar apidocs">
|
||||
<div id="api-list">
|
||||
<h2 class="off-left">APIs</h2>
|
||||
<div id="api-tabview" class="tabview">
|
||||
<ul class="tabs">
|
||||
<li><a href="#api-classes">Classes</a></li>
|
||||
<li><a href="#api-modules">Modules</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="api-tabview-filter">
|
||||
<input type="search" id="api-filter" placeholder="Type to filter APIs">
|
||||
</div>
|
||||
|
||||
<div id="api-tabview-panel">
|
||||
<ul id="api-classes" class="apis classes">
|
||||
|
||||
<li><a href="../classes/AssetLoader.html">AssetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/Stage.html">Stage</a></li>
|
||||
|
||||
<li><a href="../classes/Texture.html">Texture</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLBatch.html">WebGLBatch</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLRenderer.html">WebGLRenderer</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<ul id="api-modules" class="apis modules">
|
||||
|
||||
<li><a href="../modules/PIXI.html">PIXI</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="yui3-u-3-4">
|
||||
<div id="api-options">
|
||||
Show:
|
||||
<label for="api-show-inherited">
|
||||
<input type="checkbox" id="api-show-inherited" checked>
|
||||
Inherited
|
||||
</label>
|
||||
|
||||
<label for="api-show-protected">
|
||||
<input type="checkbox" id="api-show-protected">
|
||||
Protected
|
||||
</label>
|
||||
|
||||
<label for="api-show-private">
|
||||
<input type="checkbox" id="api-show-private">
|
||||
Private
|
||||
</label>
|
||||
<label for="api-show-deprecated">
|
||||
<input type="checkbox" id="api-show-deprecated">
|
||||
Deprecated
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="apidocs">
|
||||
<div id="docs-main">
|
||||
<div class="content">
|
||||
<h1 class="file-heading">File: pixi/InteractionManager.js</h1>
|
||||
|
||||
<div class="file">
|
||||
<pre class="code prettyprint linenums">
|
||||
/**
|
||||
* @author Mat Groves http://matgroves.com/ @Doormat23
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
The interaction manager deals with mouse and touch events. At this moment only Sprite's can be interactive.
|
||||
This manager also supports multitouch.
|
||||
@class InteractionManager
|
||||
@constructor
|
||||
@param stage {Stage}
|
||||
@type Stage
|
||||
*/
|
||||
PIXI.InteractionManager = function(stage)
|
||||
{
|
||||
/**
|
||||
* a refference to the stage
|
||||
* @property stage
|
||||
* @type Stage
|
||||
*/
|
||||
this.stage = stage;
|
||||
|
||||
// helpers
|
||||
this.tempPoint = new PIXI.Point();
|
||||
this.tempMatrix = mat3.create();
|
||||
|
||||
this.mouseoverEnabled = true;
|
||||
|
||||
/**
|
||||
* the mouse data
|
||||
* @property mouse
|
||||
* @type InteractionData
|
||||
*/
|
||||
this.mouse = new PIXI.InteractionData();
|
||||
|
||||
/**
|
||||
* an object that stores current touches (InteractionData) by id reference
|
||||
* @property touchs
|
||||
* @type Object
|
||||
*/
|
||||
this.touchs = {};
|
||||
|
||||
//tiny little interactiveData pool!
|
||||
this.pool = [];
|
||||
|
||||
this.interactiveItems = [];
|
||||
}
|
||||
|
||||
// constructor
|
||||
PIXI.InteractionManager.constructor = PIXI.InteractionManager;
|
||||
|
||||
/**
|
||||
* This method will disable rollover/rollout for ALL interactive items
|
||||
* You may wish to use this an optimization if your app does not require rollover/rollout funcitonality
|
||||
* @method disableMouseOver
|
||||
*/
|
||||
PIXI.InteractionManager.prototype.disableMouseOver = function()
|
||||
{
|
||||
if(!this.mouseoverEnabled)return;
|
||||
|
||||
this.mouseoverEnabled = false;
|
||||
if(this.target)this.target.view.removeEventListener('mousemove', this.onMouseMove.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will enable rollover/rollout for ALL interactive items
|
||||
* It is enabled by default
|
||||
* @method enableMouseOver
|
||||
*/
|
||||
PIXI.InteractionManager.prototype.enableMouseOver = function()
|
||||
{
|
||||
if(this.mouseoverEnabled)return;
|
||||
|
||||
this.mouseoverEnabled = false;
|
||||
if(this.target)this.target.view.addEventListener('mousemove', this.onMouseMove.bind(this));
|
||||
}
|
||||
|
||||
PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObject)
|
||||
{
|
||||
var children = displayObject.children;
|
||||
var length = children.length;
|
||||
|
||||
for (var i = length - 1; i >= 0; i--)
|
||||
{
|
||||
var child = children[i];
|
||||
|
||||
// only sprite's right now...
|
||||
if(child instanceof PIXI.Sprite)
|
||||
{
|
||||
if(child.interactive)this.interactiveItems.push(child);
|
||||
}
|
||||
else
|
||||
{
|
||||
// use this to optimize..
|
||||
if(!child.interactive)continue;
|
||||
}
|
||||
|
||||
if(child.children.length > 0)
|
||||
{
|
||||
this.collectInteractiveSprite(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PIXI.InteractionManager.prototype.setTarget = function(target)
|
||||
{
|
||||
this.target = target;
|
||||
if(this.mouseoverEnabled)target.view.addEventListener('mousemove', this.onMouseMove.bind(this), true);
|
||||
target.view.addEventListener('mousedown', this.onMouseDown.bind(this), true);
|
||||
target.view.addEventListener('mouseup', this.onMouseUp.bind(this), true);
|
||||
target.view.addEventListener('mouseout', this.onMouseUp.bind(this), true);
|
||||
|
||||
// aint no multi touch just yet!
|
||||
target.view.addEventListener("touchstart", this.onTouchStart.bind(this), true);
|
||||
target.view.addEventListener("touchend", this.onTouchEnd.bind(this), true);
|
||||
target.view.addEventListener("touchmove", this.onTouchMove.bind(this), true);
|
||||
}
|
||||
|
||||
PIXI.InteractionManager.prototype.hitTest = function(interactionData)
|
||||
{
|
||||
if(this.dirty)
|
||||
{
|
||||
this.dirty = false;
|
||||
this.interactiveItems = [];
|
||||
// go through and collect all the objects that are interactive..
|
||||
this.collectInteractiveSprite(this.stage);
|
||||
}
|
||||
|
||||
var tempPoint = this.tempPoint;
|
||||
var tempMatrix = this.tempMatrix;
|
||||
var global = interactionData.global;
|
||||
|
||||
var length = this.interactiveItems.length;
|
||||
|
||||
for (var i = 0; i < length; i++)
|
||||
{
|
||||
var item = this.interactiveItems[i];
|
||||
if(!item.visible)continue;
|
||||
|
||||
// TODO this could do with some optimizing!
|
||||
// maybe store the inverse?
|
||||
// or do a lazy check first?
|
||||
//mat3.inverse(item.worldTransform, tempMatrix);
|
||||
//tempPoint.x = tempMatrix[0] * global.x + tempMatrix[1] * global.y + tempMatrix[2];
|
||||
//tempPoint.y = tempMatrix[4] * global.y + tempMatrix[3] * global.x + tempMatrix[5];
|
||||
|
||||
// OPTIMIZED! assuming the matrix transform is affine.. which it totally shold be!
|
||||
|
||||
var worldTransform = item.worldTransform;
|
||||
|
||||
var a00 = worldTransform[0], a01 = worldTransform[1], a02 = worldTransform[2],
|
||||
a10 = worldTransform[3], a11 = worldTransform[4], a12 = worldTransform[5],
|
||||
id = 1 / (a00 * a11 + a01 * -a10);
|
||||
|
||||
tempPoint.x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id;
|
||||
tempPoint.y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id;
|
||||
|
||||
|
||||
var x1 = -item.width * item.anchor.x
|
||||
|
||||
if(tempPoint.x > x1 && tempPoint.x < x1 + item.width)
|
||||
{
|
||||
var y1 = -item.height * item.anchor.y;
|
||||
|
||||
if(tempPoint.y > y1 && tempPoint.y < y1 + item.height)
|
||||
{
|
||||
interactionData.local.x = tempPoint.x;
|
||||
interactionData.local.y = tempPoint.y;
|
||||
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
PIXI.InteractionManager.prototype.onMouseMove = function(event)
|
||||
{
|
||||
event.preventDefault();
|
||||
|
||||
// TODO optimize by not check EVERY TIME! maybe half as often? //
|
||||
var rect = this.target.view.getBoundingClientRect();
|
||||
|
||||
this.mouse.global.x = (event.clientX - rect.left) * (this.target.width / rect.width);
|
||||
this.mouse.global.y = (event.clientY - rect.top) * ( this.target.height / rect.height);
|
||||
|
||||
var item = this.hitTest(this.mouse);
|
||||
|
||||
if(this.currentOver != item)
|
||||
{
|
||||
if(this.currentOver)
|
||||
{
|
||||
if(this.currentOver.mouseout)this.currentOver.mouseout(this.mouse);
|
||||
this.currentOver = null;
|
||||
}
|
||||
|
||||
this.target.view.style.cursor = "default";
|
||||
}
|
||||
|
||||
if(item)
|
||||
{
|
||||
|
||||
if(this.currentOver == item)return;
|
||||
|
||||
this.currentOver = item;
|
||||
this.target.view.style.cursor = "pointer";
|
||||
|
||||
if(item.mouseover)item.mouseover(this.mouse);
|
||||
}
|
||||
}
|
||||
|
||||
PIXI.InteractionManager.prototype.onMouseDown = function(event)
|
||||
{
|
||||
var rect = this.target.view.getBoundingClientRect();
|
||||
this.mouse.global.x = (event.clientX - rect.left) * (this.target.width / rect.width);
|
||||
this.mouse.global.y = (event.clientY - rect.top) * (this.target.height / rect.height);
|
||||
|
||||
var item = this.hitTest(this.mouse);
|
||||
if(item)
|
||||
{
|
||||
this.currentDown = item;
|
||||
if(item.mousedown)item.mousedown(this.mouse);
|
||||
}
|
||||
}
|
||||
|
||||
PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||
{
|
||||
if(this.currentDown)
|
||||
{
|
||||
if(this.currentDown.mouseup)this.currentDown.mouseup(this.mouse);
|
||||
|
||||
if(this.currentOver == this.currentDown)if(this.currentDown.click)this.currentDown.click(this.mouse);
|
||||
this.currentDown = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PIXI.InteractionManager.prototype.onTouchMove = function(event)
|
||||
{
|
||||
event.preventDefault();
|
||||
|
||||
var rect = this.target.view.getBoundingClientRect();
|
||||
var changedTouches = event.changedTouches;
|
||||
|
||||
for (var i=0; i < changedTouches.length; i++)
|
||||
{
|
||||
var touchEvent = changedTouches[i];
|
||||
|
||||
var touchData = this.touchs[touchEvent.identifier];
|
||||
|
||||
// update the touch position
|
||||
touchData.global.x = (touchEvent.clientX - rect.left) * (this.target.width / rect.width);
|
||||
touchData.global.y = (touchEvent.clientY - rect.top) * (this.target.height / rect.height);
|
||||
}
|
||||
}
|
||||
|
||||
PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
||||
{
|
||||
event.preventDefault();
|
||||
var rect = this.target.view.getBoundingClientRect();
|
||||
var changedTouches = event.changedTouches;
|
||||
|
||||
for (var i=0; i < changedTouches.length; i++)
|
||||
{
|
||||
var touchEvent = changedTouches[i];
|
||||
|
||||
var touchData = this.pool.pop();
|
||||
if(!touchData)touchData = new PIXI.InteractionData();
|
||||
|
||||
this.touchs[touchEvent.identifier] = touchData;
|
||||
|
||||
touchData.global.x = (touchEvent.clientX - rect.left) * (this.target.width / rect.width);
|
||||
touchData.global.y = (touchEvent.clientY - rect.top) * (this.target.height / rect.height);
|
||||
|
||||
var item = this.hitTest(touchData);
|
||||
if(item)
|
||||
{
|
||||
touchData.currentDown = item;
|
||||
if(item.touchstart)item.touchstart(touchData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
||||
{
|
||||
event.preventDefault();
|
||||
|
||||
var rect = this.target.view.getBoundingClientRect();
|
||||
var changedTouches = event.changedTouches;
|
||||
|
||||
for (var i=0; i < changedTouches.length; i++)
|
||||
{
|
||||
var touchEvent = changedTouches[i];
|
||||
var touchData = this.touchs[touchEvent.identifier];
|
||||
|
||||
touchData.global.x = (touchEvent.clientX - rect.left) * (this.target.width / rect.width);
|
||||
touchData.global.y = (touchEvent.clientY - rect.top) * (this.target.height / rect.height);
|
||||
|
||||
if(touchData.currentDown)
|
||||
{
|
||||
if(touchData.currentDown.touchend)touchData.currentDown.touchend(touchData);
|
||||
|
||||
var item = this.hitTest(touchData);
|
||||
if(item == touchData.currentDown)
|
||||
{
|
||||
if(touchData.currentDown.tap)touchData.currentDown.tap(touchData);
|
||||
}
|
||||
touchData.currentDown = null;
|
||||
}
|
||||
|
||||
// remove the touch..
|
||||
this.pool.push(touchData);
|
||||
this.touchs[touchEvent.identifier] = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@class InteractionData
|
||||
@constructor
|
||||
*/
|
||||
PIXI.InteractionData = function()
|
||||
{
|
||||
/**
|
||||
* This point stores the global coords of where the touch/mouse event happened
|
||||
* @property global
|
||||
* @type Point
|
||||
*/
|
||||
this.global = new PIXI.Point();
|
||||
|
||||
/**
|
||||
* This point stores the local coords of where the touch/mouse event happened
|
||||
* @property local
|
||||
* @type Point
|
||||
*/
|
||||
this.local = new PIXI.Point();
|
||||
}
|
||||
|
||||
// constructor
|
||||
PIXI.InteractionData.constructor = PIXI.InteractionData;
|
||||
|
||||
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../assets/vendor/prettify/prettify-min.js"></script>
|
||||
<script>prettyPrint();</script>
|
||||
<script src="../assets/js/yui-prettify.js"></script>
|
||||
<script src="../assets/../api.js"></script>
|
||||
<script src="../assets/js/api-filter.js"></script>
|
||||
<script src="../assets/js/api-list.js"></script>
|
||||
<script src="../assets/js/api-search.js"></script>
|
||||
<script src="../assets/js/apidocs.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
@ -186,6 +190,73 @@ PIXI.Sprite = function(texture)
|
|||
}
|
||||
|
||||
this.renderable = true;
|
||||
|
||||
|
||||
|
||||
// [readonly] best not to toggle directly! use setInteractive()
|
||||
this.interactive = false;
|
||||
|
||||
|
||||
// thi next bit is here for the docs...
|
||||
|
||||
/*
|
||||
* MOUSE Callbacks
|
||||
*/
|
||||
|
||||
/**
|
||||
* A callback that is used when the users clicks on the sprite with thier mouse
|
||||
* @method click
|
||||
* @param interactionData {InteractionData}
|
||||
*/
|
||||
|
||||
/**
|
||||
* A callback that is used when the user clicks the mouse down over the sprite
|
||||
* @method mousedown
|
||||
* @param interactionData {InteractionData}
|
||||
*/
|
||||
|
||||
/**
|
||||
* A callback that is used when the user releases the mouse that was over the sprite
|
||||
* for this callback to be fired the mouse must have been pressed down over the sprite
|
||||
* @method mouseup
|
||||
* @param interactionData {InteractionData}
|
||||
*/
|
||||
|
||||
/**
|
||||
* A callback that is used when the users mouse rolls over the sprite
|
||||
* @method mouseover
|
||||
* @param interactionData {InteractionData}
|
||||
*/
|
||||
|
||||
/**
|
||||
* A callback that is used when the users mouse leaves the sprite
|
||||
* @method mouseout
|
||||
* @param interactionData {InteractionData}
|
||||
*/
|
||||
|
||||
/*
|
||||
* TOUCH Callbacks
|
||||
*/
|
||||
|
||||
/**
|
||||
* A callback that is used when the users taps on the sprite with thier finger
|
||||
* basically a touch version of click
|
||||
* @method tap
|
||||
* @param interactionData {InteractionData}
|
||||
*/
|
||||
|
||||
/**
|
||||
* A callback that is used when the user touch's over the sprite
|
||||
* @method touchstart
|
||||
* @param interactionData {InteractionData}
|
||||
*/
|
||||
|
||||
/**
|
||||
* A callback that is used when the user releases the touch that was over the sprite
|
||||
* for this callback to be fired. The touch must have started over the sprite
|
||||
* @method touchend
|
||||
* @param interactionData {InteractionData}
|
||||
*/
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -208,7 +279,19 @@ PIXI.Sprite.prototype.setTexture = function(texture)
|
|||
this.width = texture.frame.width;
|
||||
this.height = texture.frame.height;
|
||||
this.updateFrame = true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the sprite will have touch and mouse interactivity. It is false by default
|
||||
* @method setInteractive
|
||||
* @param interactive {Boolean}
|
||||
*/
|
||||
PIXI.Sprite.prototype.setInteractive = function(interactive)
|
||||
{
|
||||
this.interactive = interactive;
|
||||
// TODO more to be done here..
|
||||
// need to sort out a re-crawl!
|
||||
if(stage)stage.dirty = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -223,10 +306,9 @@ PIXI.Sprite.prototype.onTextureUpdate = function(event)
|
|||
|
||||
// some helper functions..
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Helper function that creates a sprite that will contain a texture from the TextureCache based on tjhe frameId
|
||||
* Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId
|
||||
* The frame ids are created when a Texture packer file has been loaded
|
||||
* @method fromFrame
|
||||
* @static
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
@ -124,8 +128,9 @@ A Stage represents the root of the display tree. Everything connected to the sta
|
|||
@extends DisplayObjectContainer
|
||||
@constructor
|
||||
@param backgroundColor {Number} the background color of the stage
|
||||
@param interactive {Boolean} enable / disable interaction (default is false)
|
||||
*/
|
||||
PIXI.Stage = function(backgroundColor)
|
||||
PIXI.Stage = function(backgroundColor, interactive)
|
||||
{
|
||||
|
||||
PIXI.DisplayObjectContainer.call( this );
|
||||
|
@ -135,6 +140,10 @@ PIXI.Stage = function(backgroundColor)
|
|||
this.childIndex = 0;
|
||||
this.stage= this;
|
||||
|
||||
// interaction!
|
||||
this.interactive = interactive ? true : false;
|
||||
this.interactionManager = new PIXI.InteractionManager(this);
|
||||
|
||||
this.setBackgroundColor(backgroundColor);
|
||||
}
|
||||
|
||||
|
@ -150,11 +159,21 @@ PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
|
|||
PIXI.Stage.prototype.updateTransform = function()
|
||||
{
|
||||
this.worldAlpha = 1;
|
||||
|
||||
|
||||
for(var i=0,j=this.children.length; i<j; i++)
|
||||
{
|
||||
this.children[i].updateTransform();
|
||||
}
|
||||
|
||||
if(this.dirty)
|
||||
{
|
||||
this.dirty = false;
|
||||
|
||||
// update interactive!
|
||||
this.interactionManager.dirty = true;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -170,8 +189,8 @@ PIXI.Stage.prototype.setBackgroundColor = function(backgroundColor)
|
|||
|
||||
PIXI.Stage.prototype.__addChild = function(child)
|
||||
{
|
||||
//this.__childrenAdded.push(child);
|
||||
|
||||
if(child.interactive)this.dirty = true;
|
||||
|
||||
child.stage = this;
|
||||
|
||||
if(child.children)
|
||||
|
@ -187,6 +206,8 @@ PIXI.Stage.prototype.__addChild = function(child)
|
|||
|
||||
PIXI.Stage.prototype.__removeChild = function(child)
|
||||
{
|
||||
if(child.interactive)this.dirty = true;
|
||||
|
||||
this.__childrenRemoved.push(child);
|
||||
|
||||
child.stage = undefined;
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
@ -124,8 +128,9 @@
|
|||
* @class CanvasRenderer
|
||||
* @param width {Number} the width of the canvas view
|
||||
* @param height {Number} the height of the canvas view
|
||||
* @param view {Canvas} the canvas to use as a view, optional
|
||||
*/
|
||||
PIXI.CanvasRenderer = function(width, height)
|
||||
PIXI.CanvasRenderer = function(width, height, view)
|
||||
{
|
||||
/**
|
||||
* The width of the canvas view
|
||||
|
@ -149,7 +154,7 @@ PIXI.CanvasRenderer = function(width, height)
|
|||
* @property view
|
||||
* @type Canvas
|
||||
*/
|
||||
this.view = document.createElement( 'canvas' );
|
||||
this.view = view ? view : document.createElement( 'canvas' );
|
||||
|
||||
// hack to enable some hardware acceleration!
|
||||
//this.view.style["transform"] = "translatez(0)";
|
||||
|
@ -194,6 +199,18 @@ PIXI.CanvasRenderer.prototype.render = function(stage)
|
|||
|
||||
this.context.clearRect(0, 0, this.width, this.height)
|
||||
this.renderDisplayObject(stage);
|
||||
//as
|
||||
|
||||
// run interaction!
|
||||
if(stage.interactive)
|
||||
{
|
||||
//need to add some events!
|
||||
if(!stage._interactiveEventsAdded)
|
||||
{
|
||||
stage._interactiveEventsAdded = true;
|
||||
stage.interactionManager.setTarget(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
@ -129,13 +133,14 @@ PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
|
|||
* @default 0
|
||||
* @param height {Number} the height of the canvas view
|
||||
* @default 0
|
||||
* @param view {Canvas} the canvas to use as a view, optional
|
||||
*/
|
||||
PIXI.WebGLRenderer = function(width, height)
|
||||
PIXI.WebGLRenderer = function(width, height, view)
|
||||
{
|
||||
this.width = width ? width : 800;
|
||||
this.height = height ? height : 600;
|
||||
|
||||
this.view = document.createElement( 'canvas' );
|
||||
this.view = view ? view : document.createElement( 'canvas' );
|
||||
this.view.width = this.width;
|
||||
this.view.height = this.height;
|
||||
this.view.background = "#FF0000";
|
||||
|
@ -284,7 +289,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
for (var i=0; i < stage.__childrenRemoved.length; i++)
|
||||
{
|
||||
this.removeDisplayObject(stage.__childrenRemoved[i]);
|
||||
// stage.__childrenRemoved[i].cacheVisible = false;
|
||||
// stage.__childrenRemoved[i].cacheVisible = false;
|
||||
}
|
||||
/*
|
||||
// no add all new sprites
|
||||
|
@ -334,6 +339,17 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
|
|||
}
|
||||
}
|
||||
|
||||
// interaction
|
||||
// run interaction!
|
||||
if(stage.interactive)
|
||||
{
|
||||
//need to add some events!
|
||||
if(!stage._interactiveEventsAdded)
|
||||
{
|
||||
stage._interactiveEventsAdded = true;
|
||||
stage.interactionManager.setTarget(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
@ -299,10 +303,13 @@ PIXI.Texture.addTextureToCache = function(texture, id)
|
|||
* Remove a texture from the textureCache.
|
||||
* @method removeTextureFromCache
|
||||
* @param id {String} the id of the texture to be removed
|
||||
* @return {Texture} the texture that was removed
|
||||
*/
|
||||
PIXI.Texture.removeTextureFromCache = function(id)
|
||||
{
|
||||
PIXI.TextureCache[id] = texture;
|
||||
var texture = PIXI.TextureCache[id]
|
||||
PIXI.TextureCache[id] = null;
|
||||
return texture;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
@ -125,8 +129,9 @@
|
|||
* @static
|
||||
* @param width {Number} the width of the renderers view
|
||||
* @param height {Number} the height of the renderers view
|
||||
* @param view {Canvas} the canvas to use as a view, optional
|
||||
*/
|
||||
PIXI.autoDetectRenderer = function(width, height)
|
||||
PIXI.autoDetectRenderer = function(width, height, view)
|
||||
{
|
||||
if(!width)width = 800;
|
||||
if(!height)height = 600;
|
||||
|
@ -137,10 +142,10 @@ PIXI.autoDetectRenderer = function(width, height)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height)
|
||||
return new PIXI.WebGLRenderer(width, height, view)
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height);
|
||||
return new PIXI.CanvasRenderer(width, height, view);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="../logo_small.png" title="Pixi.js API"></h1>
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.js API"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 0.9</em>
|
||||
<em>API Docs for: 1.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
@ -51,6 +51,10 @@
|
|||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue