Is there a way to check area of a sprite object?

  • I mean an easy way to check the area of collision box (this is the one that matters for physics behavior, right?)? And a way to set it exactly as i need to? Like in Solid Works - you can right click on object and in properties menu see it's area in square meters. Or if i can access it as a variable it would be even better.

  • Why exactly do you need this? Just curious.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Well i need to be able to tell the mass of an object. As i understand forces in construct 2 are calculated by [mass * acceleration] not [density * acceleration]. And it's just much easier to do physics simulation when you know how exactly objects of specific masses would interact with each other from your "on paper" calculations.

  • I guess it would be:

    <Area of collision polygon> * density = mass

    Check the collision polygons, if they are simple, then you are in luck.

  • That's really nice, but it doesn't answer my question even a little bit. What i need is to be able to check the area of my collision polygon in square units. I need to know if there is a property of an object i can address for it?

  • If you can't find anything, you could do it the old-fashioned way. (Object.height *object.width) to get it in pixels. Then you can do any math you'd like.

  • Yeap i understand this much <img src="smileys/smiley42.gif" border="0" align="middle" />, but i hoped that someone knows some easy method for this already implemented in construct 2.

  • I guess i'll have to figure it out empirically - first i'll smash two equal (density, collision polygon size, bounciness) ball sprites with physics behavior into each other at certain speed and see at which speed they will bounce then try to recreate same speed with "apply impulse" action.

    But this is really stupid, because Construct 2 already using area of collision polygon to calculate physics interaction between objects, so why the hell there is no way for me to access that data and use it??! Just ridiculous! I just hope my topic won't be buried under all these star-marked topics and developers will see it.

  • There is the Sprite.Physics.Mass expression which is equal to density * area. Why not use that?

  • Didn't know about that sprite.physics.mass and .density are there. Thank you. Problem solved . <img src="smileys/smiley1.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)