Sign in to follow this  
flowabuse

Physics for arc graphics object!

Recommended Posts

Physics bodies can only be applied to sprites. The arc in the fiddle is a bitmapdata. However, bitmapdata can be used as a sprite's texture. This is done by specifying the bitmapdata's key when you create the sprite, same as any other kind of sprite texture. So you should try creating the paddle as a sprite with the bitmapdata arc as its texture.

Share this post


Link to post
Share on other sites

I decided to test out what I said. Turned out to be easy in this case, because I looked at the fiddle you provided again and noticed that PieProgress extends the Sprite class, so it turned out they'd already beaten me to the whole "apply bitmapdata to sprite" idea. So I tried enabling physics and applying gravity to the circle, and it works fine. The radius continues to update properly when you adjust it, but the other properties don't work anymore. I'm sure it's fixable. Check it out here: http://jsfiddle.net/f6tf8ue9/18/ (check the "create" function for the code I added).

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.