summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/sprites/gui/friends.atlas44
-rw-r--r--assets/sprites/gui/friends.pngbin231189 -> 4154781 bytes
-rw-r--r--assets/sprites/gui/ui.skin14
-rw-r--r--assets/sprites/gui/widgets.atlas18
-rw-r--r--assets/sprites/gui/widgets.pngbin36352 -> 722507 bytes
-rw-r--r--core/src/kz/ilotterytea/maxon/screens/MenuScreen.java34
-rw-r--r--core/src/kz/ilotterytea/maxon/screens/game/GameScreen.java9
-rw-r--r--core/src/kz/ilotterytea/maxon/ui/game/QuickActionsTable.kt25
8 files changed, 93 insertions, 51 deletions
diff --git a/assets/sprites/gui/friends.atlas b/assets/sprites/gui/friends.atlas
index 09bead0..a4b52b8 100644
--- a/assets/sprites/gui/friends.atlas
+++ b/assets/sprites/gui/friends.atlas
@@ -1,45 +1,45 @@
friends.png
-size:512,256
+size:2048,2048
repeat:none
4elovekkun
-bounds:192,128,64,64
+bounds:960,1280,320,320
Art5507
-bounds:256,192,64,64
+bounds:1280,1600,320,320
GigovichGig
-bounds:256,0,64,64
+bounds:1600,1600,320,320
GreDDySS
-bounds:192,64,64,64
+bounds:0,0,320,320
Gvardovskiy
-bounds:64,128,64,64
+bounds:0,640,320,320
IIReZortII
-bounds:128,0,64,64
+bounds:640,960,320,320
NameIsNamesake
-bounds:128,192,64,64
+bounds:640,1600,320,320
drt_s_s
-bounds:0,64,64,64
+bounds:0,960,320,320
enotEGG_
-bounds:192,0,64,64
+bounds:320,320,320,320
felugoz
-bounds:64,192,64,64
+bounds:320,1600,320,320
iQweep
-bounds:64,64,64,64
+bounds:0,320,320,320
ilotterytea
-bounds:0,192,64,64
+bounds:0,1600,320,320
m4x0nn
-bounds:0,128,64,64
+bounds:0,1280,320,320
neizyum
-bounds:128,128,64,64
+bounds:960,1600,320,320
rbch20
-bounds:0,0,64,64
+bounds:320,1280,320,320
rey_ron_ro
-bounds:128,64,64,64
+bounds:320,640,320,320
saopin_
-bounds:64,0,64,64
+bounds:640,1280,320,320
shvedoff__
-bounds:256,128,64,64
+bounds:640,640,320,320
usatiy_
-bounds:320,192,64,64
+bounds:960,960,320,320
vexenigmus
-bounds:192,192,64,64
+bounds:320,960,320,320
wanderning_
-bounds:256,64,64,64
+bounds:1280,1280,320,320
diff --git a/assets/sprites/gui/friends.png b/assets/sprites/gui/friends.png
index 78c7c23..f1972e5 100644
--- a/assets/sprites/gui/friends.png
+++ b/assets/sprites/gui/friends.png
Binary files differ
diff --git a/assets/sprites/gui/ui.skin b/assets/sprites/gui/ui.skin
index dbdeb79..2ff8039 100644
--- a/assets/sprites/gui/ui.skin
+++ b/assets/sprites/gui/ui.skin
@@ -97,6 +97,10 @@
credits: {
file: fnt/FontText.fnt,
scaledSize: 16
+ },
+ credits_mobile: {
+ file: fnt/FontText.fnt,
+ scaledSize: 32
}
},
com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: {
@@ -213,10 +217,18 @@
font: credits,
fontColor: white
},
+ credits_name_mobile: {
+ parent: credits_name,
+ font: credits_mobile,
+ },
credits_role: {
font: credits,
fontColor: yellow
- }
+ },
+ credits_role_mobile: {
+ parent: credits_role,
+ font: credits_mobile,
+ },
},
com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: {
default: {
diff --git a/assets/sprites/gui/widgets.atlas b/assets/sprites/gui/widgets.atlas
index 84d26de..de95ae8 100644
--- a/assets/sprites/gui/widgets.atlas
+++ b/assets/sprites/gui/widgets.atlas
@@ -1,19 +1,19 @@
widgets.png
-size:256,256
+size:1024,1024
repeat:none
exit
-bounds:64,64,64,64
+bounds:640,0,320,320
fullscreen
-bounds:0,0,64,64
+bounds:320,320,320,320
locale_en
-bounds:87,192,64,64
+bounds:0,320,320,320
locale_ru
-bounds:0,64,64,64
+bounds:0,0,320,320
music_off
-bounds:0,192,87,64
+bounds:0,640,435,320
music_on
-bounds:0,128,79,64
+bounds:435,640,395,320
slots
-bounds:151,192,64,64
+bounds:640,320,320,320
windowed
-bounds:79,128,64,64
+bounds:320,0,320,320
diff --git a/assets/sprites/gui/widgets.png b/assets/sprites/gui/widgets.png
index 96221a7..12be9a4 100644
--- a/assets/sprites/gui/widgets.png
+++ b/assets/sprites/gui/widgets.png
Binary files differ
diff --git a/core/src/kz/ilotterytea/maxon/screens/MenuScreen.java b/core/src/kz/ilotterytea/maxon/screens/MenuScreen.java
index 0998cb2..2e1fe1f 100644
--- a/core/src/kz/ilotterytea/maxon/screens/MenuScreen.java
+++ b/core/src/kz/ilotterytea/maxon/screens/MenuScreen.java
@@ -76,6 +76,8 @@ public class MenuScreen implements Screen {
soundVolume = game.prefs.getInteger("sfx", 10) / 10f;
// - - - - - - U I - - - - - -
+ float iconSize = OsUtils.isMobile ? 256f : 64f;
+
Table menuTable = new Table();
menuTable.setFillParent(true);
@@ -173,6 +175,7 @@ public class MenuScreen implements Screen {
leftGameControlTable.align(Align.left);
ShakingImageButton quitButton = new ShakingImageButton(widgetSkin, "exit");
+ quitButton.setOrigin(iconSize / 2f, iconSize / 2f);
quitButton.addListener(new ClickListener() {
@Override
@@ -183,7 +186,7 @@ public class MenuScreen implements Screen {
}
});
- leftGameControlTable.add(quitButton).padRight(12f);
+ leftGameControlTable.add(quitButton).size(iconSize).padRight(12f);
// Right part of menu control
Table rightGameControlTable = new Table();
@@ -197,6 +200,7 @@ public class MenuScreen implements Screen {
String[] fh4Locale = game.getLocale().getHandle().nameWithoutExtension().split("_");
String localeButtonStyleName = "locale_" + fh4Locale[0];
ShakingImageButton localeButton = new ShakingImageButton(widgetSkin, localeButtonStyleName);
+ localeButton.setOrigin(iconSize / 2f, iconSize / 2f);
localeButton.addListener(new ClickListener() {
@Override
@@ -236,6 +240,7 @@ public class MenuScreen implements Screen {
}
ShakingImageButton musicButton = new ShakingImageButton(widgetSkin, musicButtonStyleName);
+ musicButton.setOrigin(iconSize / 2f, iconSize / 2f);
musicButton.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
@@ -266,8 +271,8 @@ public class MenuScreen implements Screen {
});
if (!OsUtils.isMobile) {
- rightGameControlTable.add(localeButton).padRight(16f);
- rightGameControlTable.add(musicButton).padRight(16f);
+ rightGameControlTable.add(localeButton).size(iconSize).padRight(16f);
+ rightGameControlTable.add(musicButton).size(iconSize).padRight(16f);
// Resolution button
String resolutionButtonStyleName;
@@ -279,6 +284,7 @@ public class MenuScreen implements Screen {
}
ShakingImageButton resolutionButton = new ShakingImageButton(widgetSkin, resolutionButtonStyleName);
+ resolutionButton.setOrigin(iconSize / 2f, iconSize / 2f);
resolutionButton.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
@@ -301,12 +307,12 @@ public class MenuScreen implements Screen {
clickSound.play(soundVolume);
}
});
- rightGameControlTable.add(resolutionButton);
+ rightGameControlTable.add(resolutionButton).size(iconSize);
controlTable.add(leftGameControlTable).grow();
} else {
- rightGameControlTable.add(localeButton).expand();
- rightGameControlTable.add(musicButton).expand();
+ rightGameControlTable.add(localeButton).size(iconSize).expand();
+ rightGameControlTable.add(musicButton).size(iconSize).expand();
}
controlTable.add(rightGameControlTable).grow();
@@ -530,6 +536,8 @@ public class MenuScreen implements Screen {
}
private void openCredits() {
+ String labelStyleName = OsUtils.isMobile ? "defaultMobile" : "default";
+
Image bgTint = new Image(uiSkin, "halftransparentblack");
bgTint.setFillParent(true);
stage.addActor(bgTint);
@@ -559,11 +567,11 @@ public class MenuScreen implements Screen {
window.add(titleTable).growX().row();
// Title
- Label titleLabel = new Label(game.getLocale().getLine(LineId.CreditsTitle), uiSkin);
+ Label titleLabel = new Label(game.getLocale().getLine(LineId.CreditsTitle), uiSkin, labelStyleName);
titleTable.add(titleLabel).pad(8f, 16f, 8f, 16f).growX();
// Close button
- TextButton closeButton = new TextButton(" X ", uiSkin);
+ TextButton closeButton = new TextButton(" X ", uiSkin, labelStyleName);
closeButton.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
@@ -601,13 +609,13 @@ public class MenuScreen implements Screen {
contributorTable.add(widget).padBottom(16f);
// Name
- Label name = new Label(contributor.getFirst(), uiSkin, "credits_name");
+ Label name = new Label(contributor.getFirst(), uiSkin, OsUtils.isMobile ? "credits_name_mobile" : "credits_name");
name.setAlignment(Align.center);
widget.add(name).grow().padBottom(8f).row();
// Icon
Image icon = new Image(friendSkin.getDrawable(contributor.getFirst()));
- widget.add(icon).padBottom(8f).row();
+ widget.add(icon).size(OsUtils.isMobile ? 128f : 64f).padBottom(8f).row();
// Role
LineId id = switch (contributor.getThird()) {
@@ -620,7 +628,7 @@ public class MenuScreen implements Screen {
default -> LineId.CreditsMaxon;
};
- Label role = new Label(game.getLocale().getLine(id), uiSkin, "credits_role");
+ Label role = new Label(game.getLocale().getLine(id), uiSkin, OsUtils.isMobile ? "credits_role_mobile" : "credits_role");
role.setAlignment(Align.center);
widget.add(role).grow().row();
@@ -632,7 +640,7 @@ public class MenuScreen implements Screen {
engineCredits.setBackground("bg2");
window.add(engineCredits).growX().row();
- Label engineLabel = new Label("Made with", uiSkin);
+ Label engineLabel = new Label("Made with", uiSkin, labelStyleName);
engineCredits.add(engineLabel).padRight(16f);
TextureAtlas brandAtlas = game.assetManager.get("sprites/gui/brand.atlas");
@@ -645,6 +653,6 @@ public class MenuScreen implements Screen {
clickSound.play(soundVolume);
}
});
- engineCredits.add(engineImage).height(32f).width(180f);
+ engineCredits.add(engineImage).height(OsUtils.isMobile ? 64f : 32f).width(OsUtils.isMobile ? 360f : 180f);
}
}
diff --git a/core/src/kz/ilotterytea/maxon/screens/game/GameScreen.java b/core/src/kz/ilotterytea/maxon/screens/game/GameScreen.java
index 16d75b0..5b79473 100644
--- a/core/src/kz/ilotterytea/maxon/screens/game/GameScreen.java
+++ b/core/src/kz/ilotterytea/maxon/screens/game/GameScreen.java
@@ -13,6 +13,7 @@ import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.*;
+import com.badlogic.gdx.utils.Align;
import com.badlogic.gdx.utils.Timer;
import com.badlogic.gdx.utils.viewport.ScreenViewport;
import kz.ilotterytea.maxon.MaxonGame;
@@ -341,7 +342,13 @@ public class GameScreen implements Screen, InputProcessor {
DebugWidget debugWidget = new DebugWidget(uiSkin);
this.stage.addActor(debugWidget);
- this.stage.addActor(new QuickActionsTable(this.game.assetManager.get("sprites/gui/widgets.skin", Skin.class)));
+ QuickActionsTable quickActionsTable = new QuickActionsTable(this.game.assetManager.get("sprites/gui/widgets.skin", Skin.class), uiSkin);
+ if (OsUtils.isMobile) {
+ quickActionsTable.setFillParent(true);
+ quickActionsTable.align(Align.bottom);
+ }
+
+ this.stage.addActor(quickActionsTable);
}
@Override
diff --git a/core/src/kz/ilotterytea/maxon/ui/game/QuickActionsTable.kt b/core/src/kz/ilotterytea/maxon/ui/game/QuickActionsTable.kt
index c8c0eef..b2315c1 100644
--- a/core/src/kz/ilotterytea/maxon/ui/game/QuickActionsTable.kt
+++ b/core/src/kz/ilotterytea/maxon/ui/game/QuickActionsTable.kt
@@ -12,14 +12,21 @@ import kz.ilotterytea.maxon.MaxonGame
import kz.ilotterytea.maxon.screens.MenuScreen
import kz.ilotterytea.maxon.screens.SlotsMinigameScreen
import kz.ilotterytea.maxon.ui.ShakingImageButton
+import kz.ilotterytea.maxon.utils.OsUtils
-class QuickActionsTable(skin: Skin) : Table() {
+class QuickActionsTable(widgetSkin: Skin, uiSkin: Skin) : Table(uiSkin) {
init {
val game = MaxonGame.getInstance()
val clickSound = game.assetManager.get("sfx/ui/click.ogg", Sound::class.java)
val soundVolume = game.prefs.getInteger("sfx", 10) / 10f
+ val iconSize = if (OsUtils.isMobile) {
+ 256f
+ } else {
+ 64f
+ }
- val slotsButton = ShakingImageButton(skin, "slots")
+ val slotsButton = ShakingImageButton(widgetSkin, "slots")
+ slotsButton.setOrigin(iconSize / 2f, iconSize / 2f)
slotsButton.addListener(object : ClickListener() {
override fun clicked(event: InputEvent, x: Float, y: Float) {
super.clicked(event, x, y)
@@ -27,9 +34,10 @@ class QuickActionsTable(skin: Skin) : Table() {
game.screen = SlotsMinigameScreen()
}
})
- add(slotsButton).height(64f).width(64f).padRight(8f)
+ val slotsCell = add(slotsButton).size(iconSize).padRight(8f)
- val quitButton = ShakingImageButton(skin, "exit")
+ val quitButton = ShakingImageButton(widgetSkin, "exit")
+ quitButton.setOrigin(iconSize / 2f, iconSize / 2f)
quitButton.addListener(object : ClickListener() {
override fun clicked(event: InputEvent, x: Float, y: Float) {
super.clicked(event, x, y)
@@ -37,12 +45,19 @@ class QuickActionsTable(skin: Skin) : Table() {
game.screen = MenuScreen()
}
})
- add(quitButton).height(64f).width(64f)
+ val quitCell = add(quitButton).size(iconSize)
+
+ if (OsUtils.isMobile) {
+ slotsCell.expandX()
+ quitCell.expandX()
+ }
}
override fun draw(batch: Batch?, parentAlpha: Float) {
super.draw(batch, parentAlpha)
+ if (OsUtils.isMobile) return
+
// i'm not sure how much does it affect on performance
setX(Gdx.graphics.width - 36f * 2f, Align.left)
setY(Gdx.graphics.height - 36f, Align.top)