Radius parameter in rect() not working with processing.js

edited April 2014 in JavaScript Mode

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

Sign In or Register to comment.