createGraphics
in
Programming Questions
•
1 year ago
Hi All,
I am working with createGraphics.
When yplaats is over height-100, I would like to clear the tekstlaag. The only methods I can think of are tekstlaag.background(0) and calling the tekstlaag again by using:
tekstlaag = createGraphics(width, height, JAVA2D);
Is there a good way to just clear the layer without starting all over? When I use background, the whole layer just fills itself with the (0)=black color, while I just want a cleared layer.
How can I do this?
if (yplaats > height-100) {
yplaats = 0;
background(0);
tekstlaag.background(0);
// tekstlaag = createGraphics(width, height, JAVA2D);
}
I am working with createGraphics.
When yplaats is over height-100, I would like to clear the tekstlaag. The only methods I can think of are tekstlaag.background(0) and calling the tekstlaag again by using:
tekstlaag = createGraphics(width, height, JAVA2D);
Is there a good way to just clear the layer without starting all over? When I use background, the whole layer just fills itself with the (0)=black color, while I just want a cleared layer.
How can I do this?
if (yplaats > height-100) {
yplaats = 0;
background(0);
tekstlaag.background(0);
// tekstlaag = createGraphics(width, height, JAVA2D);
}
1