Loading...
Logo
Processing Forum
Disappointment. 

save(); saves only the non-GUI objects.

I was putting together a diagram with labels. Takes forever to position the GUI objects in relation to other objects in core.
They're in separate worlds.

Then they don't appear...
 

Replies(5)

Is there a library that supports both labels and normal graphics (ellipse, line, etc.) on one saveable canvas?


I assume that you are using the G4P (guicomponents) library. The problem is probably due to calling save() from inside draw(). If that is the case there is a simple solution by organising your code in draw like this.

Copy code
  1. void draw(){
  2.   // your drawing code goes here
  3.   G4P.draw();  // Make all the GUI components visible
  4.   // Now you can have code to save the frame
  5.   save("my_picture.png");
  6. }
If you are using
Thanks,

This is what I had, not inside draw(). But I inserted  "G4P.draw();" and everything now appears in the file. 

Copy code
  1. void mousePressed() { 
  2.   G4P.draw(); 
      save("quadrants.png");
  3. }


Try removing G4P.draw() from mousePressed() and place it in draw - leave the save("quadrants.png"); in mousePressed().

It is not a good idea to have G4P.darw() outside the draw() method.



Takes forever to position the GUI objects in relation to other objects



as far as I understand it
when you want to paint the GUI

http://www.lagers.org.uk/g4ptool/index.html