v2.11
2.11.7
text(str, x, y, w, h)
in p5 optionally lets users define a bounding box in pixels to constrain rendering text within. However, this is not performance friendly, it requires ensuring each line can fit within a pixel width limit. I hadn't documented this yet, but the width limit has always been a character width limit in q5, not a pixel width limit. I changed the height limit to be a line limit, this behavior is consistent in q2d and webgpu. See the documentation for text
: https://q5js.org/learn/#text
2.11.6
Fixed issue with creating Q5.Sound objects. The audio context needs to be created after a user interaction, then the pan
property can be added to the Q5.Sound object.
2.11.3
textFont
is now automatically set to the last font loaded.
2.11.2
Introducing q5.js server side support for Bun and Deno! Node.js support has also been improved.
// node
require('q5');
// bun
import 'q5';
// deno
import '@q5/q5';
You can optionally enable canvas rendering support when running q5 with node or bun by installing the skia-canvas
and jsdom
npm packages. I switched to supporting "skia-canvas" instead of "node-canvas" (cairo based) because Skia is faster. It's the same tech that powers CanvasRenderingContext2D in Chrome.
https://www.npmjs.com/package/skia-canvas
Also, q5 is now available on JSR. It's an open source package registry for modern JavaScript.
https://jsr.io/@q5/q5