Closed kosinaz closed 4 years ago
Hi @kosinaz,
I would guess that you need to re-append the display's container. Switching the backend probably creates a new HTML container node that shall be appended as necessary.
Ref: https://github.com/ondras/rot.js/blob/master/src/display/display.ts#L113
It works like a charm! Thank you! I need to remove the previous canvas every time the layout is changed, but it's ok. Thanks for the quick support!
I tried it several ways, and finally, I gave a chance to the interactive manual, but it does nothing. I tried
layout: "hex"
and evenlayout: "rect"
on an alreadyrect
display and then the display just got cleared.Without the
layout: "rect"
line it works fine.I would like to use this method to change between
rect
andtile
layout at runtime. Based on the code this should be a possibility.But it does nothing. No error, no crash, just an empty display even if I draw on it.