processing
コード class SecondApplet extends PApplet { PApplet parent; SecondApplet(PApplet _parent) { super(); // set parent this.parent = _parent; //// init window try { java.lang.reflect.Method handleSettingsMethod = this.getClass().getSuperclass().getDeclaredMethod("handleSettings", null); handleSettingsMethod.setAccessible(true); handleSettingsMethod.invoke(this, null); } catch (Exception ex) { ex.printStackTrace(); } PSurface surface = super.initSurface(); surface.placeWindow(new int[]{0, 0}, new int[]{0, 0}); this.showSurface(); this.startSurface(); } void settings() { size(300, 300); } void setup() { } void draw() { background(frameCount % 255); fill(0); ellipse(width/2, height/2, width/2, height/2); } } SecondApplet second; void settings() { size(400, 400); } void setup() { second = new SecondApplet(this); } void draw() { background(frameCount % 255); }
http://3846masa.blog.jp/archives/1038375725.html
を参考にprocessingで2画面を用いたプログラムを書きました。
これをmousePressedとif文を使って第一画面をクリックしたら第二画面が起動するようにしたいのですがどのように変更すればよいのかわかりません。
詳しい方がいらっしゃいましたらご教授のほどお願いします。
あなたの回答
tips
プレビュー