-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9f5aeb9
Showing
25 changed files
with
2,263 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
class Button { | ||
float x; | ||
float y; | ||
float sx, sy; | ||
String t; | ||
|
||
Button(float posx, float posy, float sizex, float sizey, String text) { | ||
x = posx; | ||
y = posy; | ||
sx = sizex; | ||
sy = sizey; | ||
t = text; | ||
} | ||
|
||
void update(int i) { | ||
if (mouseX >= x && mouseX <= x+sx && mouseY >= y && mouseY <= y+sy) { | ||
controlb[i] = true; | ||
} else { | ||
controlb[i] = false; | ||
} | ||
if (controlb[i] && mousePressed || buttonpressed[i] ) { // green with black text (activated) | ||
col[0] = 96; | ||
col[1] = 200; | ||
col[2] = 150; | ||
thue = 0; | ||
} else if (controlb[i] && !mousePressed) { // yellow with white text (howered) | ||
col[0] = 40; | ||
col[1] = 200; | ||
col[2] = 180; | ||
thue = 255; | ||
} else if (!controlb[i]) { // red with white text (deactivated) | ||
col[0] = 0; | ||
col[1] = 200; | ||
col[2] = 150; | ||
thue = 255; | ||
} | ||
} | ||
|
||
|
||
void show() { | ||
fill(col[0], col[1], col[2]); | ||
strokeWeight(1); | ||
stroke(255); | ||
rect(x, y, sx, sy); | ||
pushMatrix(); | ||
textSize(font_size); | ||
fill(thue); | ||
text(t, x+font_size*0.5, y+font_size); | ||
popMatrix(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class Dialog { | ||
float x; | ||
float y; | ||
float s; | ||
String t; | ||
int l; | ||
|
||
Dialog(float posx, float posy, float size, String text) { | ||
x = posx; | ||
y = posy; | ||
s = size; | ||
t = text; | ||
} | ||
|
||
void update(String newText) { | ||
t=newText; | ||
l=newText.length(); | ||
} | ||
|
||
void show() { | ||
fill(148, 200, 100); | ||
strokeWeight(1); | ||
stroke(255); | ||
rect(x, y, (l+4)*font_size/2, font_size*1.5); | ||
pushMatrix(); | ||
textSize(font_size); | ||
fill(255); | ||
text(t, x+font_size*0.15+2, y+font_size*1.1); | ||
popMatrix(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
class HatSW { | ||
float x; | ||
float y; | ||
float r; | ||
float R; | ||
|
||
HatSW (float posx, float posy, float radius, float Radius) { | ||
x = posx; | ||
y = posy; | ||
r = radius; | ||
R = Radius; | ||
} | ||
|
||
void update() { | ||
if (gpad.getButton("D pad").pressed()){ | ||
hatvalue = floor(gpad.getButton("D pad").getValue()); | ||
println(hatvalue); | ||
} else { | ||
println(0); | ||
} | ||
} | ||
|
||
void show() { | ||
int hue; | ||
if (gpad.getButton("D pad").pressed()){ | ||
hue = 64; | ||
} else { | ||
hue = 0; | ||
} | ||
stroke(255); | ||
strokeWeight(2); | ||
fill(hue, 255, 255); | ||
ellipse(x, y, r, r); | ||
noFill(); | ||
stroke(255, 200); | ||
ellipse(x, y, R, R); | ||
|
||
} | ||
|
||
void showArrow() { | ||
if (gpad.getButton("D pad").pressed()){ | ||
pushMatrix(); | ||
translate(x, y); | ||
rotate(TWO_PI*hatvalue/8.0+(1.0/2.0)*PI); | ||
beginShape(); | ||
strokeWeight(1); | ||
stroke(255); | ||
fill(144, 255, 255); | ||
int hg = floor(R*0.4); | ||
vertex(-4, hg+0); | ||
vertex(4, hg+0); | ||
vertex(4, hg+5); | ||
vertex(6, hg+5); | ||
vertex(0, hg+12); | ||
vertex(-6, hg+5); | ||
vertex(-4, hg+5); | ||
endShape(); | ||
popMatrix(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
class Dugme { | ||
float x; | ||
float y; | ||
float s; | ||
|
||
Dugme(float posx, float posy, float size) { | ||
x = posx; | ||
y = posy; | ||
s = size; | ||
} | ||
|
||
void update() { | ||
if (gpad.getButton("0").pressed()) { | ||
Button[0] = true; | ||
} else { | ||
Button[0] = false; | ||
} | ||
if (gpad.getButton("1").pressed()) { | ||
Button[1] = true; | ||
} else { | ||
Button[1] = false; | ||
} | ||
if (gpad.getButton("2").pressed()) { | ||
Button[2] = true; | ||
} else { | ||
Button[2] = false; | ||
} | ||
if (gpad.getButton("3").pressed()) { | ||
Button[3] = true; | ||
} else { | ||
Button[3] = false; | ||
} | ||
if (gpad.getButton("4").pressed()) { | ||
Button[4] = true; | ||
} else { | ||
Button[4] = false; | ||
} | ||
if (gpad.getButton("5").pressed()) { | ||
Button[5] = true; | ||
} else { | ||
Button[5] = false; | ||
} | ||
if (gpad.getButton("6").pressed()) { | ||
Button[6] = true; | ||
} else { | ||
Button[6] = false; | ||
} | ||
if (gpad.getButton("7").pressed()) { | ||
Button[7] = true; | ||
} else { | ||
Button[7] = false; | ||
} | ||
if (gpad.getButton("8").pressed()) { | ||
Button[8] = true; | ||
} else { | ||
Button[8] = false; | ||
} | ||
if (gpad.getButton("9").pressed()) { | ||
Button[9] = true; | ||
} else { | ||
Button[9] = false; | ||
} | ||
if (gpad.getButton("10").pressed()) { | ||
Button[10] = true; | ||
} else { | ||
Button[10] = false; | ||
} | ||
if (gpad.getButton("11").pressed()) { | ||
Button[11] = true; | ||
} else { | ||
Button[11] = false; | ||
} | ||
if (gpad.getButton("12").pressed()) { | ||
Button[12] = true; | ||
} else { | ||
Button[12] = false; | ||
} | ||
if (gpad.getButton("13").pressed()) { | ||
Button[13] = true; | ||
} else { | ||
Button[13] = false; | ||
} | ||
if (gpad.getButton("14").pressed()) { | ||
Button[14] = true; | ||
} else { | ||
Button[14] = false; | ||
} | ||
if (gpad.getButton("15").pressed()) { | ||
Button[15] = true; | ||
} else { | ||
Button[15] = false; | ||
} | ||
if (gpad.getButton("16").pressed()) { | ||
Button[16] = true; | ||
} else { | ||
Button[16] = false; | ||
} | ||
if (gpad.getButton("17").pressed()) { | ||
Button[17] = true; | ||
} else { | ||
Button[17] = false; | ||
} | ||
if (gpad.getButton("18").pressed()) { | ||
Button[18] = true; | ||
} else { | ||
Button[18] = false; | ||
} | ||
if (gpad.getButton("19").pressed()) { | ||
Button[19] = true; | ||
} else { | ||
Button[19] = false; | ||
} | ||
if (gpad.getButton("20").pressed()) { | ||
Button[20] = true; | ||
} else { | ||
Button[20] = false; | ||
} | ||
if (gpad.getButton("21").pressed()) { | ||
Button[21] = true; | ||
} else { | ||
Button[21] = false; | ||
} | ||
if (gpad.getButton("22").pressed()) { | ||
Button[22] = true; | ||
} else { | ||
Button[22] = false; | ||
} | ||
if (gpad.getButton("23").pressed()) { | ||
Button[23] = true; | ||
} else { | ||
Button[23] = false; | ||
} | ||
/*if (gpad.getButton("24").pressed()) { | ||
Button[24] = true; | ||
} else { | ||
Button[24] = false; | ||
} | ||
if (gpad.getButton("25").pressed()) { | ||
Button[25] = true; | ||
} else { | ||
Button[25] = false; | ||
} | ||
if (gpad.getButton("26").pressed()) { | ||
Button[26] = true; | ||
} else { | ||
Button[26] = false; | ||
} | ||
if (gpad.getButton("27").pressed()) { | ||
Button[27] = true; | ||
} else { | ||
Button[27] = false; | ||
} | ||
if (gpad.getButton("28").pressed()) { | ||
Button[28] = true; | ||
} else { | ||
Button[28] = false; | ||
} | ||
if (gpad.getButton("29").pressed()) { | ||
Button[29] = true; | ||
} else { | ||
Button[29] = false; | ||
} | ||
if (gpad.getButton("30").pressed()) { | ||
Button[30] = true; | ||
} else { | ||
Button[30] = false; | ||
}*/ | ||
|
||
} | ||
|
||
void show(int i) { | ||
int hue; | ||
if (buttonValue == true) { | ||
hue = 64; | ||
//print(1); | ||
//print(" "); | ||
} else { | ||
hue = 0; | ||
//print(0); | ||
//print(" "); | ||
} | ||
fill(hue, 255, 255); | ||
strokeWeight(1); | ||
stroke(255); | ||
rect(x, y, s, s); | ||
pushMatrix(); | ||
textSize(font_size); | ||
fill(0); | ||
if (i<=9) { | ||
text(i, x+font_size/2, y+font_size*1.2); | ||
} else { | ||
text(i, x+font_size*0.15, y+font_size*1.2); | ||
} | ||
popMatrix(); | ||
} | ||
} |
Oops, something went wrong.