I have multiple different sketches defined and put them all in an array so I can iterate through them and show them one by one with an on click event. It does work fine except when I change the visual after a window resize, the new sketch uses the initial window size (the size on page load) as its canvas size. Every sketch has windowResized() but it does not fire on sketch initialization because, well, window has not been resized since the sketch has come to life.
I tried to circumvent this problem by calling windowResized() on various stages of sketch’s lifecycle but none did work.
What could the problem be?
Edit: I forgot to mention that windowResized() itself does work but only fires when the current sketch is resized. When I change the sketch with an on click method, it goes back to initial canvas size.
Can you please post some example code that shows what you’re doing?
(Note that this should not be your full project! Try to isolate the problem into a smaller example, so we can focus on just the problem you’re dealing with.)