Oh, that naughty sketch! Please let us know what the issue is below.
Apply Template
Applying this template will reset your sketch and remove all your changes. Are you sure you would like to continue?
Report Sketch
Report Comment
Please confirm that you would like to report the comment below.
We will review your submission and take any actions necessary per our Community Guidelines. In addition to reporting this comment, you can also block the user to prevent any future interactions.
Please report comments only when necessary. Unnecessary or abusive use of this tool may result in your own account being suspended.
Are you sure you want to delete your sketch?
Any files uploaded will be deleted as well.
Delete Comment?
This will also delete all the replies to this comment.
Delete this tab? Any code in it will be deleted as well.
Select a collection to submit your sketch
We Need Your Support
Since 2008, OpenProcessing has provided tools for creative coders to learn, create, and share over a million open source projects in a friendly environment.
Niche websites like ours need your continued support for future development and maintenance, while keeping it an ad-free platform that respects your data and privacy!
Please consider subscribing below to show your support with a "Plus" badge on your profile and get access to many other features!
A fork of affiche-QWERTY by atelier YOUPI
CC Attribution NonCommercial ShareAlike
affiche-AZERTY
YOUPI
xxxxxxxxxx
let fileName = 'nom_du_fichier'
let paperSize = 'A4'
let bgColor = 0,
gridColor = 255;
let pd = 6
let inp, sel, resize, resizer = 1,
saveMode = 0
let grid, grider = 1,
gridX, gridY, gutter, padding, pad
let x, y
var couleur = 150
var couleur2 = '#222222'
function preload() {
//typo = loadFont('gapsansbold-webfont.ttf');
//typo = loadFont('BLANCH_CONDENSED.otf');
//typo2 = loadFont('GothiksRound-Black.otf');
//typo = loadFont('Rubik-Black.otf');
typo = loadFont('Morganite-Black.ttf');
//typo = loadFont('MangoGrotesque-Black.ttf');
//typo = loadFont('MonTrappist-Black.otf');
//typo2 = loadFont('Rubik-Light.otf');
typo2 = loadFont('Morganite-Light.ttf');
typo3 = loadFont('Morganite-Medium.ttf');
typo4 = loadFont('VG5000-Regular.otf');
}
function setup() {
createCanvas(420, 594);
angleMode(DEGREES);
background(30);
colorMode(HSB);
noFill();
//noLoop();
//background(0);
interface();
kMax = random(0.6, 1.0);
p = random(0.7,4);
//ANIM
var slogan = random(slogans);
index = Math.floor(random(0, slogans.length));
var slogan2 = random(slogans2);
index2 = Math.floor(random(0, slogans2.length));
var slogan3 = random(slogans3);
index3 = Math.floor(random(0, slogans3.length));
var slogan4 = random(slogans4);
index4 = Math.floor(random(0, slogans4.length));
var slogan5 = random(slogans5);
index5 = Math.floor(random(0, slogans5.length));
var slogan31 = random(slogans31);
index31 = Math.floor(random(0, slogans31.length));
diam = random(300,width*1.2);
}
function draw() {
pad = 40;
if (resizer) {
pt = (1 / 1.36)
} else {
pt = (1 / 1.36) * (6 / pd)
}
if (saveMode) {
pixelDensity(pd)
} else {
pixelDensity(2)
}
//background(bgColor,0,0);
noStroke()
noFill()
poster()
if (grider) {
gridDisplay(gridColor)
}
if (saveMode) {
save(fileName + '_' + paperSize + '.jpg')
saveMode = 0
}
}
//ANIM
function blob(size, xCenter, yCenter, k, t, noisiness) {
beginShape();
let angleStep = 360 / 10;
for (let theta = 0; theta <= 360 + 2 * angleStep; theta += angleStep) {
let r1, r2;
/*
if (theta < PI / 2) {
r1 = cos(theta);
r2 = 1;
} else if (theta < PI) {
r1 = 0;
r2 = sin(theta);
} else if (theta < 3 * PI / 2) {
r1 = sin(theta);
r2 = 0;
} else {
r1 = 1;
r2 = cos(theta);
}
*/
r1 = cos(theta)+1;
r2 = sin(theta)+1; // +1 because it has to be positive for the function noise
let r = size + noise(k * r1, k * r2, t) * noisiness;
let xFlam = xCenter + r * cos(theta);
let yFlam = yCenter + r * sin(theta);
curveVertex(xFlam, yFlam);
}
endShape();
}
// After https://observablehq.com/@mbostock/sinebow
function interpolateSinebow(t, alpha) {
angleMode(RADIANS);
t = 0.5 - t;
return color(
360 * pow(sin(PI * (t + 0 / 3)), 2),
100 * pow(sin(PI * (t + 1 / 3)), 2),
100 * pow(sin(PI * (t + 2 / 3)), 2),
alpha
);
}
function interface() {
// recharger
button = createButton('recharger');
button.position(16, 20);
button.style('background-color', couleur2);
button.style('border-radius', '100px');
button.style('color', '#ffffff');
button.style('padding-top', '5px');
button.style('padding-bottom', '5px');
button.style('padding-right', '10px');
button.style('padding-left', '10px');
button.style('cursor', 'pointer');
button.style('border', 'solid 1px');
button.mouseOver(clic2);
button.mousePressed(recharger);
// rond
cercle = 395;
// padding
padding = 40;
// grid x number
gridX = 10;
// grid y number
gridY = 20;
// fileName
inp = createInput('Nom_du_fichier');
inp.position(16, 58);
inp.style('background-color', '#FFFFFF');
inp.style('border-radius', '4px');
inp.style('padding-top', '5px');
inp.style('padding-bottom', '5px');
inp.style('padding-right', '5px');
inp.style('padding-left', '10px');
inp.style('border', 'solid 1px');
inp.style('outline', 'none');
inp.size(140);
// paperSize
sel = createSelect();
sel.position(16, 95);
sel.option('A6');
sel.option('A5');
sel.option('A4');
sel.option('A3');
sel.option('A2');
sel.option('A1');
sel.option('A0');
sel.selected('A4');
sel.style('background-color', '#FFFFFF');
sel.style('border-radius', '4px');
sel.style('padding-top', '4px');
sel.style('padding-bottom', '4px');
sel.style('padding-right', '2px');
sel.style('padding-left', '2px');
sel.style('cursor', 'pointer');
sel.style('border', 'solid 1px');
sel.changed(changePd);
// save
button = createButton('sauvegarder');
button.position(75, 95);
button.style('background-color', couleur );
button.style('border-radius', '100px');
button.style('padding-top', '5px');
button.style('padding-bottom', '5px');
button.style('padding-right', '10px');
button.style('padding-left', '10px');
button.style('cursor', 'pointer');
button.style('border', 'solid 1px');
button.mouseOver(clic);
button.mousePressed(download);
}
function gridChanged() {
if (!this.checked()) {
grider = 0
} else {
grider = 1
}
}
function resizeChanged() {
if (this.checked()) {
resizer = 0
} else {
resizer = 1
}
}
function gridDisplay(color) {
stroke(color)
strokeWeight(0)
line(pad, pad, width - pad, pad)
line(pad, pad, pad, height - pad)
line(width - pad, height - pad, pad, height - pad)
line(width - pad, pad, width - pad, height - pad)
x = (width - pad * 2) / 10
y = (height - pad * 2) / 20
for (let i = 1; i < 10; i++) {
line(x * i + pad - 10 / 2, pad, x * i + pad - 10 / 2, height - pad)
line(x * i + pad + 10 / 2, pad, x * i + pad + 10 / 2, height - pad)
}
for (let j = 1; j < 20; j++) {
line(pad, y * j + pad - 10 / 2, width - pad, y * j + pad - 10 / 2)
line(pad, y * j + pad + 10 / 2, width - pad, y * j + pad + 10 / 2)
}
}
function changePd() {
paperSize = sel.value();
switch (paperSize) {
case 'A6':
pd = 3
break;
case 'A5':
pd = 4.2
break;
case 'A4':
pd = 6
break;
case 'A3':
pd = 8.5
break;
case 'A2':
pd = 12
break;
case 'A1':
pd = 16.8
break;
case 'A0':
pd = 22
//pd = 24
break;
default:
pd = 1
//
}
}
function clic() {
couleur = 255 ;
}
function clic2() {
couleur2 = 255 ;
}
function download() {
fileName = inp.value()
saveMode = 1
}
function recharger() {
clear();
loop();
index = Math.floor(random(0, slogans.length));
index2 = Math.floor(random(0, slogans2.length));
index3 = Math.floor(random(0, slogans3.length));
index4 = Math.floor(random(0, slogans4.length));
index5 = Math.floor(random(0, slogans5.length));
index31 = Math.floor(random(0, slogans31.length));
diam = random(300,width*1.2);
p = random(0.7,4);
}
See More Shortcuts