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 Architecte

Hello,

I want to know how I should go about to recover permanently the position of my mouse?
I have tried a console.log in the update function of ig.Game.extend.
And I also put ig.input.initMouse () in the init function.
But I get nothing.
I tried to get a result with an entity, but it was not satisfactory in the sense that once they finish the entity to generate complete, I have no information, and I guess this is not the right place I have the place for this information permanently.

I thank you in advance for your information.

1 decade ago by vincentpiel

what's wrong with displaying ig.input.mouse.x and .y on the screen with an ig.font in your game.draw (after a call to parent) ??

(you must bind at least one mouse button to activate mouse.)

If by 'permanently' you mean you want to be able to track mouse movements and reload them in another cession, most simple is to use JSON.stringify on an array storing (x,y) values, and store the resulting string in your localStorage. You can also, but it's more complicated, use the html5 File API to write to/read from a file.
Page 1 of 1
« first « previous next › last »