Loading...
Logo
Processing Forum

Window Shape

in Programming Questions  •  2 years ago  
I haven't seen this posted before, but sorry if it has. I need to change the shape of the sketch window and have no idea how I would accomplish this. I've looked at this post in exhibition but haven't been able to reproduce the circular windows it creates. I'm pretty new and what I came up with is probably completely wrong, but from my understanding this should just change the sketch window into a circle... so if someone could help, the help would be greatly appreciated.

Here's my code... pretty bad.
(I had no idea what was needed to be imported so I just kept the stuff that looked like it could do something).

Copy code
  1. import java.awt.*;
  2. import com.sun.awt.AWTUtilities;
  3. import  java.awt.GraphicsDevice.*; // PC only
  4. import java.awt.Shape;
  5. import java.awt.AWTException;
  6. import java.awt.geom.*;

  7. int d = 500;

  8. void setup() {
  9.   size(d,d);
  10.   background(255);
  11.   Shape shape = null;
  12.   shape = new Ellipse2D.Float(0,0,d,d);
  13.   AWTUtilities.setWindowShape(frame, shape);
  14. }

  15. void draw() {}

Thanks,

TheGamersHaven

Replies(3)

Re: Window Shape

2 years ago
I think the Exhibition sketch was based on the code found at http://processing.org/discourse/yabb2/YaBB.pl?num=1245794206
Perhaps you can go back to the original work...

Re: Re: Window Shape

2 years ago
Thank you so much Phi.lho, I always forget about the old forum... I really need to stop that. Worked like a charm.

Thanks again,

TheGamersHaven

Re: Window Shape

8 months ago


Copy code
  1. void setup() {
  2.   size(d,d);
  3.   background(255);
  4.   Shape shape = null;
  5.   frame.removeNotify();
      frame.setUndecorated(true);
  6.   shape = new Ellipse2D.Float(0,0,d,d);
  7.   AWTUtilities.setWindowShape(frame, shape);
  8. }

just replace this in your code :)