I'm making a board game and need to be able to know which tile on the board the user is clicking/touching. I've made the level (called 'board.js') in Weltmeister and I just can't figure out how to reference it to collect any data. Is this even possible? If not, what would be a good way to create a board where I could collect tile information through clicks/touches? Sorry if this is a noob question. Thanks so much.
Hi,
Take a look at this plugin
http://impactjs.com/forums/code/tile-value-plugin. You probably do not need the plugin but the plugin and demos show how to detect tiles. The only difference is that you need to pass in the mouse position rather than an entity position.
What sort of information do you need !
Thank you!
I figured out how to get what I wanted by dividing the mouse position by the tile size.
if (ig.input.state('touch')) {
this.coordinates = Math.floor(ig.input.mouse.x / 16) + ', ' +
Math.floor(ig.input.mouse.y / 16);
}
Page 1 of 1
« first
« previous
next ›
last »