diff options
| author | ilotterytea <iltsu@alright.party> | 2022-12-03 21:40:46 +0600 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2022-12-03 21:40:46 +0600 |
| commit | 62315d8edabe4e0f0475c6bbbe3d3e2707e235d2 (patch) | |
| tree | c9b49523d7faa94bbfd43be1240d0810a0bc90b3 | |
| parent | 1d31a7adc1969ce0cad0894ec6b68189b16a5bf0 (diff) | |
loading bar
| -rw-r--r-- | assets/sprites/gui/widgets.skin | 14 | ||||
| -rw-r--r-- | core/src/com/ilotterytea/maxoning/screens/SplashScreen.java | 11 |
2 files changed, 23 insertions, 2 deletions
diff --git a/assets/sprites/gui/widgets.skin b/assets/sprites/gui/widgets.skin index fcc3042..345a014 100644 --- a/assets/sprites/gui/widgets.skin +++ b/assets/sprites/gui/widgets.skin @@ -34,6 +34,14 @@ color: { hex: "#ffa61bff" } name: tile }, + gray_tile: { + color: { hex: "#888888" }, + name: tile + }, + green_tile: { + color: { hex: "#00ff00" }, + name: tile + } bgTile02: { color: { hex: "#e98e42ff" } name: tile @@ -82,5 +90,11 @@ default: { background: plain_up } + }, + com.badlogic.gdx.scenes.scene2d.ui.ProgressBar$ProgressBarStyle: { + default-horizontal: { + background: gray_tile, + knobBefore: green_tile + } } }
\ No newline at end of file diff --git a/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java b/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java index e8ea561..de5e1aa 100644 --- a/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java +++ b/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java @@ -5,6 +5,7 @@ import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.ui.Image; +import com.badlogic.gdx.scenes.scene2d.ui.ProgressBar; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.utils.Align; @@ -20,16 +21,18 @@ public class SplashScreen implements Screen { final MaxonGame game; final Stage stage; - final Skin skin; + final Skin skin, widgetSkin; TextureAtlas brandAtlas, envAtlas; Image dev, pub; + ProgressBar bar; public SplashScreen(MaxonGame game) { this.game = game; this.stage = new Stage(new FillViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight())); this.skin = new Skin(Gdx.files.internal("main.skin")); + this.widgetSkin = new Skin(Gdx.files.internal("sprites/gui/widgets.skin")); Table logoTable = new Table(); @@ -44,7 +47,10 @@ public class SplashScreen implements Screen { logoTable.add(pub).size(pub.getWidth() * 5f, pub.getHeight() * 5f).pad(16f).row(); dev = new Image(brandAtlas.findRegion("devOld")); - logoTable.add(dev).size(dev.getWidth() * 5f, dev.getHeight() * 5f); + logoTable.add(dev).size(dev.getWidth() * 5f, dev.getHeight() * 5f).row(); + + bar = new ProgressBar(0f, 100f, 1f, false, widgetSkin); + logoTable.add(bar).size(dev.getWidth() * 5f, 24f); stage.addActor(logoTable); @@ -80,6 +86,7 @@ public class SplashScreen implements Screen { stage.act(delta); update(); + bar.setValue(100f / (game.assetManager.getQueuedAssets() + 1)); } @Override |
