summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/main/java/kz/ilotterytea/frogartha/screens/SplashScreen.java22
1 files changed, 10 insertions, 12 deletions
diff --git a/core/src/main/java/kz/ilotterytea/frogartha/screens/SplashScreen.java b/core/src/main/java/kz/ilotterytea/frogartha/screens/SplashScreen.java
index 4d6ae7c..39771ed 100644
--- a/core/src/main/java/kz/ilotterytea/frogartha/screens/SplashScreen.java
+++ b/core/src/main/java/kz/ilotterytea/frogartha/screens/SplashScreen.java
@@ -1,10 +1,10 @@
package kz.ilotterytea.frogartha.screens;
+import com.badlogic.gdx.Application;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
-import com.badlogic.gdx.scenes.scene2d.Action;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.actions.Actions;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
@@ -62,17 +62,15 @@ public class SplashScreen implements Screen {
stage.draw();
if (game.getAssetManager().update() && !areAssetsLoaded) {
- table.addAction(Actions.sequence(
- Actions.alpha(1f, 1f),
- Actions.alpha(0f, 1f),
- new Action() {
- @Override
- public boolean act(float v) {
- game.setScreen(new MenuScreen());
- return false;
- }
- }
- ));
+ if (Gdx.app.getType() == Application.ApplicationType.WebGL) {
+ game.setScreen(new MenuScreen());
+ } else {
+ table.addAction(Actions.sequence(
+ Actions.alpha(1f, 1f),
+ Actions.alpha(0f, 1f),
+ Actions.run(() -> game.setScreen(new MenuScreen()))
+ ));
+ }
areAssetsLoaded = true;
}
}