achexi Posted December 9, 2014 Share Posted December 9, 2014 Hey, So I'm making a drag and drop type application in pixi that masks sprites if the mouse is inside a box. It looks like this: http://gyazo.com/e658aef16a76b78014c6892eee5c82bd Now the problem is I'm trying out pixi's interactive mode to do the dragging, but as you can see from the gif although the sprite is masked, its still clickable outside the box. I'm just wondering if theres any neat way's of negating the clicking, maybe using some built in functions that I'm unaware of. I can think of a few ways of doing it, right now the way I will probably do it will be simple checks on the bounds to see if I'm allowed to select it. Quote Link to comment Share on other sites More sharing options...
JDW Posted December 9, 2014 Share Posted December 9, 2014 Did you try to use hitArea ? http://www.goodboydigital.com/pixijs/docs/files/src_pixi_display_DisplayObject.js.html#l62 Quote Link to comment Share on other sites More sharing options...
achexi Posted December 9, 2014 Author Share Posted December 9, 2014 I forgot about hitarea! It definitely would be more efficient to adjust the size of that. Now I'm gonna assume there is no built in pixi function that allows me to mask the hitarea? Looks like i'll probably have to do it myself but thanks anyway. 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.