0

Why is it that when an object is moved on a keypress event with WASD, if it is on a transparent canvas a black trail follows the images as it moves?

Is there a way to get rid of this paintbush effect? I have a background underneath but it is on a separate canvas. The transparent canvas ontop is supposed to be for the moving WASD character only but the trail it leaves on its transparent canvas is obviously also over the canvas underneath. :*(

  • 2
    Clear the canvas on every step? – bfavaretto Jun 16 '13 at 03:34
  • What you paint on canvas *stays there* just like... a canvas!. Canvas isn't not painting the next frame on a new frame. You must clear the canvas for the next draw. – Joseph Jun 16 '13 at 03:42
  • if I clear the canvas using rect it will no longer be transparent though? How else can I clear? – user2420951 Jun 16 '13 at 03:44
  • possible duplicate of [How to clear the canvas for redrawing](http://stackoverflow.com/questions/2142535/how-to-clear-the-canvas-for-redrawing) – bfavaretto Jun 16 '13 at 03:51
  • no relation. those solutions make the canvas not transparent. making the canvas full of white pixels does not help here. – user2420951 Jun 16 '13 at 03:52
  • I apologize I was wrong clear rect does let the canvas underneath shows. Really strange that it is called "clearrect" i guess... – user2420951 Jun 16 '13 at 04:02

0 Answers0