Welcome, Guest
Want to take part in these discussions? Sign in if you have an account, or apply for one below
Bug reports: Collision Radius set to 1 pixel when using a custom display object
Bottom of Page1 to 2 of 2
-
- CommentAuthoriworkinprogress
- CommentTimeNov 14th 2008
I added the below code to Particle2DUtils.createParticle2DFromDisplayObject to sync up the collision radius of my particles with the display object they are based upon. Otherwise the collision radius is set to 1 by default and does not behave properly. This does assume that width and height is the same, so perhaps there would be a better fix that would average the height and width to get a more accurate collisionRadius.
// make new particles have the same radius as the width of the display object
particle.collisionRadius = obj.width/2;
//
right above:
particle.image = obj;
return particle; -
- CommentAuthorRichard
- CommentTimeNov 17th 2008
Good idea. I've added it (using the average of width and height) in createParticle2DFromDisplayObject and createRectangleParticlesFromBitmapData.
Thanks
1 to 2 of 2
