peterje Posted December 14, 2020 Share Posted December 14, 2020 (edited) In a project I am working on I wish to have bounds for my display objects be more accurate than a rectangle. For example, this balloon sprite currently collides with everything in its default AABB bounds. However according to the documentation I can override calculateBounds and define a hull for this object. How might I go about that for a large collection of sprites I have stored as a PNG? Do I have to manually map out the hull for each sprite or is there a built in algorithm to do this for png with transparent backgrounds? Edited December 14, 2020 by peterje Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 14, 2020 Share Posted December 14, 2020 (edited) use PhysicsEditor to make a hull use hitArea or override containsPoint() for interaction. As for bounds, they are always rectangle Edited December 14, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
peterje Posted December 31, 2020 Author Share Posted December 31, 2020 Thanks. Not sure what PhysicsEditor is..not much comes up when I search for it. Is it a tool separate from PIXI? Also, what is the point of the hull if the bounds will always be rectangle. Does this mean I can't have better collision detection than AABB? Quote Link to comment Share on other sites More sharing options...
peterje Posted January 1, 2021 Author Share Posted January 1, 2021 For anyone who finds this, you should use This repo. It is exactly what I needed! 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.