mkit Posted May 26, 2014 Share Posted May 26, 2014 If I just add a mousedown on my spine animations, I have noticed the hit area is a lot larger than necessary due to the animation data including additional elements. Possibly this is an error on behalf of the client who supplied the spine data. Anyway I am trying to work with what I have been provided and would like to know if it is possible to add the mousedown listener to a "nested" element of the spine animation? For example, I have an animation of some pillow in a bed lifting up to reveal an object below the pillows. The animation includes the entire bed but I only want the pillow area to be clickable. So currently I have the following:pillow.setInteractive(true);pillow.mousedown = function(mouseData){ pillow.state.setAnimationByName("animation open", false); }I note that the element in the spine data that I actually just want to target is a slot called "Bedroom_Bed-Pillows" I wondered if there is a way to add the listener to just this "object" rather than to the whole bed so that the hit area will not be so large and only cover the pillow area? Quote Link to comment Share on other sites More sharing options...
enpu Posted May 27, 2014 Share Posted May 27, 2014 You can define your own hit area with:pillow.hitArea = new PIXI.Rectangle(0, 0, 100, 100); 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.