Hello, i am just learning about these things, processing and p5…
I made a sketch on Processing and transfer it to p5.js.
What happend is that the resolution of my codes turned too slow, both of them. As o Processing as on p5. Then i uploaded it to github .
Is there something i am missing for my work get too slow?
I am sending here both of them and a link of the github.
The flashs/blinks of the rect suposed to be real fast, as the little circle on the ET head, witch contains a link ebebbed.
Thanks to all
1- Processing code;
PImage et;
boolean overButton = false;
boolean backwards=false;
int timeLapse=400;
int timeTrack;
PShader blur;
void setup() {
size(600, 600);
et = loadImage("et.png"); // Load the image into the program
filter(BLUR, 6);
}
void draw() {
background(0); // total canva black
// rect flahing/blinking
int m = millis();
fill(m % 200); // velocity of flashs ** not working good ** maybe my computer..
rect(25, 25, 555, 555, 30);
image(et, 0, 0 );
textSize(128);
fill(0, 408, 612, 816);
//text
text("Techno", 100, 150, -120);
filter(BLUR, 6);
//button link to web page
if (overButton == true) {
noStroke();
fill(74, 245, 243, 70);
} else {
noStroke();
noFill();
}
circle(267, 290, 30);
}
void mousePressed() {
if (overButton) {
link("https://web.facebook.com/groups/378940129825776");
}
}
void mouseMoved() {
checkButtons();
}
void mouseDragged() {
checkButtons();
}
void checkButtons() {
if (mouseX > 200 && mouseX < 500 && mouseY > 200 && mouseY <300) {
overButton = true;
} else {
overButton = false;
}
}
2 - p5 code;
var button;
var et;
var overButton;
var backwards;
var timeLapse;
var timeTrack;
var blur;
function preload() {
photo = loadImage('et.png');
}
function setup() {
initializeFields();
createCanvas(windowWidth, windowHeight);
//createCanvas(600, 600);
// Load the image into the program
et = loadImage("et.png");
filter(BLUR, 6);
}
function draw() {
// total canva black
background(0);
// rect flahing/blinking
var m = millis();
// velocity of flashs ** not working good ** maybe my computer..
fill(m % 170);
rect(25, 25, 555, 555, 30);
image(et, 0, 0);
textSize(128);
fill(0, 408, 612, 816);
// text
text("Techno", 100, 70, -120);
filter(BLUR, 6);
if (overButton == true) {
noStroke();
fill(74, 245, 243, 70);
filter(BLUR, 8);
} else {
noStroke();
fill(237, 10, 222);
}
circle(267, 290, 30);
}
function mouseClicked() {
{
window.open('https://www.youtube.com/playlist?list=PLLfjXK0h5ZJK01y34_ouFkU5wpFW5HyE7');
}
}
function mouseMoved() {
checkButtons();
}
function mouseDragged() {
checkButtons();
}
function checkButtons() {
if (mouseX > 200 && mouseX < 500 && mouseY > 200 && mouseY < 300) {
overButton = true;
} else {
overButton = false;
}
}
function initializeFields() {
et = null;
overButton = false;
backwards = false;
timeLapse = 400;
timeTrack = 0;
blur = null;
}
And this is the page with the results from github;