canvas-sketch
canvas-sketch copied to clipboard
Exporting Multiple Dimensions
I am working on a print series and realizing I probably want to give buyers the option between multiple sizes, rather than forcing them to a single size. I'm also realizing I usually export multiple sizes: print, Behance, IG, Twitter sometimes all get slightly different sizes, sometimes working in inches or in pixels.
Will have to think about syntax... but should be possible so that Cmd + S will save all sizes in a single go.
EDIT: Just thinking, maybe this could somehow be done via a UI or somehow without code changes. I do not really want to associate exact combination of sizes with a git commit, because some time later I may revisit the same artwork to re-print it at a different size, and I would like to be able to just git checkout that SHA and re-export without tweaking any code.
It might be interesting to do this from the command line if you could somehow override local sketch settings with CLI options.
const settings = {
dimensions: [500, 500]
}
canvas-sketch --dimensions 1000,10000 my-sketch.js
In the example above, the sketch would render at 500x500 by default, and at 1000x1000 if you passed dimensions to the script.
On a similar note, I've been thinking about the concept of letting each sketch export its own CLI options, with its own help text and args. Yargs, for example, supports the concept of modules-as-commands. Going further, you could export these options to the browser with something like dat.gui. You end up with a single interface for CLI options and in-browser options.
Thanks @Caged, I do like the idea of inserting settings via CLI tool. :+1: Going to keep thinking about this as it may relate to GUI/HUD stuff I'm planning on.