Fork me on GitHub
Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

  1.  
    I'm making a flash game in which you can hold down space bar to show a bomb.

    The normal cursor hides, an image of a bomb appears in place of the cursor, and I use Flint here to generate particles from the "cord" of the bomb (I don't know the correct english word). You know, the part that you set on fire.

    All is good, and I can release space and it is hidden. Releasing space does, among other things, the following:
    Stop the emitter.
    Calls removechild on the renderer.
    The Sprite that contains all particle effects is also removed from the display list.

    Problem is, when I hit space again, there are particles lingering from the previous display of the bomb.

    I've tried the following:
    emitter.killAllParticles
    emitter.runAhead
    renderer.graphics.clear()
    And probably 2 or 3 other methods while troubleshotting that I can't think of at the moment.

    How do I effectively clear the whole renderer area? I think the main problem is that I use a blurfilter and it's the blurring that lingers. Doesn't give me any idea how to fix it though...
    • CommentAuthorNot Sure
    • CommentTimeJun 5th 2009
     
    Are you using any filters? If so, you should clear and re-instantiate them.
  2.  
    Yes I'm using a blurfilter.

    How can I clear a blurfilter?

    It still wont work even though I:
    - When hiding the particles, I remove the blurfilter from the renderer
    - When hiding the particles, I re-instantiate the blurfilter
    - Blurfilter is added to particles first when I hit space, and then it is a new fresh blurfilter

    It still shows trails
    • CommentAuthorRichard
    • CommentTimeJun 10th 2009
     
    A bitmap renderer draws the particles onto a BitmapData object that is then displayed. The bitmapData object can be accessed via the bitmapData property of the renderer. So, to clear it, fill it with a transparent color...

    renderer.bitmapData.fillRect( renderer.bitmapData.rect, 0 );
  3.  
    Ah, thank you! Worked perfectly.

    I'm not a 100% on flash itself yet..