Closed krazyjakee closed 10 years ago
so sprite interaction events haven't been normalized yet (meaning the raw rendering engine method is the only current way). You have to first tell the sprite to be interactive, then set the onclick event:
tile.interactive = true;
tile.click = function(e) { console.log(e); }
Also, avoid making functions in a loop if they are all the same:
function onTileClick(e) {
console.log(e);
}
// loops
//...
tile.interactive = true;
tile.click = onTileClick;
Proper scene interaction events will be normalized through the Pointer
API when it is finished (in v0.2
). At that point your code above should work.
worked, thanks very much
Looping through all the tiles in a layer is no problem.
The event is assigned to the tile, and yet when I click, it isn't fired.