Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
41 lines (33 sloc) 785 Bytes
using UnityEngine;
using System.Collections;
using uP5;
public class Dialog : uProcessing {
bool isDispDialog = false;
protected override void setup() {
size(200 * displayAspectW, 200, P2D);
}
protected override void draw() {
background(128);
uiColor(Color.black, Color.red);
layer2D();
noRecycle();
if(isDispDialog) {
switch(dialog("メニューに戻りますか?", "OK", "Cancel")) {
case UIResponse.OK:
loadScene("Menu");
break;
case UIResponse.CANCEL:
isDispDialog = false;
break;
}
} else {
if(button("OpenDialog", width / 4, height / 4, width / 2, 30)) {
isDispDialog = true;
}
}
recycle();
}
protected override void onKeyTyped() {
if(key == ESC || key == 'q') { loadScene("ListView"); }
}
}