mirror of
https://github.com/dyne/FreeJ.git
synced 2026-02-09 22:39:58 +01:00
processing-js 0.4 has been merged in some relevant parts basic and topic scripts added for test color handling fixed, more scripts show up now
26 lines
498 B
Plaintext
26 lines
498 B
Plaintext
PFont font;
|
|
float x = 33; // X-coordinate of text
|
|
float y = 60; // Y-coordinate of text
|
|
|
|
void setup()
|
|
{
|
|
size(200, 200);
|
|
font = loadFont("AmericanTypewriter-24.vlw");
|
|
textFont(font);
|
|
noStroke();
|
|
}
|
|
|
|
void draw()
|
|
{
|
|
fill(204, 120);
|
|
rect(0, 0, width, height);
|
|
fill(0);
|
|
// If the cursor is over the text, change the position
|
|
if ((mouseX >= x) && (mouseX <= x+55) &&
|
|
(mouseY >= y-24) && (mouseY <= y)) {
|
|
x += random(-5, 5);
|
|
y += random(-5, 5);
|
|
}
|
|
text("tickle", x, y);
|
|
}
|