Unable to Run anything, from a first time user

edited July 2014 in Hello Processing

I think there is a bug in the program but I'm not sure. I was going through the tutorials to make an ellipses and a rectangle. I inserted this code

rect(100,50,225,150); 
ellipse(250,200,200,200);

Then I pressed the play button to run the program but it keep bringing up an un-adjustable window with a gray square in the middle. How can this be fixed?

Answers

  • Answer ✓

    The figures you draw are outside of the default 200x200 display window. Try beginning with this statement:

    size(500,500);
    
  • That worked. Thank you. Is there a way to change the default size of the display window so that doesn't happen again?

  • Answer ✓

    It's standard (basically required) practice to begin a program with a size() statement. It has to be the first statement in setup().

  • Thanks. I'll have to remember that for this program.

  • This is not necessarily the absolute minimum of a Processing program, but it is a helpful template to follow:

    // Inside of setup() belongs code that should happen once before draw()
    void setup() {
      // Declare how large the screen should be
      // In this case it is 640 pixels wide and 480 pixels tall
      size(640, 480);
    }
    
    // Inside of draw() belongs code that should happen 60 times a second
    void draw() {
    }
    
  • I think there should be a note somewhere in the tutorial stating that you shouldn't come out of the canvas or you can't see something etc.. But that is for some shallow-hearted wandering to this site :) Not a problem if you take a little bit more thinking huh :)

Sign In or Register to comment.