Flint Particle System Forum - Is there a way to hitTestObject Particles? Sun, 11 Dec 2011 11:11:55 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Is there a way to hitTestObject Particles? http://flintparticles.org/forum/comments.php?DiscussionID=64&Focus=313#Comment_313 http://flintparticles.org/forum/comments.php?DiscussionID=64&Focus=313#Comment_313 Sun, 10 Aug 2008 15:47:31 +0100 macco Is there a way to hitTestObject Particles? http://flintparticles.org/forum/comments.php?DiscussionID=64&Focus=314#Comment_314 http://flintparticles.org/forum/comments.php?DiscussionID=64&Focus=314#Comment_314 Sun, 10 Aug 2008 17:56:04 +0100 Richard
If you use a DisplayObjectRenderer then each particle is represented by a unique display object and you can do a hitTestObject on it. The display object is the particle's image property so do

displayObj.hitTestObject( particle.image );

If you use a PixelRenderer then each particle is represented by a single pixel and you can do a hitTestPoint on the particle's x and y position

displayObj.hitTestPoint( particle.x, particle.y );

If you use a BitmapRenderer then you can't do a hitTestObject on the particle. In theory you could create your own hitTest method based on the particle's x and y coordinates, scale, image.width, image.height, etc. ]]>
Is there a way to hitTestObject Particles? http://flintparticles.org/forum/comments.php?DiscussionID=64&Focus=1250#Comment_1250 http://flintparticles.org/forum/comments.php?DiscussionID=64&Focus=1250#Comment_1250 Fri, 16 Jul 2010 19:08:11 +0100 Ubuntu
if(Testbox.hitTestPoint(gravityemitter.particles.x, gravityemitter.particles.y))
{
trace('hit');
}

What am I doing wrong? btw for the displayobjectrenderer and pixelrenderer is there anything that must be imported for the hitTests to work? And are there any online examples? Other than this, I love your Particle Engine Richard, and I am planning on creating some games with them. -Thank You ]]>
Is there a way to hitTestObject Particles? http://flintparticles.org/forum/comments.php?DiscussionID=64&Focus=1258#Comment_1258 http://flintparticles.org/forum/comments.php?DiscussionID=64&Focus=1258#Comment_1258 Sat, 24 Jul 2010 17:41:44 +0100 Richard
The particles property is an array. If you want to hittest an individual particle, you need to use one item from the array, not the whole array. i.e.

if(Testbox.hitTestPoint(gravityemitter.particles[0].x, gravityemitter.particles[0].y))
{
trace('hit');
}
]]>
Is there a way to hitTestObject Particles? http://flintparticles.org/forum/comments.php?DiscussionID=64&Focus=1276#Comment_1276 http://flintparticles.org/forum/comments.php?DiscussionID=64&Focus=1276#Comment_1276 Wed, 28 Jul 2010 09:42:26 +0100 Ubuntu