Is there any way that I’ve missed to clear an image? I need to update an image every frame, and it contains transparent areas so I can’t just draw over the top. I’d ideally like to be able to blank it down and start again, much the way the main draw loop works.
If not, is there any chance this could be added in a future update?
I had the same issue, need to restore transparency of a buffer image during draw. So clear the image with no background and no color.
The solution using setcontext(image) and then background(0,0,0,0) works fine.
Note that a rect with alpha 0 does nothing so you must use background.
On the subjects of setContext(img) whlie draw(): i have come to the conclusion that setCotext works fine when in the setup() phase but has a lot of problems (doesn’t work at all, or only when some kind of pause occurs, like a print() ). Am i the only who experienced it? I cannot be sure whether the bug is in my code or in codea. If i am the only one, I’ll assume it’s my code that fails.
We’ve fixed several issues with setContext, and it can now be used reliably during the draw loop without any significant slowdown and during video recording without issue.