Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Max

I am having a strange issue where the reported mouse position is off by a few pixels and gets worse the further from the origin the mouse is moved. It seems to only be in the x axis, as the y axis works fine. It's very strange, but it means that highlighting a grid square ends up getting off one to the right as you move the mouse to the right.

Any ideas? This is on chrome.

1 decade ago by dominic

And you only have this issue in Chrome?

It works fine for me in this demo. All I'm doing there, is getting the mouse position from ig.input and drawing the text:
var out = ig.input.mouse.x + ', ' + ig.input.mouse.y;
this.font.draw( out, x, y, ig.Font.ALIGN.CENTER );

Maybe you're accidentally factoring in the scaling of the game again?

1 decade ago by Max

I had the width on the canvas set up wrong. It was one tilesize too wide and that threw off my calculations with the mouse. Thanks!
Page 1 of 1
« first « previous next › last »