Skip to content

Commit d51f5cb

Browse files
committed
settings menu backgrounds
1 parent b256516 commit d51f5cb

File tree

7 files changed

+41
-23
lines changed

7 files changed

+41
-23
lines changed

src/main/java/project_16x16/Audio.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public final class Audio {
2828
public enum BGM {
2929
TEST0("first_theme.mp3"), // TODO
3030
TEST1("cyberSynthwave.mp3"), // TODO
31-
TEST2("First_level_take_1.mp3"), TEST3("Intro_Title_Pause_Screen_Take1_Loopable.mp3");
31+
TEST2("First_level_take_1.mp3"),
32+
TEST3("Intro_Title_Pause_Screen_Take1_Loopable.mp3");
3233

3334
private String filename;
3435

src/main/java/project_16x16/SideScroller.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ public void keyPressed(processing.event.KeyEvent event) {
331331
* keyReleased decides if the key pressed is valid and if it is then removes it
332332
* from the keys ArrayList and keyReleaseEvent flag is set.
333333
*
334-
* FOR GLOBAL KEYS ONLY
334+
* FOR GLOBAL KEYS ONLY (dev tools mostly for now...)
335335
*/
336336
@Override
337337
public void keyReleased(processing.event.KeyEvent event) {

src/main/java/project_16x16/scene/AudioSettings.java

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,36 @@ public AudioSettings(SideScroller a) {
5151
volumeSFX = new Slider(game, 0.75f);
5252
volumeSFX.setText("SFX");
5353
volumeSFX.setPosition(a.width / 2, 350);
54-
54+
5555
}
5656

5757
@Override
5858
public void switchTo() {
5959
originalVolumeBGM = Options.gainBGM;
6060
originalVolumeSFX = Options.gainSFX;
6161
// TODO properly align audio value and slider position
62-
//volumeBGM.setValue(PApplet.map(originalVolumeBGM, -60, 0, 0, 1));
63-
//volumeSFX.setValue(PApplet.map(originalVolumeSFX, -60, 0, 0, 1));
62+
// volumeBGM.setValue(PApplet.map(originalVolumeBGM, -60, 0, 0, 1));
63+
// volumeSFX.setValue(PApplet.map(originalVolumeSFX, -60, 0, 0, 1));
6464
super.switchTo();
6565
}
6666

6767
@Override
6868
public void drawUI() {
69-
game.background(Constants.Colors.MENU_GREY);
69+
displayWindow();
7070
apply.display();
7171
quit.display();
7272
volumeBGM.display();
7373
volumeSFX.display();
74-
74+
75+
}
76+
77+
private void displayWindow() {
78+
background(19, 23, 35);
79+
applet.fill(29, 33, 45);
80+
applet.stroke(47, 54, 73);
81+
applet.strokeWeight(8);
82+
applet.rect(applet.gameResolution.x / 2, applet.gameResolution.y / 2, applet.gameResolution.x * 0.66f - 8,
83+
applet.gameResolution.y - 8);
7584
}
7685

7786
@Override
@@ -112,10 +121,10 @@ void mouseReleased(MouseEvent e) {
112121
@Override
113122
void keyReleased(KeyEvent e) {
114123
switch (e.getKeyCode()) {
115-
case PConstants.ESC : // Pause
124+
case PConstants.ESC: // Pause
116125
game.returnScene();
117126
break;
118-
default :
127+
default:
119128
break;
120129
}
121130
}

src/main/java/project_16x16/scene/ControlsSettings.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void switchTo() {
8484

8585
@Override
8686
public void drawUI() {
87-
game.background(Constants.Colors.MENU_GREY);
87+
displayWindow();
8888
apply.display();
8989
quit.display();
9090

@@ -99,6 +99,15 @@ public void drawUI() {
9999
game.text("Press a key to change the control!", game.width / 2, 100);
100100
}
101101
}
102+
103+
private void displayWindow() {
104+
background(19, 23, 35);
105+
applet.fill(29, 33, 45);
106+
applet.stroke(47, 54, 73);
107+
applet.strokeWeight(8);
108+
applet.rect(applet.gameResolution.x / 2, applet.gameResolution.y / 2, applet.gameResolution.x * 0.66f - 8,
109+
applet.gameResolution.y - 8);
110+
}
102111

103112
@Override
104113
void mouseReleased(MouseEvent e) {

src/main/java/project_16x16/scene/GraphicsSettings.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
package project_16x16.scene;
22

3-
import processing.core.PApplet;
43
import processing.core.PConstants;
54
import processing.event.KeyEvent;
65
import processing.event.MouseEvent;
7-
import project_16x16.Audio;
8-
import project_16x16.Constants;
9-
import project_16x16.Options;
10-
import project_16x16.Options.Option;
116
import project_16x16.SideScroller;
127
import project_16x16.ui.Button;
138
import project_16x16.ui.Notifications;
14-
import project_16x16.ui.Slider;
159

1610
public final class GraphicsSettings extends PScene {
1711

@@ -37,18 +31,23 @@ public GraphicsSettings(SideScroller a) {
3731

3832
@Override
3933
public void switchTo() {
40-
// TODO properly align audio value and slider position
41-
//volumeBGM.setValue(PApplet.map(originalVolumeBGM, -60, 0, 0, 1));
42-
//volumeSFX.setValue(PApplet.map(originalVolumeSFX, -60, 0, 0, 1));
4334
super.switchTo();
4435
}
4536

4637
@Override
4738
public void drawUI() {
48-
game.background(Constants.Colors.MENU_GREY);
39+
displayWindow();
4940
apply.display();
5041
quit.display();
51-
42+
}
43+
44+
private void displayWindow() {
45+
background(19, 23, 35);
46+
applet.fill(29, 33, 45);
47+
applet.stroke(47, 54, 73);
48+
applet.strokeWeight(8);
49+
applet.rect(applet.gameResolution.x / 2, applet.gameResolution.y / 2, applet.gameResolution.x * 0.66f - 8,
50+
applet.gameResolution.y - 8);
5251
}
5352

5453
@Override

src/main/java/project_16x16/scene/MainMenu.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public final class MainMenu extends PScene {
2727

2828
public Button pressStart;
2929
public Button pressQuit;
30-
public Button pressSettings; // TODO add settings menu
30+
public Button pressSettings;
3131
public Button pressMultiplayer;
3232

3333
private SideScroller game;

src/main/java/project_16x16/scene/Settings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void drawUI() {
7474
applet.fill(255);
7575
applet.textSize(60);
7676
applet.textAlign(CENTER, TOP);
77-
applet.text("Options", applet.gameResolution.x / 2, 20);
77+
applet.text("Settings", applet.gameResolution.x / 2, 20);
7878

7979
quit.display();
8080
apply.display();

0 commit comments

Comments
 (0)