Helping visualizers respond to canvas resizing #335
Vectornaut
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
These are good things for us to keep in mind, and we'll make sure that the visualizer API is inherently reactive to changes in dimension. This also brings into question the idea of introducing a new (more standardized) coordinate system for visualizers, which is independent of the exact dimensions of the images (not reliant on pixel coordinates). This would likely involve creating a layer in between visualizers and p5 to do this calculation, but it is something that should be decided on now before everything is in place. What do you think? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Typically, p5 sketch designers either fix the canvas dimensions or make sure that the
draw
method works correctly when the canvas dimensions change from frame to frame. However, we've currently decided that we don't want to allow fixed-dimension visualizers, and we want to give visualizer designers a simplified way of reacting to canvas dimension changes.While you're working on helping visualizers to react to parameter changes in real time, it could be useful for you to think of dimension changes as a type of parameter change. They're not entirely the same, since dimension changes can happen many times per second while the browser window is being resized, while the kinds of parameter changes we have right now can only happen every second or two. However, being able to handle dimension changes and parameter changes in the same way could be make things easier for some visualizer designers.
Beta Was this translation helpful? Give feedback.
All reactions