mirror of
https://github.com/wassname/phaser.git
synced 2026-07-08 00:10:32 +08:00
Input updates
This commit is contained in:
@@ -35,6 +35,12 @@ Phaser is everything we ever wanted from an HTML5 game framework. It will power
|
||||
Change Log
|
||||
----------
|
||||
|
||||
Version 1.0.6 (in progress)
|
||||
|
||||
* Added check into Pointer.move to always consider a Sprite that has pixelPerfect enabled, regardless of render ID.
|
||||
* BUG Found: The pixel perfect click check doesn't work if the sprite is part of a texture atlas yet.
|
||||
|
||||
|
||||
Version 1.0.5 (September 20th 2013)
|
||||
|
||||
* Fixed issue in FrameData.getFrameIndexes where the input array was being ignored.
|
||||
|
||||
@@ -367,6 +367,8 @@ Phaser.InputHandler.prototype = {
|
||||
if (this.sprite.texture.baseTexture.source)
|
||||
{
|
||||
this.game.input.hitContext.clearRect(0, 0, 1, 1);
|
||||
|
||||
// This will fail if the image is part of a texture atlas - need to modify the x/y values here
|
||||
this.game.input.hitContext.drawImage(this.sprite.texture.baseTexture.source, x, y, 1, 1, 0, 0, 1, 1);
|
||||
|
||||
var rgb = this.game.input.hitContext.getImageData(0, 0, 1, 1);
|
||||
@@ -665,7 +667,7 @@ Phaser.InputHandler.prototype = {
|
||||
|
||||
this.pixelPerfect = pixelPerfect;
|
||||
this.pixelPerfectAlpha = alphaThreshold;
|
||||
|
||||
|
||||
if (boundsRect)
|
||||
{
|
||||
this.boundsRect = boundsRect;
|
||||
|
||||
@@ -370,8 +370,8 @@ Phaser.Pointer.prototype = {
|
||||
|
||||
do
|
||||
{
|
||||
// If the object has a higher InputManager.PriorityID OR if the priority ID is the same as the current highest AND it has a higher renderOrderID, then set it to the top
|
||||
if (currentNode.priorityID > this._highestInputPriorityID || (currentNode.priorityID == this._highestInputPriorityID && currentNode.sprite.renderOrderID > this._highestRenderOrderID))
|
||||
// If the object is using pixelPerfect checks, or has a higher InputManager.PriorityID OR if the priority ID is the same as the current highest AND it has a higher renderOrderID, then set it to the top
|
||||
if (currentNode.pixelPerfect || currentNode.priorityID > this._highestInputPriorityID || (currentNode.priorityID == this._highestInputPriorityID && currentNode.sprite.renderOrderID > this._highestRenderOrderID))
|
||||
{
|
||||
if (currentNode.checkPointerOver(this))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user