mirror of
https://github.com/wassname/phaser.git
synced 2026-07-07 00:06:37 +08:00
TileSprites can now receive full Input events, dragging, etc and be positioned in-world and fixed to cameras (fixes #321)
This commit is contained in:
@@ -730,6 +730,22 @@ Phaser.Input.prototype = {
|
||||
|
||||
return false;
|
||||
}
|
||||
else if (displayObject instanceof Phaser.TileSprite)
|
||||
{
|
||||
var width = displayObject.width;
|
||||
var height = displayObject.height;
|
||||
var x1 = -width * displayObject.anchor.x;
|
||||
|
||||
if (this._localPoint.x > x1 && this._localPoint.x < x1 + width)
|
||||
{
|
||||
var y1 = -height * displayObject.anchor.y;
|
||||
|
||||
if (this._localPoint.y > y1 && this._localPoint.y < y1 + height)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (displayObject instanceof PIXI.Sprite)
|
||||
{
|
||||
var width = displayObject.texture.frame.width;
|
||||
|
||||
Reference in New Issue
Block a user