I feel like I'm asking a question that's been answered, but searching the forum, max help, and my emails has proven fruitless. Is there any documentation beyond the canvas-examples.maxpat file? Or a recommended reference?
Ok, good to know. It seems that documentation of the use of mgraphics in jsui is equally terse at the moment? I'm pulling things apart to get to a place I can try to build something, and it's working. I'll post some simpler examples when I have something, and hopefully get confirmation that my extrapolations are correct before I proceed on an unwise path.
Excellent. Here's some SUPER BASIC examples that should help someone get started with canvas. Like me, for example :)
The functions where stuff actually happens are setup so you can cut an paste from simple canvas examples and see how they work.
I did notice that the font stuff doesn't really work. I wasn't able to specify a font name or size. According to http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-font
the font syntax follows that of CSS. The examples I tried didn't work in Max6, I just got errors:
font "18pt Arial" not available, using default
It also seems that
ctx.textAlign = "center";
doesn't work right - it just paints the text starting from the far left edge of the JSUI window.