InputManager.getLocalPosition(displayObject, pointer, output) will return the local coordinates of the specified displayObject and pointer.

InputManager.hitTest will test for pointer hits against a Sprite/Image, its hitArea (if set) or any of its children.
This commit is contained in:
photonstorm
2014-02-07 18:01:58 +00:00
parent bc3a3fd43d
commit dd43d59cce
4 changed files with 294 additions and 361 deletions
+3 -3
View File
@@ -71,11 +71,11 @@ function update() {
function render() {
// var p = game.input.getLocalPosition(image);
var p = game.input.getLocalPosition(image2);
// var p = game.input.getLocalPosition(image2);
game.debug.renderPointInfo(p, 32, 32);
game.debug.renderPoint(p);
// game.debug.renderPointInfo(p, 32, 32);
// game.debug.renderPoint(p);
game.debug.renderCircle(image2.hitArea);
}