Sign in to follow this  
Shima_Max

How can get plygon from sprite?

Recommended Posts

Hi, I want to detect collision between two sprites. So, as I understood, it means that I should detect collision between two polygons. How I can get sprite edge points? Or maybe another way exists?

example.jpg

Share this post


Link to post
Share on other sites

Usually I use https://www.codeandweb.com/physicseditor , load that json to pixi, create special objects that have several polygons inside and containsPoint()/contains() function ( I DONT REMEMBER) that checks every polygon. Its never a plugin or boxed solution because I adjust many things based on the game conditions.

Its possible to map file names to content inside "shapes.json" , its very easy.

Then you can specify it as a hitArea for sprite or use it as an input for physics engine for physics component of pixi object. Again, pixi doesnt have that in vanilla, it has to be part of your engine on top of pixi.

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.