p5 的wiki 页上原有这个主题,后来搬到github 后,原本的链接失效了。大致是这样:
import java.awt.Frame;
static public void main(String args[]) {
Frame frame = new Frame("testing");
frame.setUndecorated(true);
// The name "sketch_name" must match the name of your program
PApplet applet = new sketch_name();
frame.add(applet);
applet.init();
frame.setBounds(0, 0, 2048, 768);
frame.setVisible(true);
}
然后在size() 中设置展开后的frame 大小,以以上代码为例就是2048 * 768,另外需要注意的是需要在主显示器(屏幕)运行,这个可以在控制面板中自行定义。
离俺上次发帖得有几年了吧。。。