We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I can't get the radius parameter in rect(x, y, width, height, radius), to work with processing.js This causes the entire sketch to stop. Is there any reason for this? line 27
import processing.opengl.*;
boolean overRegion = false;
boolean pressed = false;
boolean button = false;
void setup() {
size(400, 400, OPENGL);
}
void draw() {
background (255, 255, 255);
if (mouseY > 30.0) {
overRegion = true;
}
else {
overRegion = false;
}
camera(200, mouseY, 50, 0, 0, 0, 0, 1, 0);
stroke(200, 0, 0);
line(-200, 0, 0, 200, 0, 0);
stroke(0, 200, 0);
line(0, -200, 0, 0, 200, 0);
stroke(0, 0, 200);
line(0, 0, -200, 0, 0, 200);
stroke(0, 0, 0);
if (button) {
box(150);
}
rect(100, 100, 55, 30, 7);
hint(DISABLE_DEPTH_TEST);
camera();
stroke(0, 0, 0);
fill(#919293);
textSize(12);
if (button) {
fill(#BFE1F0);
rect(0, 0, 55, 30);
line(0,0,100,100);
}
else {
//drawRect2();
fill(#6FCBF5);
rect(0, 0, 55, 30);
}
fill(0, 0, 0);
text("button", 11, 20);
hint(ENABLE_DEPTH_TEST);
}
void drawRect1(){
fill(#BFE1F0);
rect(0, 0, 55, 30);
}
void drawRect2(){
fill(#6FCBF5);
rect(0, 0, 55, 30);
}
void mousePressed() {
if (overRegion) {
pressed = true;
}
else {
pressed = false;
}
if (mouseButton == LEFT) {
if (mouseX > 0 && mouseX < 55 && mouseY > 0 && mouseY < 30) {
button = !button;
}
}
}
void mouseReleased() {
pressed = false;
}
Thanks, Shane
Answers
They kept the Processing reference pages, but I am not sure if they support everything advertised... :-)
Ah... ok, that must be it then. Is it possible to let them know? Thanks PhiLho
Another bug recently found on PJS v1.4.1. Wrong # of parameters:
http://forum.processing.org/two/discussion/4628/nfc-doesnt-behave-as-expected-in-processing-js
However it got fixed on v1.4.7! =:)
Seems that someone has already reported this bug. http://processing-js.lighthouseapp.com/projects/41284/tickets/1943-rect-supports-rounded-rectangles