mwhite2386 Posted December 21, 2014 Share Posted December 21, 2014 Newbie Developer here. I'm working through the examples and I'm learning so much! I'm to the point where I would like to make my sprites move. I'm learning on PC (Windows) so I need to capture events on keydown on the arrow keys. I can get events to fire using $(document).keydown(function (e) but the response time on these events are just too slow. I've spent the past few hours looking for a solution. I've stumbled on to keydrown but I'm not sure how Pixijs works with this or if it will cause conflicts with the InteractionManager. My understanding is that InteractionManager only captures events for the mouse/touch. Any advice would be greatly appreciated! neonwarge04 1 Quote Link to comment Share on other sites More sharing options...
d13 Posted December 21, 2014 Share Posted December 21, 2014 There's some information about how to do that about half-way through this article: https://github.com/kittykatattack/learningPixi neonwarge04 1 Quote Link to comment Share on other sites More sharing options...
mwhite2386 Posted December 21, 2014 Author Share Posted December 21, 2014 Thank you! This is very helpful. I'm a bit embarrassed I missed this. Quote Link to comment Share on other sites More sharing options...
nom Posted December 26, 2018 Share Posted December 26, 2018 For anyone else needing to handle Mouse and Keyboard easily on your Pixi.js canvas, I've made these two packages on npm. https://www.npmjs.com/package/pixi.js-keyboard https://www.npmjs.com/package/pixi.js-mouse Demo: http://ocservers.com/demos/pixi.js-events/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.