Hi @josephh ,
I know of Fluxus (I have seen a couple of videos), but I haven’t tried it.
The examples are the same p5js examples as used in the Processing (Java) docs.
It was simpler reuse the same examples than start from scratch.
However, many examples are trivial to port.
Compare the Sketching version:
#lang sketching
(define bar-width 20)
(define last-bar -1)
(define (setup)
(size 640 360)
(color-mode 'hsb height height height)
(background 0)
(no-stroke))
(define (draw)
(define which-bar (quotient mouse-x bar-width))
(unless (= which-bar last-bar)
(define bar-x (* which-bar bar-width))
(fill mouse-y height height)
(rect bar-x 0 bar-width height)
(:= last-bar which-bar)))
And the Processing version:
int barWidth = 20;
int lastBar = -1;
void setup()
{
size(640, 360);
colorMode(HSB, height, height, height);
noStroke();
background(0);
}
void draw()
{
int whichBar = mouseX / barWidth;
if (whichBar != lastBar) {
int barX = whichBar * barWidth;
fill(mouseY, height, height);
rect(barX, 0, barWidth, height);
lastBar = whichBar;
}
}