We are about to switch to a new forum software. Until then we have removed the registration on this forum.
The surface thing works in java, but when I do the same thing in python, it says "global name surface is not defined." If anyone know the solution for this, please help me out!
void setup() { size(400, 400); // size always goes first! surface.setResizable(true); }
Answers
You can also shoot your luck and beg for both surface & getSurface() to be directly accessed w/o
this.
here: https://GitHub.com/jdf/Processing.py-Bugs/issuesAh, while you're at it, request the same for getGraphics(), sketchFile(), dataFile(), dataPath(), and args[] too. :P
Amazing! Thank you!!!!
But what are these: getGraphics(), sketchFile(), dataFile(), dataPath() and args[] ? :(
Got it! You are such a nice guy. Thanks a lot!
Thanks for the info GoToLoop! I was wondering if this works when using the PDF renderer? I'm outputting large PDF files from processing and would like to dynamically set the PDF size after I've done some calculations on the input files. I'm getting the following error when I try to include the frame.setResizable(True). I'm using Processing 3.3.6 btw.
AttributeError: 'NoneType' object has no attribute 'surface'
Thanks in advance for any info you might have!
@pxlmnkeee, any PApplet
public
member not yet available in globals():Can be accessed by prefixing them w/
this.
. :-BYou can see in my 1st reply example, I can access the non-globals() member getSurface() either w/
this.getSurface()
orthis.surface
. :ar!Also, you can
import
any Processing classes not yet available in globals() viafrom package.name import class
.For example, we can
import
the non-globals()class
IntList like this: :bzhttps://Processing.org/reference/IntList.html
Or even something more "obscure" like the PGL
class
: >-)https://GitHub.com/processing/processing/blob/master/core/src/processing/opengl/PGL.java
Finally got a chance to try this, thanks again for the knowledge GoToLoop! Well, I added this to the surface call, but the PDF output is still at the initial size set in the size command.
Sorry if this is obvious, still a Processing newbie.
THANKS again for any additional info! :D
@pxlmnkeee, as explained at the 1st comment of class PSurfaceNone:
https://GitHub.com/processing/processing/blob/master/core/src/processing/core/PSurfaceNone.java#L27-L28
As we can attest inside class PGraphicsPDF at its method createSurface():
https://GitHub.com/processing/processing/blob/master/java/libraries/pdf/src/processing/pdf/PGraphicsPDF.java#L109
It doesn't seem the renderer PDF can be resizable at all. :(
OK, it didn't seem like I could get the PDF to resize so I'm glad you came to the same result GoToLoop.
Thanks again for your time and helpful info!