Jump to content

Physics for arc graphics object!


flowabuse
 Share

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.

Link to comment
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).

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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