Arduboy2 Erase Function

(Ece) #1

Are there any functions to erase the things that drawn with the draw or fill functions in Arduboy2 library?

(Pharap) #2

Depends what you mean by ‘erase’.

You can erase the whole screen by calling arduboy.clear().

Alternatively you can just draw over something with the opposite colour.
For example, if you did arduboy.fillRect(0, 0, 32, 32, WHITE); to draw a white 32x32 rectangle in the top left of the screen (or arduboy.fillRect(0, 0, 32, 32);, which does the same thing) then calling arduboy.fillRect(0, 0, 32, 32, BLACK); would draw a black 32x32 rectangle over top of that, thus ‘erasing’ the first rectangle.