Open Bozar opened 6 years ago
Just draw "nothing":
display.draw(x, y, "");
You can use an empty string, a space, a null
value...
Does this work on a canvas with transparent background? I've never been able to do that, I always have to write a separately function to clear the canvas context directly. If you don't know off-hand I'll dig up some code and see if I can prove myself right (or wrong).
On Fri, Mar 2, 2018 at 7:40 AM, Ondřej Žára notifications@github.com wrote:
Just draw "nothing":
display.draw(x, y, "");
You can use an empty string, a space, a null value...
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ondras/rot.js/issues/134#issuecomment-369910612, or mute the thread https://github.com/notifications/unsubscribe-auth/ABCAEnTVbUd30VZGbxmpGmYkWonnCu-bks5taT2ygaJpZM4SZU8C .
-- Todd Page twpage@gmail.com
Does this work on a canvas with transparent background?
No, it does not. The canvas is never cleared, but rather drawn atop.
Implementing true clearing is a significantly complex task, because we also have hexagonal cells so the clearRect
call is not sufficient here.
Thanks for the quick response! And yes, very good point about the hexes. My guess is it may be a fairly niche problem, so probably not worth a lot of effort. The work-around (for rectangles at least) is pretty easy.
On Thu, Mar 29, 2018 at 4:22 AM, Ondřej Žára notifications@github.com wrote:
Does this work on a canvas with transparent background?
No, it does not. The canvas is never cleared, but rather drawn atop.
Implementing true clearing is a significantly complex task, because we also have hexagonal cells so the clearRect call is not sufficient here.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ondras/rot.js/issues/134#issuecomment-377160628, or mute the thread https://github.com/notifications/unsubscribe-auth/ABCAEkCNZI-fG2rnIYu9GPgg2C6OWhAiks5tjJmxgaJpZM4SZU8C .
-- Todd Page twpage@gmail.com
Hi ondras, I'm wondering if it is possible to clear a block in the canvas?