We are about to switch to a new forum software. Until then we have removed the registration on this forum.
void setup(){
size(400,400);
}
void draw(){
background(0);
if(keyPressed){
frame.resize(600,400);
}
}
This is a MVCS. When you press any button, the sketch window resizes properly, but the new area isn't colored in black like I would expect. What am I doing wrong here?
Answers
Here's my attempt on it: :-bd
The width & height's forced reassignment isn't necessary. But it makes the canvas adapt faster to latest resize().
@ GoToLoop== yes your code works but a) i would be happy to understand & learn why TFGuy44 is wrong... b) with your code there is one frame during which the update is not achieved and you can see some "flash" c) as for me here the code i use - Of course adding java awt, sorry! but there is no flash...
Only thing @TfGuy44's code needed was
frame.setResizable(true);
.Since I've slowed down frameRate(), it's much more noticeable that "flash" I guess!
Right; excuse me i have not noticed this point...And thanks!
What about this one?
Setting the size of the canvas as well as the frame, seems to do the job..
Here's some study I made on this once, considering insets...