Likl Posted November 29, 2019 Share Posted November 29, 2019 First, I draw a PIXI.Container, but don't set it's position.Then, I put a PIXI.Sprite in it which has a specific x,y,width and height, through the console, i saw that the container's position is set to {x: 0, y: 0}, and it size is wrapping the sprite When I bind some MouseOver event on the container , it seems that it onlyt triggered on the sprite, ummm, i mean there is a blank part in the container but didn't trigger event. Is it normal? What if I want to expand the zone of the MouseOver event on sprite? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 29, 2019 Share Posted November 29, 2019 (edited) Yes, Flash worked like that too. Container doesn't have size per se, its just bounds of all children. Interaction works through children too - if something is hit , then container is hit too. I advice you to not use "container.width, container.height" at all because that calls getLocalBounds() which i doubt you need - its legacy Flash behaviour, and in pixi it has some nasty side effects. Use "container.getBounds()" to get debug info. Edited November 29, 2019 by ivan.popelyshev 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.