Flint Particle System Forum - Place Flint into a movie clip without the corner cutting off. Wed, 17 Nov 2010 10:04:32 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Place Flint into a movie clip without the corner cutting off. http://flintparticles.org/forum/comments.php?DiscussionID=67&Focus=319#Comment_319 http://flintparticles.org/forum/comments.php?DiscussionID=67&Focus=319#Comment_319 Wed, 20 Aug 2008 15:17:22 +0100 Bourkster
I was able to transfer the FireAndSmoke example into a a movieclip in a flash document without a need for the external .as document. Although the fire works perfectly fine, the smoke has issues.

http://www.megaupload.com/?d=9FZ6NK9U (.fla source)

As seen in this source, Symbol 2 (the smoke) is placed up in the corner, this is to place it in the correct spot. If you open up the movie clip and go to the AS tab, and modify the coordinates to x,0 y,0; and then place the clip somewhere on the stage, you will notice that the smoke emits from a small area and is cut off by what seems to be the corner of a box.

Is there anyway around this issue, as having the smoke off center is troublesome and untidy.

Thanks guys! ]]>
Place Flint into a movie clip without the corner cutting off. http://flintparticles.org/forum/comments.php?DiscussionID=67&Focus=320#Comment_320 http://flintparticles.org/forum/comments.php?DiscussionID=67&Focus=320#Comment_320 Wed, 20 Aug 2008 22:34:19 +0100 Richard
The particle space will always be drawn with coordinate 0,0 at the registration point of the renderer (this is true of all the renderers). You can move the renderer (set smokeRenderer.x and smokeRenderer.y) but I don't think that what you're after so lets assume we leave the renderer where it is (as you have done) - then the renderer's 0,0 is at the same location as the movie clip container's 0,0.

The emitter can be placed anywhere. That is what your code does with

smoke.x = 200;
smoke.y = 400;

The result of this is that the smoke emitter is 200 pixels to the right and 400 pixels down from the registration point of the renderer, which is why it's offset from the registration point of the movie clip. You are right in thinking the answer is to set this to (you could also leave them out altogether - the default values are 0)

smoke.x = 0;
smoke.y = 0;

but this is only part of the solution.

The smoke effect uses a BitmapRenderer which, unlike the DisplayObjectRenderer, draws just a limited region of the particle space. This region, which I call the canvas, is defined by the rectangle that is passed in to the Renderer's constructor. The canvas defined in your code is

new Rectangle( 0, 0, 800, 800 )
which is a rectangle 800 pixels wide and 800 pixels tall with the top left corner at 0,0. Because the smoke originates at 0,0 and moves upwards and to the left and right, most of the smoke effect will fall outside this canvas and so will not be drawn.You need a canvas with space above the 0,0 point, and to the left as well as the right of it. Something like

new Rectangle( -100, -300, 200, 350 )
which is a rectangle 200 pixels wide and 350 pixels tall, with its top left corner at -100, -300. The emitter, which is at 0,0, is horizontally in the middle of this canvas, and vertically near the bottom, which means there's room for the smoke effect to be displayed within this canvas.

N.B. Always make the canvas as small as you can while displaying all of the effect - a smaller canvas means the effect will run faster. ]]>
Place Flint into a movie clip without the corner cutting off. http://flintparticles.org/forum/comments.php?DiscussionID=67&Focus=322#Comment_322 http://flintparticles.org/forum/comments.php?DiscussionID=67&Focus=322#Comment_322 Thu, 21 Aug 2008 07:10:56 +0100 Bourkster