Closed mingos777 closed 7 years ago
The ROT.Display
API works (only) on the cell level.
If you want to clear a set of cells, just draw()
them with a blank character (or no character at all; draw(3, 4)
would work as well). You do not need to worry much about performance, as these calls are batched and the actual canvas is processed in an asynchronous requestAnimationFrame
loop.
OK, I will do that then, though personally I believe such functionality should belong to ROT.js and not necessarily my codebase ;)
What API do you propose?
I can't seem to find a way to clear a rectangular portion of the canvas without clearing the rest. Is it at all possible with ROT.js, without using the canvas JS API directly or writing a loop to print a space over all the cleared cells?
Clearing or drawing/filling with background colour are both acceptable solutions. Without this, I need to redraw the entire display when I actually only need di redraw a portion of it, which is wasteful.