curl -fsSL https://Gist.GitHubUserContent.com/GoToLoop/246a31d437aaa8c6eadb7f7186544e0f/raw/thonny-installer.bash -o thonny-installer.bash && chmod +x thonny-installer.bash && ./thonny-installer.bash
🚀 Convert the q5.js library into an ECMAScript Module (ESM) with ease!
This script reads the local q5.js file from subfolder q5 or fetches it from a remote source,
applies customizable string replacement patterns, and generates the resulting q5.mjs file
in subfolder q5.
- Local or Remote Input: Automatically handles local files or fetches from a remote URL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| height: 610 | |
| scrolling: no | |
| border: no | |
| license: cc-by-4.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Keyboard Input Library | |
| * Andrew Errity v0.2 (2015-Oct-01) | |
| * GoToLoop v1.0.4 (2015-Oct-22) | |
| * | |
| * https://Forum.Processing.org/two/discussion/13175/ | |
| * do-whille-is-not-working-how-it-suppose-to#Item_12 | |
| * | |
| * https://GitHub.com/aerrity/Inputs/blob/master/src/Inputs.java | |
| * https://Gist.GitHub.com/GoToLoop/bba0c288aaeeb5ef9bb1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Resize the image to a new width and height using nearest neighbor algorithm. | |
| * To make the image scale proportionally, | |
| * use 0 as the value for the wide or high parameters. | |
| * For instance, to make the width of an image 150 pixels, | |
| * and change the height using the same proportion, use resize(150, 0). | |
| * Otherwise same usage as the regular resize(). | |
| * | |
| * Note: Disproportionate resizing squashes "pixels" from squares to rectangles. | |
| * This works about 10 times slower than the regular resize. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use strict"; | |
| for (const p of Object.getOwnPropertyNames(Math)) Q5[p] = Math[p]; | |
| function Q5(scope, parent) { | |
| const | |
| $ = this, M = Math, | |
| { _isObj, _isFun, _isNum, _isP5, _val, _argsErr } = Q5; | |
| var |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //module.exports = function(options, undef) { | |
| "use strict"; | |
| const TAU = 2 * Math.PI, | |
| lerp = (start, stop, amt = 0) => +start + amt*(stop - start), | |
| sq = n => n*n, | |
| pjsCheck = obj => obj != null && 'noLoop' in obj, | |
| argsErr = (mtd, len, min) => { | |
| throw `Too few args passed to ${mtd}() [${len} < ${min}].`; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function windowResized() { | |
| const css = getComputedStyle(canvas.parentElement), | |
| mw = float(css.marginLeft) + float(css.marginRight), | |
| mh = float(css.marginTop) + float(css.marginBottom), | |
| ww = float(css.width) || windowWidth, | |
| wh = float(css.height) || windowHeight, | |
| w = round(ww - mw), h = round(wh - mh); | |
| resizeCanvas(w, h, true); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| function adjustFrameSize() { | |
| if (frameElement) { | |
| frameElement.height = frameElement.frameBorder = 0; | |
| frameElement.height = getDocHeight() + 'px'; | |
| frameElement.width = getDocWidth() + 'px'; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Hacked Movie EoS Event (v2.1.0) | |
| * by GoToLoop (2022-Oct-20) | |
| * | |
| * Gist.GitHub.com/GoToLoop/67023ba3e9ba1d0301c40f7c030d176a | |
| * | |
| * Discourse.Processing.org/t/hacked-movie-eos-event-library/39375 | |
| * Forum.Processing.org/two/discussion/14990/movie-begin-and-end-events#Item_1 | |
| */ |
NewerOlder