I have two sprites with two textures. How to check if they are intersecting ? I am using libgdx 0.9.8.
if (sprite1.getBoundingRectangle().contains(Sprite2.getBoundingRectangle())
{
//gives true when sprite2 one is completly inside sprite1
}
also
if(sprite1.getBoundingRectangle().overlaps(Sprite2.getBoundingRectangle())
{
// gives true when sprite 2 intersects sprite1
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With