Drawing items without clearing the canvas

153 views
Skip to first unread message

dlapointeus

unread,
Feb 2, 2013, 8:19:44 AM2/2/13
to pap...@googlegroups.com
We're using paper.js (javascript directly) alongside imapctjs for a game we're developing.  Currently we have things *almost* working as we want, however have one issue that we're trying to overcome.  On every update, impact clears the canvas and then re-draws all background layers, game entities, etc...   We are using paper.js for touch events - however the only way we can seem to get it to work is to to call paper.view.draw(), which also clears the canvas.  So, the game runs fine, but when the specific touch events occur that use paper.js, the canvas is cleared a second time during the updates, allowing all the paper.js animations to appear correctly, however removing all the game animations.  when the touch event ends, the game resumes as expected.  So, the question is how can we re-draw specific items without clearing the canvas?   I'm sure there is an obvious answer to this that we're overlooking, however figured we'd ask the question here before looking through the source.  Thanks in advance.

Christopher Bonis

unread,
Feb 26, 2013, 4:11:06 PM2/26/13
to pap...@googlegroups.com
I would like to "bump" this issue. I am drawing a very large amount of data at a very high frequency and there is really no need to redraw the whole canvas. Instead, I would like to only redraw a small area, maybe represented by a rectangle. Is this possible in paper?

Marco Salazar

unread,
May 4, 2013, 7:26:59 PM5/4/13
to pap...@googlegroups.com
bump

Thomas Lihl

unread,
Oct 25, 2013, 10:29:32 AM10/25/13
to pap...@googlegroups.com
I have the same issue. I want to create a large amount of pixel that follow the mouse. At about 400 animated pixel the animation starts hanging. Has anyone a solution to that?


Reply all
Reply to author
Forward
0 new messages