eggborne Posted December 10, 2013 Share Posted December 10, 2013 I would like to be able to refer to cursor.position.x and cursor.position.y the way I refer to sprite.position.x, etc., and be able to handle mousewheel events the way mousedown, mouseover, and the other built-in Pixi functions do. Basically I am trying to achieve a sprite which rotates to point at the cursor, and can be moved with WASD. I know jQuery can do things like this, but would using it (or another library) be overkill if it were just for this purpose, and only saved a few lines of code? If someone could give me some advice and/or point me in the right direction, I would greatly appreciate it. Quote Link to comment Share on other sites More sharing options...
xerver Posted December 10, 2013 Share Posted December 10, 2013 You don't need jquery, just use DOM mouse events on the canvas. The interactions that pixi provides are just for specific events where you need to know the actual sprite in the scene that is being interacted with. Scroll you can just bind on the canvas (or document) and deal with normally. Quote Link to comment Share on other sites More sharing options...
eggborne Posted December 10, 2013 Author Share Posted December 10, 2013 Thanks! I've worked it out now. 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.