Hi Harald 😉
Thx for your reply,
Harald yazdıActually Spine lets you create any polygonal shape, they are not AABBs or OBBs:
Bounding Boxes - Spine User Guide
yes, this point its ok. My animation works perfectly, I make a hitbox via "bones-vertices".
In my program I can see my polygon detection 😉
Harald yazdıIf you are using the spine-unity runtime, the BoundingBoxFollower Component will create a PolygonCollider2D.
Unfortunately no, I am using spine-monogame runtime (I have edit my post at the same time when you reply).
Ok so,
My first test return null vertices exception
My second test :
if (skeletonBounds.AabbContainsPoint(mousePosition.X, mousePosition.Y))
{
// BoundingBoxAttachment bba = skeletonBounds.ContainsPoint(mousePosition.X, mousePosition.Y);
//Polygon poly = skeletonBounds.GetPolygon(bba);
for(int i=0; i< skeletonBounds.Polygons.Items.Length; i++)
if (skeletonBounds.ContainsPoint(skeletonBounds.Polygons.Items[i], mousePosition.X, mousePosition.Y))
game.currentScreen = new TankScreen(game);
}
Exception null vertices error too, polygons count = 4 :detective:
Only the first polygon is no null :think: so ok
Third test :
if (skeletonBounds.AabbContainsPoint(mousePosition.X, mousePosition.Y))
{
// BoundingBoxAttachment bba = skeletonBounds.ContainsPoint(mousePosition.X, mousePosition.Y);
//Polygon poly = skeletonBounds.GetPolygon(bba);
//for(int i=0; i< skeletonBounds.Polygons.Items.Length; i++)
if (skeletonBounds.ContainsPoint(skeletonBounds.Polygons.Items[0], mousePosition.X, mousePosition.Y))
game.currentScreen = new TankScreen(game);
}
It works :smirk:
Why polygons count == 4 if only the first is no null ?
Thx in advance
:lol: I understand now
public class ExposedList<T> : IEnumerable<T> {
public T[] Items;
public int Count;
private const int DefaultCapacity = 4;
Thx
[RESOLVED]