Jump to content

Drawing Custom Shapes


ninemind
 Share

Recommended Posts

If I have an array of x,y points, how can I draw a shape on the canvas that passes through those points either as straight lines or curves and also use it as a collision shape. These shapes may not always be solid.  For example I might draw a shape that looks like the letter "A" where there is a triangle hole in the shape who's borders will have collision.

Link to comment
Share on other sites

I think I figured out how to create complex collision shapes with p2.js using p2.Convex() but I'm having trouble displaying the shape on the Panda.js canvas with DebugDraw.  I am using the Panda.js files from the development branch as well as p2.js from your plugins on github but I see nothing being displayed. Even with simple p2.Circle's or p2.Rectangle's I see nothing.

Link to comment
Share on other sites

  • 3 months later...

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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...