あなたは、単に引数を渡すことはありません、ウィンドウモードを使用しない場合:
PApplet.main(new String[] {"MyGame"});
現在のモードからウィンドウモードに切り替えるには、手動でAFAIKを処理する必要があります。 PAppletはJavaのAppletクラスを継承し、Frameを使用してコンテンツを追加します。
import processing.core.PApplet;
public class MyGame extends PApplet {
public void setup(){
size(400,400);
background(255);
smooth();
stroke(0,32);
}
public void draw(){
fill(255,1);
rect(0,0,width,height);
translate(width/2,height/2);
rotate(frameCount * .1f);
line(0,0,width/3,0);
}
public void keyPressed(){
if(key == 'f') exitFullscreen();
}
private void exitFullscreen() {
frame.setBounds(0,0,width,height);
setBounds((screenWidth - width)/2,(screenHeight - height)/2,width, height);
frame.setLocation((screenWidth - width)/2,(screenHeight - height)/2);
setLocation((screenWidth - width)/2,(screenHeight - height)/2);
}
public static void main(String args[]) {
PApplet.main(new String[] { "--present", "MyGame" });
}
}
が希望セットアップを得るためにexitFullscreen()メソッドで自由にいじくりを感じる: は、ここでは簡単ハックです。
あなたはどのようにして他の方法、つまりウィンドウモードからフルスクリーンモードに切り替えるのですか? – Koffiman
@Koffiman次のようなことを試すことができます: 'java.awt.Rectangle fs = new java.awt.Rectangle(0,0、displayWidth、displayHeight); frame.setBounds(fs); setBounds(fs); 'しかし、問題はフレームをデコレートすることができません(枠線/閉じるボタンなどはありません)。おそらく、これを別の質問として投稿し、より多くの回答/提案を得るべきです。 –
完了!あなたはおそらくあなたの答えをここに投稿できますか(http://stackoverflow.com/questions/23260640/java-processing-2-0-using-eclipse-switching-from-window-to-fullscreen-and-ba)ディスカッションに行く? – Koffiman