diff --git a/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScrollScreenAdapter.java b/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/AbstractScrollScreen.java similarity index 84% rename from demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScrollScreenAdapter.java rename to demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/AbstractScrollScreen.java index 4812c653..c5d2de4e 100644 --- a/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScrollScreenAdapter.java +++ b/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/AbstractScrollScreen.java @@ -11,7 +11,7 @@ import love.distributedrebirth.gdxapp.Demo4DMain; import love.distributedrebirth.gdxapp.Demo4DMainAdapter; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") -abstract public class ScrollScreenAdapter extends Demo4DMainAdapter { +abstract public class AbstractScrollScreen extends Demo4DMainAdapter { private static final int LINE_HEIGHT = 16; private float scrollDeltaTime = 0f; private String scrollText = ""; @@ -19,7 +19,7 @@ abstract public class ScrollScreenAdapter extends Demo4DMainAdapter { private int scrollLine = LINE_HEIGHT; private final Texture backgroundImage; - public ScrollScreenAdapter(final Demo4DMain main, String background) { + public AbstractScrollScreen(final Demo4DMain main, String background) { super(main); backgroundImage = new Texture(Gdx.files.internal(background)); } @@ -64,19 +64,30 @@ abstract public class ScrollScreenAdapter extends Demo4DMainAdapter { } @Override - public void hide() { + public final void show() { + showScroll(); + } + + protected void showScroll() { + } + + @Override + public final void hide() { scrollText = ""; scrollIndex = 0; scrollLine = LINE_HEIGHT; + hideScroll(); } - + + protected void hideScroll() { + } + @Override public final void dispose() { backgroundImage.dispose(); - disposeScreen(main); + disposeScroll(); } - protected void disposeScreen(Demo4DMain main) { - // override if needed + protected void disposeScroll() { } } diff --git a/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenCredits.java b/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenCredits.java index d50788d9..8bb9457f 100644 --- a/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenCredits.java +++ b/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenCredits.java @@ -7,7 +7,7 @@ import love.distributedrebirth.gdxapp.Demo4DMain; import love.distributedrebirth.gdxapp.music.MusicSongType; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") -public class ScreenCredits extends ScrollScreenAdapter { +public class ScreenCredits extends AbstractScrollScreen { private final String creditsText = String.join("\n", "Credits;", "At-Ohm-Allah-to-the-power-of-Four", @@ -78,12 +78,12 @@ public class ScreenCredits extends ScrollScreenAdapter { } @Override - public void show () { + public void showScroll() { main.music.play(MusicSongType.CREDITS); } @Override - public void hide () { + public void hideScroll() { main.music.play(MusicSongType.BACKGROUND); } } diff --git a/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenHelp.java b/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenHelp.java index d2771df2..5e0d7d43 100644 --- a/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenHelp.java +++ b/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenHelp.java @@ -7,7 +7,7 @@ import love.distributedrebirth.gdxapp.Demo4DMain; import love.distributedrebirth.gdxapp.music.MusicSongType; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") -public class ScreenHelp extends ScrollScreenAdapter { +public class ScreenHelp extends AbstractScrollScreen { private final String creditsText = String.join("\n", "Genesis 11", " ", @@ -61,12 +61,12 @@ public class ScreenHelp extends ScrollScreenAdapter { } @Override - public void show () { + public void showScroll() { main.music.play(MusicSongType.INTRO); } @Override - public void hide () { + public void hideScroll() { main.music.play(MusicSongType.BACKGROUND); } } diff --git a/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenIntroMission.java b/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenIntroMission.java index 1feb810c..c259ed24 100644 --- a/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenIntroMission.java +++ b/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/ScreenIntroMission.java @@ -7,7 +7,7 @@ import love.distributedrebirth.gdxapp.Demo4DMain; import love.distributedrebirth.gdxapp.music.MusicSongType; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") -public class ScreenIntroMission extends ScrollScreenAdapter { +public class ScreenIntroMission extends AbstractScrollScreen { private final String missionText = String.join("\n", "To a Waterfowl", " -- by William Cullen Bryant --", @@ -71,7 +71,7 @@ public class ScreenIntroMission extends ScrollScreenAdapter { } @Override - public void hide () { + public void hideScroll() { main.music.play(MusicSongType.BACKGROUND); } }