Revisión | 14a7c47a320b0a6db6e024ab0b6103517d09c37a (tree) |
---|---|
Tiempo | 2022-01-30 16:33:48 |
Autor | sebastian_bugiu |
Commiter | sebastian_bugiu |
Increased checkbox size in preferences menu.
@@ -14,6 +14,7 @@ | ||
14 | 14 | import com.badlogic.gdx.scenes.scene2d.ui.TextButton; |
15 | 15 | import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; |
16 | 16 | import com.badlogic.gdx.utils.Align; |
17 | +import com.badlogic.gdx.utils.Scaling; | |
17 | 18 | import com.badlogic.gdx.utils.ScreenUtils; |
18 | 19 | import com.badlogic.gdx.utils.viewport.ScreenViewport; |
19 | 20 |
@@ -45,12 +46,15 @@ | ||
45 | 46 | Skin skin = SpaceRocket.getGame().getSkin(); |
46 | 47 | |
47 | 48 | titleLabel = new Label("Options", skin); |
48 | - soundLabel = new Label("Sound enabled", skin); | |
49 | - vibrationLabel = new Label("Vibration enabled", skin); | |
49 | + soundLabel = new Label("Sound", skin); | |
50 | + vibrationLabel = new Label("Vibration", skin); | |
50 | 51 | accelerometerLabel = new Label("Accelerometer for orientation", skin); |
51 | 52 | shipMovementLabel = new Label("Ship movement type", skin); |
52 | 53 | |
53 | 54 | final CheckBox soundCheckbox = new CheckBox(null, skin); |
55 | + soundCheckbox.getImage().setScaling(Scaling.fill); | |
56 | +// soundCheckbox.setSize(50, 50); | |
57 | + soundCheckbox.getImageCell().size(25); | |
54 | 58 | soundCheckbox.setChecked(Preferences.getInstance().isSoundEnabled()); |
55 | 59 | soundCheckbox.addListener(new EventListener() { |
56 | 60 | @Override |
@@ -61,6 +65,8 @@ | ||
61 | 65 | }); |
62 | 66 | |
63 | 67 | final CheckBox vibrationCheckbox = new CheckBox(null, skin); |
68 | + vibrationCheckbox.getImage().setScaling(Scaling.fill); | |
69 | + vibrationCheckbox.getImageCell().size(25); | |
64 | 70 | vibrationCheckbox.setChecked(Preferences.getInstance().isVibrationEnabled()); |
65 | 71 | vibrationCheckbox.addListener(new EventListener() { |
66 | 72 | @Override |
@@ -98,10 +104,10 @@ | ||
98 | 104 | |
99 | 105 | table.add(titleLabel).colspan(2); |
100 | 106 | table.row().pad(10, 0, 10, 0); |
101 | - table.add(soundLabel).left(); | |
107 | + table.add(soundLabel).left().pad(0, 0, 0, 50); | |
102 | 108 | table.add(soundCheckbox); |
103 | 109 | table.row().pad(10, 0, 10, 0); |
104 | - table.add(vibrationLabel).left(); | |
110 | + table.add(vibrationLabel).left().pad(0, 0, 0, 50); | |
105 | 111 | table.add(vibrationCheckbox); |
106 | 112 | // table.row().pad(10, 0, 10, 0); |
107 | 113 | // table.add(shipMovementLabel).left(); |
@@ -3,6 +3,7 @@ | ||
3 | 3 | import com.badlogic.gdx.audio.Sound; |
4 | 4 | import com.badlogic.gdx.graphics.g2d.TextureAtlas; |
5 | 5 | import com.badlogic.gdx.graphics.g2d.TextureRegion; |
6 | +import com.headwayent.spacerocket.Preferences; | |
6 | 7 | |
7 | 8 | public class ExplosionSprite extends ExtendedSprite { |
8 | 9 | private static final int NUM_FRAMES = 8; |
@@ -18,6 +19,8 @@ | ||
18 | 19 | @Override |
19 | 20 | public void launch(float x, float y) { |
20 | 21 | super.launch(x, y); |
21 | - explosionSnd.play(); | |
22 | + if (Preferences.getInstance().isSoundEnabled()) { | |
23 | + explosionSnd.play(); | |
24 | + } | |
22 | 25 | } |
23 | 26 | } |
@@ -2,5 +2,5 @@ | ||
2 | 2 | app.id=com.headwayent.spacerocket |
3 | 3 | app.mainclass=com.headwayent.spacerocket.IOSLauncher |
4 | 4 | app.executable=IOSLauncher |
5 | -app.build=17 | |
5 | +app.build=18 | |
6 | 6 | app.name=Hotshot 2D |