Tiling Sprite added
Added Tiling Sprite to Pixi.js Added example 9 - TilingSprite Updated docs
This commit is contained in:
parent
c1c4d75a3d
commit
3dddce23ad
63 changed files with 9903 additions and 252 deletions
|
@ -69,6 +69,8 @@
|
|||
|
||||
<li><a href="../classes/Texture.html">Texture</a></li>
|
||||
|
||||
<li><a href="../classes/TilingSprite.html">TilingSprite</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLBatch.html">WebGLBatch</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLRenderer.html">WebGLRenderer</a></li>
|
||||
|
@ -209,16 +211,32 @@ PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObj
|
|||
|
||||
PIXI.InteractionManager.prototype.setTarget = function(target)
|
||||
{
|
||||
this.target = target;
|
||||
target.view.addEventListener('mousemove', this.onMouseMove.bind(this), true);
|
||||
target.view.addEventListener('mousedown', this.onMouseDown.bind(this), true);
|
||||
document.body.addEventListener('mouseup', this.onMouseUp.bind(this), true);
|
||||
target.view.addEventListener('mouseout', this.onMouseUp.bind(this), true);
|
||||
if (window.navigator.msPointerEnabled)
|
||||
{
|
||||
// time to remove some of that zoom in ja..
|
||||
target.view.style["-ms-content-zooming"] = "none";
|
||||
target.view.style["-ms-touch-action"] = "none"
|
||||
|
||||
// DO some window specific touch!
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
|
||||
this.target = target;
|
||||
target.view.addEventListener('mousemove', this.onMouseMove.bind(this), true);
|
||||
target.view.addEventListener('mousedown', this.onMouseDown.bind(this), true);
|
||||
document.body.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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 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.update = function()
|
||||
|
@ -408,7 +426,7 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
|||
var global = interactionData.global;
|
||||
|
||||
if(!item.visible)return false;
|
||||
|
||||
|
||||
if(item instanceof PIXI.Sprite)
|
||||
{
|
||||
var worldTransform = item.worldTransform;
|
||||
|
@ -460,8 +478,8 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
|
|||
|
||||
for (var i = 0; i < length; i++)
|
||||
{
|
||||
var item = item.children[i];
|
||||
var hit = this.hitTest(item, interactionData);
|
||||
var tempItem = item.children[i];
|
||||
var hit = this.hitTest(tempItem, interactionData);
|
||||
if(hit)return true;
|
||||
}
|
||||
|
||||
|
@ -527,6 +545,7 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
|
|||
//call the function!
|
||||
if(item.touchstart)item.touchstart(touchData);
|
||||
item.__isDown = true;
|
||||
item.__touchData = touchData;
|
||||
|
||||
if(!item.interactiveChildren)break;
|
||||
}
|
||||
|
@ -540,11 +559,13 @@ 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];
|
||||
var up = false;
|
||||
|
@ -555,6 +576,7 @@ PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
|||
for (var j = 0; j < length; j++)
|
||||
{
|
||||
var item = this.interactiveItems[j];
|
||||
var itemTouchData = item.__touchData; // <-- Here!
|
||||
item.__hit = this.hitTest(item, touchData);
|
||||
|
||||
if(itemTouchData == touchData)
|
||||
|
@ -586,7 +608,7 @@ PIXI.InteractionManager.prototype.onTouchEnd = function(event)
|
|||
item.__isDown = false;
|
||||
}
|
||||
|
||||
item.__touchIdentifier = null;
|
||||
item.__touchData = null;
|
||||
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue