Pixel Perfect click detection now works even if the Sprite is part of a texture atlas.

This commit is contained in:
photonstorm
2013-10-25 05:40:46 +01:00
parent 1294b3a2b9
commit 2921a6de2e
11 changed files with 135 additions and 66 deletions
+5 -2
View File
@@ -43,6 +43,8 @@ function create() {
button3 = game.add.button(100, 300, 'button', changeSky, this, 2, 1, 0);
button3.name = 'sky3';
button3.width = 300;
button3.anchor.setTo(0, 0.5);
// button3.angle = 0.1;
// Scaled button
button4 = game.add.button(300, 450, 'button', changeSky, this, 2, 1, 0);
@@ -85,7 +87,8 @@ function render () {
// game.debug.renderWorldTransformInfo(button1, 32, 132);
// game.debug.renderText('sx: ' + button3.scale.x + ' sy: ' + button3.scale.y + ' w: ' + button3.width + ' cw: ' + button3._cache.width, 32, 20);
// game.debug.renderPoint(button2.input._tempPoint);
// game.debug.renderPoint(button6.input._tempPoint);
game.debug.renderText('ox: ' + game.stage.offset.x + ' oy: ' + game.stage.offset.y, 32, 20);
game.debug.renderPoint(button3.input._tempPoint);
game.debug.renderPoint(button6.input._tempPoint);
}