We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I am Try to make it to when people resize the window/surface it add or subtracts height and width no matter how they resize it. Similar to the game window in TERA.
I Have used if statements checking the current size to the change but it simply did not work.
Answers
I don't believe this can be done... when you check width and height variables, it is looking for the canvas
I never understood what you asked, but to resize the window in code, use
surface.setSize(width, height)
See also the settings() reference page:
@jeremydouglass Can the settings function be called in code without causing errors?
surface.setSize(width, height)
can be used anywhere in the sketch, even in draw().@evilhatter Anyways, the window is not resizable unless you specify with
surface.setResizable(true)
, so I don't see what the problem is.No. It is called by Processing once, at startup. This would be in addition to calling surface.setSize() -- or, as an alternative, you might be setting a maximum size programmatically and then and scale it e.g. with image().
To the original question: I'm not sure if Processing / Java can access a variable that changes whenever you manually resize the sketch window using the mouse (assuming it has been set as resizable.
Exactly what I thought. What exactly is the question anyway?