diff --git a/core/assets/common/screen/gamemenu/bankovniloupez_back.png b/core/assets/common/screen/gamemenu/bankovniloupez_back.png new file mode 100644 index 0000000000000000000000000000000000000000..d9d3c637e1255f67af94b207b0d9fd6883fb4772 Binary files /dev/null and b/core/assets/common/screen/gamemenu/bankovniloupez_back.png differ diff --git a/core/assets/common/screen/gamemenu/bankovniloupez_fore.png b/core/assets/common/screen/gamemenu/bankovniloupez_fore.png new file mode 100644 index 0000000000000000000000000000000000000000..59057615e33af54d54e6b28fd18da85c705a9b00 Binary files /dev/null and b/core/assets/common/screen/gamemenu/bankovniloupez_fore.png differ diff --git a/core/assets/common/screen/gamemenu/bankovniloupez_mid.png b/core/assets/common/screen/gamemenu/bankovniloupez_mid.png new file mode 100644 index 0000000000000000000000000000000000000000..74775e68cb0df75051b39285e3c386e53348c2d9 Binary files /dev/null and b/core/assets/common/screen/gamemenu/bankovniloupez_mid.png differ diff --git a/core/assets/common/screen/gamemenu/clickablemap.png b/core/assets/common/screen/gamemenu/clickablemap.png new file mode 100644 index 0000000000000000000000000000000000000000..73f656ead93ad3c7254dc2c462595db870ec2547 Binary files /dev/null and b/core/assets/common/screen/gamemenu/clickablemap.png differ diff --git a/core/assets/common/screen/gamemenu/desk.png b/core/assets/common/screen/gamemenu/desk.png new file mode 100644 index 0000000000000000000000000000000000000000..38fc8f00f6ac77a0aa08429bc99265a755f6a251 Binary files /dev/null and b/core/assets/common/screen/gamemenu/desk.png differ diff --git a/core/assets/common/screen/gamemenu/difficultyseekbar_background.png b/core/assets/common/screen/gamemenu/difficultyseekbar_background.png new file mode 100644 index 0000000000000000000000000000000000000000..e1d041a849ed53819e103ebcbf1e5204a3e79249 Binary files /dev/null and b/core/assets/common/screen/gamemenu/difficultyseekbar_background.png differ diff --git a/core/assets/common/screen/gamemenu/difficultyseekbar_thumb.png b/core/assets/common/screen/gamemenu/difficultyseekbar_thumb.png new file mode 100644 index 0000000000000000000000000000000000000000..84637dbdd975ba3dc1970372cb42a4cf778bb281 Binary files /dev/null and b/core/assets/common/screen/gamemenu/difficultyseekbar_thumb.png differ diff --git a/core/assets/common/screen/gamemenu/difficultyseekbar_thumb_easy.png b/core/assets/common/screen/gamemenu/difficultyseekbar_thumb_easy.png new file mode 100644 index 0000000000000000000000000000000000000000..c28f25ec3b430b7adc0ce29eb6dba44fa790b2b5 Binary files /dev/null and b/core/assets/common/screen/gamemenu/difficultyseekbar_thumb_easy.png differ diff --git a/core/assets/common/screen/gamemenu/difficultyseekbar_thumb_hard.png b/core/assets/common/screen/gamemenu/difficultyseekbar_thumb_hard.png new file mode 100644 index 0000000000000000000000000000000000000000..d77974303da7325a8b60b7427e33dd5905b6295b Binary files /dev/null and b/core/assets/common/screen/gamemenu/difficultyseekbar_thumb_hard.png differ diff --git a/core/assets/common/screen/gamemenu/difficultyseekbar_thumb_medium.png b/core/assets/common/screen/gamemenu/difficultyseekbar_thumb_medium.png new file mode 100644 index 0000000000000000000000000000000000000000..cb167c4d9371c20def7c9ba895b50881e107df5b Binary files /dev/null and b/core/assets/common/screen/gamemenu/difficultyseekbar_thumb_medium.png differ diff --git a/core/assets/common/screen/gamemenu/encyclopedia_pressed.png b/core/assets/common/screen/gamemenu/encyclopedia_pressed.png new file mode 100644 index 0000000000000000000000000000000000000000..74db6065095ddb394f41fbea5dbd6776d5f9c2b4 Binary files /dev/null and b/core/assets/common/screen/gamemenu/encyclopedia_pressed.png differ diff --git a/core/assets/common/screen/gamemenu/halloffame_pressed.png b/core/assets/common/screen/gamemenu/halloffame_pressed.png new file mode 100644 index 0000000000000000000000000000000000000000..2b3f290191f25e8c2b6d15267c1e3be3e70396b3 Binary files /dev/null and b/core/assets/common/screen/gamemenu/halloffame_pressed.png differ diff --git a/core/assets/common/screen/gamemenu/helpbutton_pressed.png b/core/assets/common/screen/gamemenu/helpbutton_pressed.png new file mode 100644 index 0000000000000000000000000000000000000000..5d64dd431a759b34179623c5c3896fec12b2829a Binary files /dev/null and b/core/assets/common/screen/gamemenu/helpbutton_pressed.png differ diff --git a/core/assets/common/screen/gamemenu/helpbutton_unpressed.png b/core/assets/common/screen/gamemenu/helpbutton_unpressed.png new file mode 100644 index 0000000000000000000000000000000000000000..66c6fc7a9f0789f4c74311743a1f35580aadd60e Binary files /dev/null and b/core/assets/common/screen/gamemenu/helpbutton_unpressed.png differ diff --git a/core/assets/common/screen/gamemenu/helplayer_clickablemap.png b/core/assets/common/screen/gamemenu/helplayer_clickablemap.png new file mode 100644 index 0000000000000000000000000000000000000000..4f4734cfbc95dfaccac0341bcef4d8e70056a4aa Binary files /dev/null and b/core/assets/common/screen/gamemenu/helplayer_clickablemap.png differ diff --git a/core/assets/common/screen/gamemenu/nocnisledovani_back.png b/core/assets/common/screen/gamemenu/nocnisledovani_back.png new file mode 100644 index 0000000000000000000000000000000000000000..663b9c0d5236dfe49b6090a53b9a8ac8d4e27bed Binary files /dev/null and b/core/assets/common/screen/gamemenu/nocnisledovani_back.png differ diff --git a/core/assets/common/screen/gamemenu/nocnisledovani_fore.png b/core/assets/common/screen/gamemenu/nocnisledovani_fore.png new file mode 100644 index 0000000000000000000000000000000000000000..4f3727508f0cbef101f675d490ede92f8d4911c6 Binary files /dev/null and b/core/assets/common/screen/gamemenu/nocnisledovani_fore.png differ diff --git a/core/assets/common/screen/gamemenu/nocnisledovani_mid.png b/core/assets/common/screen/gamemenu/nocnisledovani_mid.png new file mode 100644 index 0000000000000000000000000000000000000000..c2ec630adcf5a9dbf548fd17a0e3096b26ff1625 Binary files /dev/null and b/core/assets/common/screen/gamemenu/nocnisledovani_mid.png differ diff --git a/core/assets/common/screen/gamemenu/potme_back.png b/core/assets/common/screen/gamemenu/potme_back.png new file mode 100644 index 0000000000000000000000000000000000000000..6eabf1d99e7bed3f680584bb6fbfadae3a538e70 Binary files /dev/null and b/core/assets/common/screen/gamemenu/potme_back.png differ diff --git a/core/assets/common/screen/gamemenu/potme_fore.png b/core/assets/common/screen/gamemenu/potme_fore.png new file mode 100644 index 0000000000000000000000000000000000000000..723044ed2001fd145670b2b415cd5b414f4dfbf5 Binary files /dev/null and b/core/assets/common/screen/gamemenu/potme_fore.png differ diff --git a/core/assets/common/screen/gamemenu/potme_mid.png b/core/assets/common/screen/gamemenu/potme_mid.png new file mode 100644 index 0000000000000000000000000000000000000000..017bffca99d67c5d5f5c96948a1d3dbe1620d71b Binary files /dev/null and b/core/assets/common/screen/gamemenu/potme_mid.png differ diff --git a/core/assets/common/screen/gamemenu/profile_pressed.png b/core/assets/common/screen/gamemenu/profile_pressed.png new file mode 100644 index 0000000000000000000000000000000000000000..2c2e54e9b36f299988c011522fdb55e61e607e25 Binary files /dev/null and b/core/assets/common/screen/gamemenu/profile_pressed.png differ diff --git a/core/assets/common/screen/gamemenu/pronasledovani_back.png b/core/assets/common/screen/gamemenu/pronasledovani_back.png new file mode 100644 index 0000000000000000000000000000000000000000..cf8a55f8c84d57c0120a450fbf5b4260b71c9299 Binary files /dev/null and b/core/assets/common/screen/gamemenu/pronasledovani_back.png differ diff --git a/core/assets/common/screen/gamemenu/pronasledovani_fore.png b/core/assets/common/screen/gamemenu/pronasledovani_fore.png new file mode 100644 index 0000000000000000000000000000000000000000..753143e8a2809687a62696bf9dc590262888da07 Binary files /dev/null and b/core/assets/common/screen/gamemenu/pronasledovani_fore.png differ diff --git a/core/assets/common/screen/gamemenu/pronasledovani_mid.png b/core/assets/common/screen/gamemenu/pronasledovani_mid.png new file mode 100644 index 0000000000000000000000000000000000000000..a97adfee1cc802af3795a8089e59ae6e0ed51aad Binary files /dev/null and b/core/assets/common/screen/gamemenu/pronasledovani_mid.png differ diff --git a/core/assets/common/screen/gamemenu/statistics_pressed.png b/core/assets/common/screen/gamemenu/statistics_pressed.png new file mode 100644 index 0000000000000000000000000000000000000000..bebbb128babf83e47ee69a41852d63938206236b Binary files /dev/null and b/core/assets/common/screen/gamemenu/statistics_pressed.png differ diff --git a/core/assets/common/screen/gamemenu/streetdoor_pressed.png b/core/assets/common/screen/gamemenu/streetdoor_pressed.png new file mode 100644 index 0000000000000000000000000000000000000000..af4b3a8e16edf7211a31ec22be11c1decbcc3ed6 Binary files /dev/null and b/core/assets/common/screen/gamemenu/streetdoor_pressed.png differ diff --git a/core/assets/common/screen/gamemenu/strelnice_back.png b/core/assets/common/screen/gamemenu/strelnice_back.png new file mode 100644 index 0000000000000000000000000000000000000000..10333b95475123376c6067f3c1d34f025d57a04e Binary files /dev/null and b/core/assets/common/screen/gamemenu/strelnice_back.png differ diff --git a/core/assets/common/screen/gamemenu/strelnice_fore.png b/core/assets/common/screen/gamemenu/strelnice_fore.png new file mode 100644 index 0000000000000000000000000000000000000000..c4a0a41e2e8e05225247bafb190d0ec910043e39 Binary files /dev/null and b/core/assets/common/screen/gamemenu/strelnice_fore.png differ diff --git a/core/assets/common/screen/gamemenu/strelnice_mid.png b/core/assets/common/screen/gamemenu/strelnice_mid.png new file mode 100644 index 0000000000000000000000000000000000000000..f543837c39eb520cd93aeb74baa5d991684191d0 Binary files /dev/null and b/core/assets/common/screen/gamemenu/strelnice_mid.png differ diff --git a/core/assets/common/screen/gamemenu/unos_back.png b/core/assets/common/screen/gamemenu/unos_back.png new file mode 100644 index 0000000000000000000000000000000000000000..7d6448ea367f76be9c1b5f2bf172a45d2fa8e301 Binary files /dev/null and b/core/assets/common/screen/gamemenu/unos_back.png differ diff --git a/core/assets/common/screen/gamemenu/unos_fore.png b/core/assets/common/screen/gamemenu/unos_fore.png new file mode 100644 index 0000000000000000000000000000000000000000..a741561713869570be5e47648fc414190df73d1a Binary files /dev/null and b/core/assets/common/screen/gamemenu/unos_fore.png differ diff --git a/core/assets/common/screen/gamemenu/unos_mid.png b/core/assets/common/screen/gamemenu/unos_mid.png new file mode 100644 index 0000000000000000000000000000000000000000..2ba240c927532ba1052b7b832a984a2d5eaffac8 Binary files /dev/null and b/core/assets/common/screen/gamemenu/unos_mid.png differ diff --git a/core/assets/common/screen/gamemenu/vignetting.png b/core/assets/common/screen/gamemenu/vignetting.png new file mode 100644 index 0000000000000000000000000000000000000000..c9247ca51177da00cb240b86720de9699deb450e Binary files /dev/null and b/core/assets/common/screen/gamemenu/vignetting.png differ diff --git a/core/assets/cs/screen/gamemenu/bankovniloupez_startbutton.png b/core/assets/cs/screen/gamemenu/bankovniloupez_startbutton.png new file mode 100644 index 0000000000000000000000000000000000000000..515e06848856a1584d07115a81ed9ec75af6ca00 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/bankovniloupez_startbutton.png differ diff --git a/core/assets/cs/screen/gamemenu/bankovniloupez_startbutton_pressed.png b/core/assets/cs/screen/gamemenu/bankovniloupez_startbutton_pressed.png new file mode 100644 index 0000000000000000000000000000000000000000..74b1cfa1cb68dd408289a42a74e47952f5526f70 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/bankovniloupez_startbutton_pressed.png differ diff --git a/core/assets/cs/screen/gamemenu/bankovniloupez_title.png b/core/assets/cs/screen/gamemenu/bankovniloupez_title.png new file mode 100644 index 0000000000000000000000000000000000000000..b0d8c541a4f0b0d5eb1fcba1838aab40286c6476 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/bankovniloupez_title.png differ diff --git a/core/assets/cs/screen/gamemenu/helplayer.png b/core/assets/cs/screen/gamemenu/helplayer.png new file mode 100644 index 0000000000000000000000000000000000000000..da37c81316dd950ae7b84b38bac43182e042abf9 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/helplayer.png differ diff --git a/core/assets/cs/screen/gamemenu/nocnisledovani_startbutton.png b/core/assets/cs/screen/gamemenu/nocnisledovani_startbutton.png new file mode 100644 index 0000000000000000000000000000000000000000..e6b737671776ba40e084f48909f308c7ea5f8563 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/nocnisledovani_startbutton.png differ diff --git a/core/assets/cs/screen/gamemenu/nocnisledovani_startbutton_pressed.png b/core/assets/cs/screen/gamemenu/nocnisledovani_startbutton_pressed.png new file mode 100644 index 0000000000000000000000000000000000000000..625fc79fe25b5676650928a0526ba858aceedba9 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/nocnisledovani_startbutton_pressed.png differ diff --git a/core/assets/cs/screen/gamemenu/nocnisledovani_title.png b/core/assets/cs/screen/gamemenu/nocnisledovani_title.png new file mode 100644 index 0000000000000000000000000000000000000000..261d0dd0c15dc41a2a8c5efd6833d0e8499ea6b9 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/nocnisledovani_title.png differ diff --git a/core/assets/cs/screen/gamemenu/screen_gamemenu_startmenu_background.jpg b/core/assets/cs/screen/gamemenu/office.jpg similarity index 100% rename from core/assets/cs/screen/gamemenu/screen_gamemenu_startmenu_background.jpg rename to core/assets/cs/screen/gamemenu/office.jpg diff --git a/core/assets/cs/screen/gamemenu/potme_startbutton.png b/core/assets/cs/screen/gamemenu/potme_startbutton.png new file mode 100644 index 0000000000000000000000000000000000000000..f38ebf062a39a51a8bb5674d4d47ba78797c9779 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/potme_startbutton.png differ diff --git a/core/assets/cs/screen/gamemenu/potme_startbutton_pressed.png b/core/assets/cs/screen/gamemenu/potme_startbutton_pressed.png new file mode 100644 index 0000000000000000000000000000000000000000..f38ebf062a39a51a8bb5674d4d47ba78797c9779 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/potme_startbutton_pressed.png differ diff --git a/core/assets/cs/screen/gamemenu/potme_title.png b/core/assets/cs/screen/gamemenu/potme_title.png new file mode 100644 index 0000000000000000000000000000000000000000..957815382d5d4b62f8282394c61741f5fa78b6b5 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/potme_title.png differ diff --git a/core/assets/cs/screen/gamemenu/pronasledovani_startbutton.png b/core/assets/cs/screen/gamemenu/pronasledovani_startbutton.png new file mode 100644 index 0000000000000000000000000000000000000000..cffd017412f8f4513d71ad3791c26f38442433e0 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/pronasledovani_startbutton.png differ diff --git a/core/assets/cs/screen/gamemenu/pronasledovani_startbutton_pressed.png b/core/assets/cs/screen/gamemenu/pronasledovani_startbutton_pressed.png new file mode 100644 index 0000000000000000000000000000000000000000..99dac76a1e4fa62dbee56287304f9eed593e1f31 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/pronasledovani_startbutton_pressed.png differ diff --git a/core/assets/cs/screen/gamemenu/pronasledovani_title.png b/core/assets/cs/screen/gamemenu/pronasledovani_title.png new file mode 100644 index 0000000000000000000000000000000000000000..d5b2ad79503ab1f921df78fdba5741cd051f0d69 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/pronasledovani_title.png differ diff --git a/core/assets/cs/screen/gamemenu/strelnice_startbutton.png b/core/assets/cs/screen/gamemenu/strelnice_startbutton.png new file mode 100644 index 0000000000000000000000000000000000000000..e484ec595785f360b844146b8c3f20b0ff450d38 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/strelnice_startbutton.png differ diff --git a/core/assets/cs/screen/gamemenu/strelnice_startbutton_pressed.png b/core/assets/cs/screen/gamemenu/strelnice_startbutton_pressed.png new file mode 100644 index 0000000000000000000000000000000000000000..e484ec595785f360b844146b8c3f20b0ff450d38 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/strelnice_startbutton_pressed.png differ diff --git a/core/assets/cs/screen/gamemenu/strelnice_title.png b/core/assets/cs/screen/gamemenu/strelnice_title.png new file mode 100644 index 0000000000000000000000000000000000000000..897f09d5fd118c5502442192226b625ab4419482 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/strelnice_title.png differ diff --git a/core/assets/cs/screen/gamemenu/unos_startbutton.png b/core/assets/cs/screen/gamemenu/unos_startbutton.png new file mode 100644 index 0000000000000000000000000000000000000000..a3c0e9180f504c65727ac65a72c12b29b61ebafc Binary files /dev/null and b/core/assets/cs/screen/gamemenu/unos_startbutton.png differ diff --git a/core/assets/cs/screen/gamemenu/unos_startbutton_pressed.png b/core/assets/cs/screen/gamemenu/unos_startbutton_pressed.png new file mode 100644 index 0000000000000000000000000000000000000000..4a114cd8dd894292d2178c3da35ebfd63c8ff42b Binary files /dev/null and b/core/assets/cs/screen/gamemenu/unos_startbutton_pressed.png differ diff --git a/core/assets/cs/screen/gamemenu/unos_title.png b/core/assets/cs/screen/gamemenu/unos_title.png new file mode 100644 index 0000000000000000000000000000000000000000..e80abea04b7022c0d4f20be8c5b8499a8dbd0eb0 Binary files /dev/null and b/core/assets/cs/screen/gamemenu/unos_title.png differ diff --git a/core/src/cz/nic/tablexia/game/GameDefinition.java b/core/src/cz/nic/tablexia/game/GameDefinition.java index 1b28e2f8009f4bab570f7bc16f773203a2e06a47..e285d6873319242806127d86c05b6ced132797ab 100644 --- a/core/src/cz/nic/tablexia/game/GameDefinition.java +++ b/core/src/cz/nic/tablexia/game/GameDefinition.java @@ -16,7 +16,7 @@ import cz.nic.tablexia.screen.AbstractTablexiaScreen; public enum GameDefinition implements ApplicationEvent, IMenuItem { - + ROBBERY ("game_robbery_title", RobberyScreen.class, true), PURSUIT ("game_pursuit_title", PursuitScreen.class, true), KIDNAPPING ("game_kidnapping_title", KidnappingScreen.class, true), @@ -29,23 +29,27 @@ public enum GameDefinition implements ApplicationEvent, IMenuItem { private Class<? extends AbstractTablexiaScreen<?>> screenClass; private boolean isCloseMenu; + public static GameDefinition[] getActiveGames(){ + return new GameDefinition[]{ROBBERY, PURSUIT, KIDNAPPING, NIGHT_WATCH, SHOOTING_RANGE, IN_THE_DARKNESS}; + } + private GameDefinition(String nameResource, Class<? extends AbstractTablexiaScreen<?>> screenClass, boolean isCloseMenu) { this.menuTextKey = nameResource; this.screenClass = screenClass; this.isCloseMenu = isCloseMenu; } - + @Override public String getTitle() { return ApplicationTextManager.getInstance().getResult().get(menuTextKey); } - + @Override public void performAction() { ApplicationBus.getInstance().publishAsync(this); ApplicationBus.getInstance().publishAsync(new ChangeScreenEvent(screenClass, ScreenTransaction.FADE)); } - + @Override public boolean isCloseMenu() { return isCloseMenu; diff --git a/core/src/cz/nic/tablexia/loader/application/ApplicationTextureManager.java b/core/src/cz/nic/tablexia/loader/application/ApplicationTextureManager.java index c2e56a16ba8497d40e1906582de3c00e40cf27e1..43b4d633e59c4d61d3a409ccf64ec5b27fe75202 100644 --- a/core/src/cz/nic/tablexia/loader/application/ApplicationTextureManager.java +++ b/core/src/cz/nic/tablexia/loader/application/ApplicationTextureManager.java @@ -34,11 +34,7 @@ public class ApplicationTextureManager extends TablexiaTextureManager implements private static final String MAINMENU_PATH = APPLICATION_PATH + "mainmenu/"; public static final String MAINMENU_BACKGROUND = MAINMENU_PATH + "background.png"; - private static final String GAMEMENU_PATH = "screen/gamemenu/"; - public static final String STARTMENU_BACKGROUND = GAMEMENU_PATH + "screen_gamemenu_startmenu_background.jpg"; - - public void load() { + public void load() { loadTexture(MAINMENU_BACKGROUND); - loadTexture(STARTMENU_BACKGROUND); } } \ No newline at end of file diff --git a/core/src/cz/nic/tablexia/screen/gamemenu/GameMenuAssets.java b/core/src/cz/nic/tablexia/screen/gamemenu/GameMenuAssets.java new file mode 100644 index 0000000000000000000000000000000000000000..20c688976647c8d9fee6bc7f61d7ffa8400acad7 --- /dev/null +++ b/core/src/cz/nic/tablexia/screen/gamemenu/GameMenuAssets.java @@ -0,0 +1,85 @@ +package cz.nic.tablexia.screen.gamemenu; + +import java.util.ArrayList; +import java.util.List; + +import cz.nic.tablexia.game.GameDefinition; + +/** + * Created by lhoracek on 3/11/15. + */ +public final class GameMenuAssets { + + private GameMenuAssets() { + } + + + public static enum GameMenuLayers { + FORE, MID, BACK, TITLE, STARTBUTTON, STARTBUTTON_PRESSED; + } + + private static final String GAMEMENU_PATH = "screen/gamemenu/"; + + public static final String OFFICE = GAMEMENU_PATH + "office.jpg"; + public static final String OFFICE_CLICKMAP = GAMEMENU_PATH + "clickablemap.png"; + public static final String OFFICE_HELP = GAMEMENU_PATH + "helplayer.png"; + public static final String VIGNETTE = GAMEMENU_PATH + "vignetting.png"; + public static final String DESK = GAMEMENU_PATH + "desk.png"; + public static final String ENCYCLOPEDIA_PRESSED = GAMEMENU_PATH + "encyclopedia_pressed.png"; + public static final String HALLOFFAME_PRESSED = GAMEMENU_PATH + "halloffame_pressed.png"; + public static final String STATISTICS_PRESSED = GAMEMENU_PATH + "statistics_pressed.png"; + public static final String DOOR_PRESSED = GAMEMENU_PATH + "streetdoor_pressed.png"; + public static final String PROFILE_PRESSED = GAMEMENU_PATH + "profile_pressed.png"; + + public static final String DIFF_BAR = GAMEMENU_PATH + "difficultyseekbar_background.png"; + public static final String DIFF_THUMB = GAMEMENU_PATH + "difficultyseekbar_thumb.png"; + public static final String DIFF_THUMB_EASY = GAMEMENU_PATH + "difficultyseekbar_thumb_easy.png"; + public static final String DIFF_THUMB_HARD = GAMEMENU_PATH + "difficultyseekbar_thumb_hard.png"; + public static final String DIFF_THUMB_MEDIUM = GAMEMENU_PATH + "difficultyseekbar_thumb_medium.png"; + + public static final String GAME_ROBBERY_BASE = "bankovniloupez"; + public static final String GAME_PURSUIT_BASE = "pronasledovani"; + public static final String GAME_KIDNAPPING_BASE = "unos"; + public static final String GAME_SHOOTING_RANGE_BASE = "strelnice"; + public static final String GAME_NIGHT_WATCH_BASE = "nocnisledovani"; + public static final String GAME_IN_THE_DARKNESS_BASE = "potme"; + + public static final String TEXT_PATH = "text/gamemenu"; + + public static List<String> textures = new ArrayList<String>(); + + static { + textures.add(OFFICE); + textures.add(OFFICE_CLICKMAP); + textures.add(DESK); + textures.add(OFFICE_HELP); + textures.add(VIGNETTE); + + textures.add(DIFF_BAR); + textures.add(DIFF_THUMB); + textures.add(DIFF_THUMB_EASY); + textures.add(DIFF_THUMB_HARD); + textures.add(DIFF_THUMB_MEDIUM); + + textures.add(ENCYCLOPEDIA_PRESSED); + textures.add(HALLOFFAME_PRESSED); + textures.add(STATISTICS_PRESSED); + textures.add(DOOR_PRESSED); + textures.add(PROFILE_PRESSED); + + String baseGameAsset = "MENU_GAME_"; + for (GameDefinition gd : GameDefinition.getActiveGames()) { + for (GameMenuLayers gml : GameMenuLayers.values()) { + textures.add(getResourcePath(gd, gml)); + } + } + } + + public static String getResourcePath(GameDefinition game, GameMenuLayers layer) { + try { + return GAMEMENU_PATH + (GameMenuAssets.class.getField("GAME_" + game.name() + "_BASE").get(null)) + "_" + layer.name().toLowerCase() + ".png"; + } catch (Exception e) { + throw new IllegalArgumentException("Error generating path for " + game.name() + " " + layer.name()); + } + } +} \ No newline at end of file diff --git a/core/src/cz/nic/tablexia/screen/gamemenu/GameMenuScreen.java b/core/src/cz/nic/tablexia/screen/gamemenu/GameMenuScreen.java index 12f1f18c2b0e45d27e8c2d843925ff7fdeeea9ea..cf74b3063c55015955de3cfc55624d40e2d53335 100644 --- a/core/src/cz/nic/tablexia/screen/gamemenu/GameMenuScreen.java +++ b/core/src/cz/nic/tablexia/screen/gamemenu/GameMenuScreen.java @@ -1,6 +1,13 @@ package cz.nic.tablexia.screen.gamemenu; +import com.badlogic.gdx.scenes.scene2d.Touchable; +import com.badlogic.gdx.scenes.scene2d.ui.Image; + +import java.util.List; + +import cz.nic.tablexia.game.GameDefinition; import cz.nic.tablexia.screen.AbstractTablexiaScreen; +import cz.nic.tablexia.screen.gamemenu.pages.GameMenuPage; import cz.nic.tablexia.screen.gamemenu.pages.OfficeMenuPage; import cz.nic.tablexia.util.Log; import cz.nic.tablexia.util.ui.ViewPager; @@ -9,19 +16,33 @@ public class GameMenuScreen extends AbstractTablexiaScreen<Void> { private ViewPager vp; + + @Override + protected void prepareScreenTextureAssetNames(List<String> textureFileNames) { + super.prepareScreenTextureAssetNames(textureFileNames); + textureFileNames.addAll(GameMenuAssets.textures); + } + @Override protected void screenLoaded() { vp = new ViewPager(); - vp.addPage(new OfficeMenuPage()); - vp.addPage(new OfficeMenuPage()); - vp.addPage(new OfficeMenuPage()); - vp.addPage(new OfficeMenuPage()); - vp.addPage(new OfficeMenuPage()); + vp.addPage(new OfficeMenuPage(this)); + + for (GameDefinition gd : GameDefinition.getActiveGames()) { + vp.addPage(new GameMenuPage(this, gd)); + } + vp.setSize(getStage().getWidth(), getStage().getHeight()); Log.info(getClass().getName(), "ViewPager size: " + getStage().getWidth() + "x" + getStage().getHeight()); getStage().addActor(vp); + + + Image im = new Image(getTexture(GameMenuAssets.VIGNETTE)); + im.setTouchable(Touchable.disabled); + im.setSize(getStage().getWidth(), getStage().getHeight()); + getStage().addActor(im); } } diff --git a/core/src/cz/nic/tablexia/screen/gamemenu/pages/GameMenuPage.java b/core/src/cz/nic/tablexia/screen/gamemenu/pages/GameMenuPage.java index 6230942ab146898cd580cf5709db0a08e396eee4..7c2ae4827836c2012e9501eb2fecb134d4ceebd7 100644 --- a/core/src/cz/nic/tablexia/screen/gamemenu/pages/GameMenuPage.java +++ b/core/src/cz/nic/tablexia/screen/gamemenu/pages/GameMenuPage.java @@ -1,26 +1,221 @@ package cz.nic.tablexia.screen.gamemenu.pages; +import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Batch; +import com.badlogic.gdx.scenes.scene2d.Actor; +import com.badlogic.gdx.scenes.scene2d.InputEvent; +import com.badlogic.gdx.scenes.scene2d.InputListener; +import com.badlogic.gdx.scenes.scene2d.actions.AlphaAction; +import com.badlogic.gdx.scenes.scene2d.actions.MoveToAction; +import com.badlogic.gdx.scenes.scene2d.ui.Image; +import com.badlogic.gdx.scenes.scene2d.ui.Label; +import com.badlogic.gdx.scenes.scene2d.ui.Skin; +import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; -import cz.nic.tablexia.loader.application.ApplicationTextureManager; +import cz.nic.tablexia.TablexiaSettings; +import cz.nic.tablexia.game.GameDefinition; +import cz.nic.tablexia.screen.AbstractTablexiaScreen; +import cz.nic.tablexia.screen.gamemenu.GameMenuAssets; +import cz.nic.tablexia.util.ui.ViewPager; /** + * Representing one page in ViewPager with specific game * Created by lhoracek on 3/4/15. */ -public class GameMenuPage extends MenuPage { - private Texture backgroundTexture; +public class GameMenuPage extends MenuPage implements ViewPager.ScrollListener { + private GameDefinition game; - public GameMenuPage() { - //FIXME don't use ApplicationTextureManager - backgroundTexture = ApplicationTextureManager.getInstance().getTexture(ApplicationTextureManager.STARTMENU_BACKGROUND); - backgroundTexture.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear); + private float diffEasyX, diffMediumX, diffHardX; + + private float scrollOffset = TablexiaSettings.getDefaultScreenWidth(); // hack to keep paralax layers out of picture before scrolled for first time + + public GameMenuPage(AbstractTablexiaScreen screen, GameDefinition game) { + super(screen); + this.game = game; + + + // Title + Texture title = getScreen().getTexture(GameMenuAssets.getResourcePath(game, GameMenuAssets.GameMenuLayers.TITLE)); + Image titleImage = new Image(title); + int titleX = (int) (screen.getStage().getWidth() * 0.2); + int titleWidth = (int) (screen.getStage().getWidth() * 0.6); + int titleHeight = (int) (titleWidth * ((float) title.getHeight() / (float) title.getWidth())); + int titleY = (int) (screen.getStage().getHeight() - (screen.getStage().getHeight() * 0.05) - titleHeight); + titleImage.setPosition(titleX, titleY); + titleImage.setSize(titleWidth, titleHeight); + addActor(titleImage); + + // Start button + Texture start = getScreen().getTexture(GameMenuAssets.getResourcePath(game, GameMenuAssets.GameMenuLayers.STARTBUTTON)); + final Image startButton = new Image(start); + int startY = (int) (screen.getStage().getWidth() * 0.1); + int startHeight = (int) (screen.getStage().getHeight() * 0.25); + int startWidth = (int) (startHeight * ((float) start.getWidth() / (float) start.getHeight())); + int startX = (int) screen.getStage().getWidth() / 2 - startWidth / 2; + startButton.setSize(startWidth, startHeight); + startButton.setPosition(startX, startY); + + // Start button down + Texture startDown = getScreen().getTexture(GameMenuAssets.getResourcePath(game, GameMenuAssets.GameMenuLayers.STARTBUTTON_PRESSED)); + final Image startDownButton = new Image(startDown); + int startDownY = (int) (screen.getStage().getWidth() * 0.1); + int startDownHeight = (int) (screen.getStage().getHeight() * 0.25); + int startDownWidth = (int) (startDownHeight * ((float) startDown.getWidth() / (float) startDown.getHeight())); + int startDownX = (int) screen.getStage().getWidth() / 2 - startDownWidth / 2; + startDownButton.setSize(startDownWidth, startDownHeight); + startDownButton.setPosition(startDownX, startDownY); + startDownButton.setVisible(false); + + addActor(startDownButton); + addActor(startButton); + + startButton.addListener(new ClickListener() { + @Override + public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { + startButton.addAction(new AlphaAction()); + startDownButton.setVisible(true); + return super.touchDown(event, x, y, pointer, button); + } + + @Override + public void exit(InputEvent event, float x, float y, int pointer, Actor toActor) { + AlphaAction aa = new AlphaAction(); + aa.setAlpha(1); + startButton.addAction(aa); + startDownButton.setVisible(false); + super.exit(event, x, y, pointer, toActor); + } + + @Override + public void clicked(InputEvent event, float x, float y) { + super.clicked(event, x, y); + GameMenuPage.this.game.performAction(); // TODO launch game using events + } + }); + + // Labels for diffuculty slider + Skin skin = new Skin(Gdx.files.internal("uiskin.json")); + Label easy = new Label("Easy", skin); + Label medium = new Label("Medium", skin); + Label hard = new Label("Hard", skin); + + easy.setPosition((screen.getStage().getWidth() / 2) - (screen.getStage().getWidth() * 0.1f) - easy.getWidth() / 2, screen.getStage().getHeight() * 0.0f); + medium.setPosition((screen.getStage().getWidth() / 2) - medium.getWidth() / 2, screen.getStage().getHeight() * 0.0f); + hard.setPosition((screen.getStage().getWidth() / 2) + (screen.getStage().getWidth() * 0.1f) - hard.getWidth() / 2, screen.getStage().getHeight() * 0.0f); + + addActor(easy); + addActor(medium); + addActor(hard); + + // Difficulty bar + Texture diffBar = getScreen().getTexture(GameMenuAssets.DIFF_BAR); + Image diffBarImage = new Image(diffBar); + + int diffBarHeight = (int) (screen.getStage().getHeight() * 0.05); + int diffBarWidth = (int) (diffBarHeight * ((float) diffBar.getWidth() / (float) diffBar.getHeight())); + int diffBarX = (int) screen.getStage().getWidth() / 2 - diffBarWidth / 2; + int diffBarY = (int) (screen.getStage().getHeight() * 0.1 - diffBarHeight); + diffBarImage.setPosition(diffBarX, diffBarY); + diffBarImage.setSize(diffBarWidth, diffBarHeight); + addActor(diffBarImage); + + // Difficulty button + + + final Texture diff = getScreen().getTexture(GameMenuAssets.DIFF_THUMB_MEDIUM); + final Image diffButton = new Image(diff); + float diffY = 0; + float diffHeight = screen.getStage().getHeight() * 0.15f; + float diffWidth = diffHeight * ((float) diff.getWidth() / (float) diff.getHeight()); + + diffEasyX = (screen.getStage().getWidth() / 2 - diffWidth / 2 + (int) (diffWidth * 0.1f)) - diffBarWidth / 2; + diffMediumX = screen.getStage().getWidth() / 2 - diffWidth / 2 + (int) (diffWidth * 0.1f); + diffHardX = (screen.getStage().getWidth() / 2 - diffWidth / 2 + (int) (diffWidth * 0.1f)) + diffBarWidth / 2; + + float diffX = diffEasyX; + diffButton.setSize(diffWidth, diffHeight); + diffButton.setPosition(diffX, diffY); + addActor(diffButton); + + + diffButton.addListener(new InputListener() { + float lastX; + + @Override + public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { + super.touchDown(event, x, y, pointer, button); + lastX = x; + event.stop(); + return true; + } + + @Override + public void touchDragged(InputEvent event, float x, float y, int pointer) { + super.touchDragged(event, x, y, pointer); + float bx = diffButton.getX() + (x - lastX); + if (bx >= diffEasyX && bx <= diffHardX) { + diffButton.setPosition(bx, diffButton.getY()); + } + event.stop(); + } + + @Override + public void touchUp(InputEvent event, float x, float y, int pointer, int button) { + super.touchUp(event, x, y, pointer, button); + float bx = diffButton.getX() + (x - lastX); + MoveToAction ma = new MoveToAction(); + if (bx < diffMediumX) { + if ((diffEasyX + ((diffMediumX - diffEasyX) / 2)) > bx) { + ma.setPosition(diffEasyX, diffButton.getY()); + } else { + ma.setPosition(diffMediumX, diffButton.getY()); + } + } else { + if ((diffMediumX + ((diffHardX - diffMediumX) / 2)) > bx) { + ma.setPosition(diffMediumX, diffButton.getY()); + } else { + ma.setPosition(diffHardX, diffButton.getY()); + } + } + diffButton.addAction(ma); + event.stop(); + } + }); } @Override public void draw(Batch batch, float parentAlpha) { - batch.disableBlending(); - batch.draw(backgroundTexture, 0, 0, getWidth(), getHeight()); - batch.enableBlending(); + // Paralax layers + // Back layer travels half the speed of scroll + Texture back = getScreen().getTexture(GameMenuAssets.getResourcePath(game, GameMenuAssets.GameMenuLayers.BACK)); + float scrollHalf = (Math.abs(scrollOffset / 2) / getWidth()) * back.getWidth(); + int srcX = (int) scrollHalf; + int srcWidth = (int) (back.getWidth() - (scrollHalf * 2)); + float x = getX() + Math.abs(Math.min(scrollOffset, 0)); + float width = getWidth() - Math.abs(scrollOffset); + batch.draw(back, x, getY(), width, getHeight(), srcX, 0, srcWidth, back.getHeight(), false, false); + + // Mid layer travels the same speed + batch.draw(getScreen().getTexture(GameMenuAssets.getResourcePath(game, GameMenuAssets.GameMenuLayers.MID)), getX(), getY(), getWidth(), getHeight()); + + // Foreground layer travels faster and could be wider than screen. Needs to be clipped + + Texture fore = getScreen().getTexture(GameMenuAssets.getResourcePath(game, GameMenuAssets.GameMenuLayers.FORE)); + float foreWidth = (getHeight() / fore.getHeight()) * fore.getWidth(); + batch.draw(fore, getX() - ((foreWidth - getWidth()) / 2) + (scrollOffset / 2), getY(), foreWidth, getHeight()); + + super.draw(batch, parentAlpha); + } + + @Override + public void onScroll(float offset) { + scrollOffset = offset; + //Log.info(((Object) this).getClass().getName(), "Scroll " + game.name() + ": " + offset); + } + + @Override + public void onScrolledToPage() { + //Log.info(((Object) this).getClass().getName(), "Scrolled to page: " + game.name()); } } diff --git a/core/src/cz/nic/tablexia/screen/gamemenu/pages/MenuPage.java b/core/src/cz/nic/tablexia/screen/gamemenu/pages/MenuPage.java index 49d72f41b7fd0ecd1b9c390ccd0579a96dec6521..5711a8cf1962a3f0685b53602a81a358e73b6547 100644 --- a/core/src/cz/nic/tablexia/screen/gamemenu/pages/MenuPage.java +++ b/core/src/cz/nic/tablexia/screen/gamemenu/pages/MenuPage.java @@ -2,8 +2,19 @@ package cz.nic.tablexia.screen.gamemenu.pages; import com.badlogic.gdx.scenes.scene2d.Group; +import cz.nic.tablexia.screen.AbstractTablexiaScreen; + /** * Created by lhoracek on 3/4/15. */ public abstract class MenuPage extends Group { + private AbstractTablexiaScreen screen; + + public MenuPage(AbstractTablexiaScreen screen) { + this.screen = screen; + } + + protected AbstractTablexiaScreen getScreen() { + return screen; + } } diff --git a/core/src/cz/nic/tablexia/screen/gamemenu/pages/OfficeMenuPage.java b/core/src/cz/nic/tablexia/screen/gamemenu/pages/OfficeMenuPage.java index fe32b0c6a8651d8c0aaed0330e14613c0923fbb8..980cefa66dbf75e034f19c08fc7b12a0a7bc061c 100644 --- a/core/src/cz/nic/tablexia/screen/gamemenu/pages/OfficeMenuPage.java +++ b/core/src/cz/nic/tablexia/screen/gamemenu/pages/OfficeMenuPage.java @@ -1,27 +1,88 @@ package cz.nic.tablexia.screen.gamemenu.pages; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Batch; +import com.badlogic.gdx.scenes.scene2d.InputEvent; +import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; -import cz.nic.tablexia.loader.application.ApplicationTextureManager; +import cz.nic.tablexia.menu.MainMenuDefinition; +import cz.nic.tablexia.screen.AbstractTablexiaScreen; +import cz.nic.tablexia.screen.gamemenu.GameMenuAssets; +import cz.nic.tablexia.util.Log; /** * Created by lhoracek on 3/4/15. */ public class OfficeMenuPage extends MenuPage { - private Texture backgroundTexture; - public OfficeMenuPage() { - //FIXME don't use ApplicationTextureManager - backgroundTexture = ApplicationTextureManager.getInstance().getTexture(ApplicationTextureManager.STARTMENU_BACKGROUND); - backgroundTexture.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear); + public static final Color STREET_COLOR = Color.YELLOW; + public static final Color HALLOFFAME_COLOR = Color.GREEN; + public static final Color STATISTICS_COLOR = Color.RED; + public static final Color ENCYCLOPEDIA_COLOR = Color.BLACK; + public static final Color PROFILE_COLOR = Color.BLUE; + + + public OfficeMenuPage(AbstractTablexiaScreen screen) { + super(screen); + addListener(new ClickListener() { + @Override + public void clicked(InputEvent event, float x, float y) { + super.clicked(event, x, y); + + Color color = getTouchedColor(x, y); + + if (color.equals(ENCYCLOPEDIA_COLOR)) { + MainMenuDefinition.ENCYCLOPEDIA.performAction(); + } else if (color.equals(STATISTICS_COLOR)) { + MainMenuDefinition.STATISTICS.performAction(); + } else if (color.equals(HALLOFFAME_COLOR)) { + MainMenuDefinition.HALL_OF_FAME.performAction(); + } else if (color.equals(STREET_COLOR)) { + Log.info(((Object) this).getClass().getName(), "Clicked STREET_COLOR"); + // TODO go to street + } else if (color.equals(PROFILE_COLOR)) { + // TODO show profile + } else { + // TODO hide help layer + } + } + }); + } + + + private Color getTouchedColor(float x, float y) { + Texture clickmap = getScreen().getTexture(GameMenuAssets.OFFICE_CLICKMAP); + if (!clickmap.getTextureData().isPrepared()) { + clickmap.getTextureData().prepare(); + } + + Pixmap pixmap = clickmap.getTextureData().consumePixmap(); + int clickX = (int) (x / getWidth() * clickmap.getWidth()); + int clickY = clickmap.getHeight() - (int) (y / getHeight() * clickmap.getHeight()); + + Log.info(((Object) this).getClass().getName(), "Color map " + clickmap.getWidth() + ":" + clickmap.getHeight() + " at " + clickX + ": " + clickY); + + return new Color(pixmap.getPixel(clickX, clickY)); } @Override public void draw(Batch batch, float parentAlpha) { batch.disableBlending(); - batch.draw(backgroundTexture, getX(), getY(), getWidth(), getHeight()); + batch.draw(getScreen().getTexture(GameMenuAssets.OFFICE), getX(), getY(), getWidth(), getHeight()); batch.enableBlending(); + + batch.draw(getScreen().getTexture(GameMenuAssets.OFFICE_HELP), getX(), getY(), getWidth(), getHeight()); + batch.draw(getScreen().getTexture(GameMenuAssets.PROFILE_PRESSED), getX(), getY(), getWidth(), getHeight()); + batch.draw(getScreen().getTexture(GameMenuAssets.DOOR_PRESSED), getX(), getY(), getWidth(), getHeight()); + batch.draw(getScreen().getTexture(GameMenuAssets.ENCYCLOPEDIA_PRESSED), getX(), getY(), getWidth(), getHeight()); + batch.draw(getScreen().getTexture(GameMenuAssets.STATISTICS_PRESSED), getX(), getY(), getWidth(), getHeight()); + batch.draw(getScreen().getTexture(GameMenuAssets.HALLOFFAME_PRESSED), getX(), getY(), getWidth(), getHeight()); + + batch.draw(getScreen().getTexture(GameMenuAssets.DESK), getX(), getY(), getWidth(), getHeight()); + + batch.draw(getScreen().getTexture(GameMenuAssets.OFFICE_HELP), getX(), getY(), getWidth(), getHeight()); } } diff --git a/core/src/cz/nic/tablexia/util/ui/ViewPager.java b/core/src/cz/nic/tablexia/util/ui/ViewPager.java index fba4df5295d02435ec11746cb1503267f701e1fe..55403797fb53f895318510ae2ce53f2ec7adfb16 100644 --- a/core/src/cz/nic/tablexia/util/ui/ViewPager.java +++ b/core/src/cz/nic/tablexia/util/ui/ViewPager.java @@ -15,6 +15,8 @@ public class ViewPager extends ScrollPane { private boolean wasPanDragFling = false; + private float lastX; + private float pageSpacing; private Table content; @@ -43,6 +45,9 @@ public class ViewPager extends ScrollPane { content = new Table(); super.setWidget(content); content.defaults().space(0); + //setClamp(false); + //setScrollingDisabled(false, true); + setFlingTime(0.1f); } @Override @@ -67,7 +72,6 @@ public class ViewPager extends ScrollPane { @Override public void act(float delta) { - super.act(delta); if (wasPanDragFling && !isPanning() && !isDragging() && !isFlinging()) { wasPanDragFling = false; scrollToPage(); @@ -76,8 +80,44 @@ public class ViewPager extends ScrollPane { wasPanDragFling = true; } } + + + if(lastX != getWidget().getX()){ + float scrollX = -getWidget().getX(); + Array<Actor> pages = content.getChildren(); + float pageX = 0; + float pageWidth = 0; + + if (pages.size > 0) { + for (Actor a : pages) { + pageX = a.getX(); + pageWidth = a.getWidth(); + if (scrollX > pageX && scrollX < (pageX + pageWidth)) { + if (a instanceof ScrollListener) { + ScrollListener sl = (ScrollListener) a; + sl.onScroll(-(scrollX - pageX)); + } + } else if (scrollX < (pageX) && (scrollX + pageWidth) > pageX) { + if (a instanceof ScrollListener) { + ScrollListener sl = (ScrollListener) a; + sl.onScroll(pageX - scrollX); + } + } + if(pageX == scrollX){ + if (a instanceof ScrollListener) { + ScrollListener sl = (ScrollListener) a; + sl.onScrolledToPage(); + } + } + } + } + } + lastX = getWidget().getX(); + super.act(delta); } + + @Override @Deprecated public void setWidget(Actor widget) { @@ -127,5 +167,9 @@ public class ViewPager extends ScrollPane { } } + public static interface ScrollListener { + public void onScroll(float offset); + public void onScrolledToPage(); + } }