New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mousemove Events #57
Comments
This would be useful for me too. I had a look at the Interaction Manager code and it seems to be trapping mouse move but using it for mouse over and I'm not sure how to get a mouse move event. Any pointers would be great. |
cool, will rustle up an example :D |
Hi there! Just to bump this! I saw that too, in the Interaction Manager "mousemove" and even "hittest". This would be perfect if we can just call "mousemove" on any sprite and + a hittest method to have full interaction with our content! Right now I use a custom way based on updateHandler + mouseup / down event, not very clean! |
no worries! re-working a few bits on the interaction manger as we speak :) heres the WIP multi touch example: http://www.goodboydigital.com/pixijs/examples/temp_6/ works great on an ipad.. I'm basically adding a few more bits: Some new callbacks: mousemove touchendoutside I also added getLocalPosition function to the interactionData. This means you can get the cords of a touch/mouse from anywhere.. and most importantly I have been looking into making any object interactive :) keen to know anyones thoughts on this! (you can view the src code in the example above to see how it would work) Thanks! |
Yes, this is great! |
woop woop!! I have just pushed the updated interaction manager up along with docs and new example. |
It's perfect! Thank you! Now we can fully interact with our content ;-) ! if ( hitTest( objectA, objectB ) ) console.log( "Woot!" ); I have a custom method to calculate lengh between 2 points like: function hitTest( a, b ) {
var dX = b.position.x - a.position.x;
var dY = b.position.y - a.position.y;
var dist = Math.sqrt( dX * dX - dY * dY );
return dist <= a.width / 2 + b.width / 2;
}
// blabla -- Doesn't work everytime, and not very elegant! And I saw "PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)" in InteractionManager.as, so maybe we can start from that? Thanks again! |
Excellent :D The interactionManager hit test only performs a hittest on a single point so it may not be what you are looking for :/ Gonna close this thread now that all the mouse events are in! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Looks like we get
mouseup
,mousedown
,mouseover
, andmouseout
events called on Sprites (per the docs). I want to allow dragging in grapefruit, is there anyway we can also getmousemove
events so I can drag stuff around?The text was updated successfully, but these errors were encountered: