fastiles
fastiles copied to clipboard
[Suggestion] Add a clear() function
Currently the scene works great as a replacement for the display from rot.js. However, there is no clear analogue to clear the screen. Here's my basic current implementation in a Display class
clear() {
for (let y = 0; y < tileCountHeight; y++) {
for (let x = 0; x < tileCountWidth; x++) {
this.scene.draw([x, y], 0, 1, 0);
}
}
}
This works, but can't we improve on this by drawing a single quad for the whole scene?
Thanks!
I am currently on a vacation until the end of August. Acknowledging the issue, will look into it when I come back.
I just pushed a new Scene#clear method that clears the whole scene (using a specified color from the currently active palette). Would this API work for you?