resize sketch in processing 3

edited January 2018 in Questions about Code

Is there any way, no matter how hacky to resize the sketch in processing 3?

Answers

  • edited June 2015

    There is, and always was, a very un-hacky way to resize the sketch, and I'm not sure why anything would change between Processing 2 and 3. Try this:

    void setup() {
      frame.setResizable(true);
    }
    

    That one line should be all you need. Although do let me check, as in fact, anything could have changed. #-o

    Edit: Yep. Absolutely nothing changed. frame.setResizable(true) still works. :)

  • hmm only for default rendered. No more resizing P3D it seems.

  • Oh. If you're using P3D, I was given this warning:

    Use surface.setResizable() instead of frame.setResizable in Processing 3

    Also, make sure that you're calling surface.setResizable(true) after you call size();

  • Problem is the frame is not resizing:

    PGraphics pg;
    
    void setup() {
      size(200, 200, P3D);
      surface.setResizable(true);
    }
    
    
    void draw() {
      surface.setSize(width+1, height+1);
      line(0, height/2, width, height);
    }
    
  • Have you tried, in "draw" section, scale command? scale(0.7) for instance

Sign In or Register to comment.