diff --git a/.gitignore b/.gitignore index def7b26..47454ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,64 @@ -.idea -*.iml +## Java + +*.class +*.war +*.ear +hs_err_pid* + +## GWT +war/ +html/war/gwt_bree/ +html/gwt-unitCache/ +.apt_generated/ +html/war/WEB-INF/deploy/ +html/war/WEB-INF/classes/ +.gwt/ +gwt-unitCache/ +www-test/ +.gwt-tmp/ + +## Android Studio and Intellij and Android in general +android/libs/armeabi/ +android/libs/armeabi-v7a/ +android/libs/x86/ +android/gen/ +.idea/ *.ipr *.iws +*.iml +out/ +com_crashlytics_export_strings.xml +## Eclipse .classpath .project +.metadata +**/bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.externalToolBuilders/ +*.launch + +## NetBeans +**/nbproject/private/ +build/ +nbbuild/ +dist/ +nbdist/ +nbactions.xml +nb-configuration.xml -tmp -out -target +## Gradle -android/libs -ios +.gradle +gradle-app.setting +build/ -**/*.log +## OS Specific +.DS_Store diff --git a/README.md b/README.md index 086cd55..2720985 100644 --- a/README.md +++ b/README.md @@ -1,130 +1,21 @@ -MTX (MoribitoTechX) -=== +Thank moribitotech for useful source code about libgdx platform. -- Compact-MTX framework over LibGDX Scene2D -- Tutorial Blog: http://moribitotechx.blogspot.co.uk/ -- Twitter: https://twitter.com/MoribitoTech -- Exclusive Facebook Group: https://www.facebook.com/groups/MoribitoTechAndroid/ +I am very interesting about libgdx. I found out this source code in github, but it was out-of-date. +I want to reuse this source code and maintain to support newest version of libgdx. +The heart of platform stay in core project. That's why I only keep core and desktop project. -Info: ---------- -- It is a Open Source Project Under Apache Licence, Version 2.0 -- %100 Free and Awsome -- Designed for Apps, Games & Live Wallpapers (Extremely easy and fast) -- Designed for far less code writing -- Built over LibGDX Scene2D -- Cross device resolution (Same quality in every device wiht Mtx v2.0 version, no more stretching) -- Designed for easier Scene / Stage / Group / Actor integration -- Designed for easier Menu Creations -- Designed for easier Animation Integration -- Designed for easier Settings Management -- Ready effects and smart models -- Designed for game specific purposes. For example, creating level buttons, setting special animations, getting screen time, integrating momentarily animations, multi-textured buttons, advanced actors, special setting management (volume, vibration, sfx and others.). -- Also usable for game logics, but it is heavily depends on Scene2D, it means that it is not %100 MVC supportive. However for games like puzzles, brain teasers, low-level platformers, low-level defence games, other low-level causal games, it may be suitable. Again, I warn you, it is not %100 MVC supportive. +Installation -What you need to know: ---------- -- Basic knowledge and experience with Java, Android SDK, Eclipse and LibGDX -- Understanding the fundamentals of LibGDX Scene2D -- TexturePacking and TextureAtlas management (Not essential) + - git clone https://github.com/luyentm/MTX.git + - import to eclipse by gradle + - compile and run -How can it be used: ---------- -- First of all it is pure LibGDX, so you can develop your game in your way (2D / 3D) with LibGDX and add MTX over it without any problems -- Main menu and game menus with animations, easy to use buttons, no stretching problems (only Mtx v2.0) -- Game background environments, bubbles, snows, parallax effects, clouds, animated object anything about game environment can be done in seconds -- Live wallpapers (I made a small fortune with them), Top-notch, very detailed and high quality live wallpapers can be done in days -- Simple touch, touch drag, swipe intentions and collision detections for your needs -- Games, you can develop a full game without any problems, if you like abilities of LibGDX Scene2D +Desktop +In order to run MTX samples you need to change "mainClass" property inside desktop/pom.xml -## Installation + com.moribitotech.samples.core.Main (Core samples) + com.moribitotech.samples.gameworld.Main (Game World) + com.moribitotech.samples.jungle.Main (Jungle Menu) -Project structure was generated using official libgdx maven archetype - https://github.com/libgdx/libgdx-maven-archetype -In order to build it, please follow the following steps: -- Download latest version of Apache Maven tool from http://maven.apache.org/download.cgi and unpack it to folder on your PC. -- Create M2_HOME environment variable and set it to -- Update PATH environment variable and append /bin folder to it. For Windows users it is sometimes required to restart cmd after setting your environment variables. -- Verify that you install Maven correctly by typing "mvn -version" in your shell. As a result you should see installed maven version. - -### Build and run the Desktop backend - -You can build and run your game using the Desktop backend like this: - -``` -% mvn integration-test -Pdesktop -``` - -This is pretty simple. It builds the Java code, and then unpacks some native libraries into the -right place and then runs the code. - -You can also build a single jar file version of your game that you can send to friends or do -whatever you like with: - -``` -% mvn package -Pdesktop -% java -jar desktop/target/mtx-1.0-SNAPSHOT-jar-with-dependencies.jar -``` - -### Build and run the Android backend - -You can build your game using the Android backend and install it to a device like this: - -``` -% mvn install -Pandroid -``` -This maven project structure was generated using official libgdx maven archetype - https://github.com/libgdx/libgdx-maven-archetype - -## Running your project - -### Build and run the Desktop backend - -You can build and run your game using the Desktop backend like this: - -``` -% mvn integration-test -Pdesktop -``` - -This is pretty simple. It builds the Java code, and then unpacks some native libraries into the -right place and then runs the code. - -You can also build a single jar file version of your game that you can send to friends or do -whatever you like with: - -``` -% mvn package -Pdesktop -% java -jar desktop/target/mtx-1.0-SNAPSHOT-jar-with-dependencies.jar -``` - -### Build and run the Android backend - -You can build your game using the Android backend and install it to a device like this: - -``` -% mvn install -Pandroid -``` - -## Run MTX samples - -There are 3 samples which come together with MTX framework: -- Core samples (tutorials 1-3 from http://moribitotechx.blogspot.co.uk/p/tutorial-series-libgdx-mtx.html) -- Game World (tutorial 5) -- Jungle Menu (tutorial 7) - -### Desktop -In order to run MTX samples you need to change "mainClass" property inside desktop/pom.xml -- com.moribitotech.samples.core.Main (Core samples) -- com.moribitotech.samples.gameworld.Main (Game World) -- com.moribitotech.samples.jungle.Main (Jungle Menu) - -### Android -In order to run MTX samples you need to change android:name property for main activity inside AndroidManifest.xml: -- com.moribitotech.samples.core.MainActivity (Core samples) -- com.moribitotech.samples.gameworld.MainActivity (Game World) -- com.moribitotech.samples.jungle.MainActivity (Jungle Menu) -Also please check the the package name is equal to "com.moribitotech.mtx.samples". - - -### Import project into IDE. - -All modern IDEs has build-in Maven plugin, so in order to create project you need to select "Import project" option in your IDE and select root pom.xml file. IDE should automatically set up all required information. \ No newline at end of file +Mail: tranminhluyen.1993@gmail.com diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml deleted file mode 100644 index 4f3d7ab..0000000 --- a/android/AndroidManifest.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - diff --git a/assets/data/mtx/samples/core/bgmtx.jpg b/android/assets/data/mtx/samples/core/bgmtx.jpg similarity index 100% rename from assets/data/mtx/samples/core/bgmtx.jpg rename to android/assets/data/mtx/samples/core/bgmtx.jpg diff --git a/assets/data/mtx/samples/core/font2.fnt b/android/assets/data/mtx/samples/core/font2.fnt similarity index 100% rename from assets/data/mtx/samples/core/font2.fnt rename to android/assets/data/mtx/samples/core/font2.fnt diff --git a/assets/data/mtx/samples/core/font2.png b/android/assets/data/mtx/samples/core/font2.png similarity index 100% rename from assets/data/mtx/samples/core/font2.png rename to android/assets/data/mtx/samples/core/font2.png diff --git a/assets/data/mtx/samples/core/imageatlas.png b/android/assets/data/mtx/samples/core/imageatlas.png similarity index 100% rename from assets/data/mtx/samples/core/imageatlas.png rename to android/assets/data/mtx/samples/core/imageatlas.png diff --git a/assets/data/mtx/samples/core/imageatlas.txt b/android/assets/data/mtx/samples/core/imageatlas.txt similarity index 100% rename from assets/data/mtx/samples/core/imageatlas.txt rename to android/assets/data/mtx/samples/core/imageatlas.txt diff --git a/assets/data/mtx/samples/gameworld/imageatlas.png b/android/assets/data/mtx/samples/gameworld/imageatlas.png similarity index 100% rename from assets/data/mtx/samples/gameworld/imageatlas.png rename to android/assets/data/mtx/samples/gameworld/imageatlas.png diff --git a/assets/data/mtx/samples/gameworld/imageatlas.txt b/android/assets/data/mtx/samples/gameworld/imageatlas.txt similarity index 100% rename from assets/data/mtx/samples/gameworld/imageatlas.txt rename to android/assets/data/mtx/samples/gameworld/imageatlas.txt diff --git a/assets/data/mtx/samples/jungle/imageatlas.png b/android/assets/data/mtx/samples/jungle/imageatlas.png similarity index 100% rename from assets/data/mtx/samples/jungle/imageatlas.png rename to android/assets/data/mtx/samples/jungle/imageatlas.png diff --git a/assets/data/mtx/samples/jungle/imageatlas.txt b/android/assets/data/mtx/samples/jungle/imageatlas.txt similarity index 100% rename from assets/data/mtx/samples/jungle/imageatlas.txt rename to android/assets/data/mtx/samples/jungle/imageatlas.txt diff --git a/assets/libgdx-logo.png b/android/assets/libgdx-logo.png similarity index 100% rename from assets/libgdx-logo.png rename to android/assets/libgdx-logo.png diff --git a/assets/skin/default.fnt b/android/assets/skin/default.fnt similarity index 100% rename from assets/skin/default.fnt rename to android/assets/skin/default.fnt diff --git a/assets/skin/default.png b/android/assets/skin/default.png similarity index 100% rename from assets/skin/default.png rename to android/assets/skin/default.png diff --git a/assets/skin/uiskin.atlas b/android/assets/skin/uiskin.atlas similarity index 100% rename from assets/skin/uiskin.atlas rename to android/assets/skin/uiskin.atlas diff --git a/assets/skin/uiskin.json b/android/assets/skin/uiskin.json similarity index 100% rename from assets/skin/uiskin.json rename to android/assets/skin/uiskin.json diff --git a/assets/skin/uiskin.png b/android/assets/skin/uiskin.png similarity index 100% rename from assets/skin/uiskin.png rename to android/assets/skin/uiskin.png diff --git a/assets/skin/verdana39.fnt b/android/assets/skin/verdana39.fnt similarity index 100% rename from assets/skin/verdana39.fnt rename to android/assets/skin/verdana39.fnt diff --git a/assets/skin/verdana39.png b/android/assets/skin/verdana39.png similarity index 100% rename from assets/skin/verdana39.png rename to android/assets/skin/verdana39.png diff --git a/android/default.properties b/android/default.properties deleted file mode 100644 index a42154d..0000000 --- a/android/default.properties +++ /dev/null @@ -1,11 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "build.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-17 diff --git a/android/pom.xml b/android/pom.xml deleted file mode 100644 index 0961ddc..0000000 --- a/android/pom.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - 4.0.0 - - com.moribitotech - mtx - 1.0-SNAPSHOT - - - mtx-android - apk - Main Android - - - game.keystore - game - - - ${keystore.password} - - - - - com.moribitotech - mtx-core - ${project.version} - - - - com.badlogicgames.gdx - gdx-backend-android - ${gdx.version} - - - - com.badlogicgames.gdx - gdx-platform - ${gdx.version} - natives-armeabi - provided - - - com.badlogicgames.gdx - gdx-platform - ${gdx.version} - natives-armeabi-v7a - provided - - - - com.google.android - android - ${android.version} - provided - - - - - - ${project.artifactId} - - - - - com.googlecode.mavennatives - maven-nativedependencies-plugin - 0.0.7 - - libs - true - - - - prepare-package - - copy - - - - - - - - com.jayway.maven.plugins.android.generation2 - android-maven-plugin - ${android.maven.version} - - ${project.basedir}/AndroidManifest.xml - ${project.basedir}/../assets - ${project.basedir}/res - - 17 - - true - - - -Xmx1024m - - - - true - - - deploy-on-install - install - - deploy - - - - - - - - - - - sign - - - - org.apache.maven.plugins - maven-jarsigner-plugin - 1.2 - - - signing - sign - package - true - - - - target/*.apk - - ${keystore.path} - ${keystore.password} - ${key.password} - ${keystore.alias} - - -sigalgMD5withRSA - -digestalgSHA1 - - - - - - - com.jayway.maven.plugins.android.generation2 - android-maven-plugin - true - - false - false - - - - alignApk - package - zipalign - - - - - - - - diff --git a/android/proguard.cfg b/android/proguard.cfg deleted file mode 100644 index f86a4cf..0000000 --- a/android/proguard.cfg +++ /dev/null @@ -1,34 +0,0 @@ --optimizationpasses 5 --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --dontpreverify --verbose --optimizations !code/simplification/arithmetic,!field/*,!class/merging/* - --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class com.android.vending.licensing.ILicensingService - --keepclasseswithmembernames class * { - native ; -} - --keepclasseswithmembernames class * { - public (android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembernames class * { - public (android.content.Context, android.util.AttributeSet, int); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} diff --git a/android/res/drawable-hdpi/icon.png b/android/res/drawable-hdpi/icon.png deleted file mode 100644 index 5801ed0..0000000 Binary files a/android/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/android/res/drawable-ldpi/icon.png b/android/res/drawable-ldpi/icon.png deleted file mode 100644 index bd0e62f..0000000 Binary files a/android/res/drawable-ldpi/icon.png and /dev/null differ diff --git a/android/res/drawable-mdpi/icon.png b/android/res/drawable-mdpi/icon.png deleted file mode 100644 index dbf9396..0000000 Binary files a/android/res/drawable-mdpi/icon.png and /dev/null differ diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml deleted file mode 100644 index 177afbd..0000000 --- a/android/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - Main - diff --git a/android/src/main/java/com/moribitotech/mtx/MainActivity.java b/android/src/main/java/com/moribitotech/mtx/MainActivity.java deleted file mode 100644 index ab5f1e3..0000000 --- a/android/src/main/java/com/moribitotech/mtx/MainActivity.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.moribitotech.mtx; - -import android.os.Bundle; - -import com.badlogic.gdx.backends.android.AndroidApplication; -import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; - -public class MainActivity extends AndroidApplication { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration(); - cfg.useGL20 = true; - - initialize(new MainStarter(), cfg); - } -} \ No newline at end of file diff --git a/android/src/main/java/com/moribitotech/samples/core/MainActivity.java b/android/src/main/java/com/moribitotech/samples/core/MainActivity.java deleted file mode 100644 index 3410ca6..0000000 --- a/android/src/main/java/com/moribitotech/samples/core/MainActivity.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.moribitotech.samples.core; - -import android.os.Bundle; - -import com.badlogic.gdx.backends.android.AndroidApplication; -import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; -import com.moribitotech.samples.core.testmain.TestMtxMainGame; - -public class MainActivity extends AndroidApplication { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration(); - cfg.useGL20 = true; - - initialize(new TestMtxMainGame(), cfg); - } -} \ No newline at end of file diff --git a/android/src/main/java/com/moribitotech/samples/gameworld/MainActivity.java b/android/src/main/java/com/moribitotech/samples/gameworld/MainActivity.java deleted file mode 100644 index 27dec33..0000000 --- a/android/src/main/java/com/moribitotech/samples/gameworld/MainActivity.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.moribitotech.samples.gameworld; - -import android.os.Bundle; -import com.badlogic.gdx.backends.android.AndroidApplication; -import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; - -public class MainActivity extends AndroidApplication { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration(); - cfg.useGL20 = true; - - initialize(new MainStarter(), cfg); - } -} \ No newline at end of file diff --git a/android/src/main/java/com/moribitotech/samples/jungle/MainActivity.java b/android/src/main/java/com/moribitotech/samples/jungle/MainActivity.java deleted file mode 100644 index aebc09f..0000000 --- a/android/src/main/java/com/moribitotech/samples/jungle/MainActivity.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.moribitotech.samples.jungle; - -import android.os.Bundle; - -import com.badlogic.gdx.backends.android.AndroidApplication; -import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; - -public class MainActivity extends AndroidApplication { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration(); - cfg.useGL20 = false; - - initialize(new MainStarter(), cfg); - } -} \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..bbc0c2d --- /dev/null +++ b/build.gradle @@ -0,0 +1,57 @@ +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.0.0' + classpath 'org.robovm:robovm-gradle-plugin:1.0.0-beta-04' + } +} + +allprojects { + apply plugin: "eclipse" + apply plugin: "idea" + + version = '1.0' + ext { + appName = 'MTX-Update' + gdxVersion = '1.5.4' + roboVMVersion = '1.0.0-beta-04' + box2DLightsVersion = '1.3' + ashleyVersion = '1.3.1' + aiVersion = '1.5.0' + } + + repositories { + mavenCentral() + maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } + maven { url "https://oss.sonatype.org/content/repositories/releases/" } + } +} + +project(":desktop") { + apply plugin: "java" + + + dependencies { + compile project(":core") + compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion" + compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" + compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop" + } +} + + +project(":core") { + apply plugin: "java" + + + dependencies { + compile "com.badlogicgames.gdx:gdx:$gdxVersion" + compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" + } +} + +tasks.eclipse.doLast { + delete ".project" +} \ No newline at end of file diff --git a/core/build.gradle b/core/build.gradle new file mode 100644 index 0000000..03cd1be --- /dev/null +++ b/core/build.gradle @@ -0,0 +1,11 @@ +apply plugin: "java" + +sourceCompatibility = 1.6 +[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' + +sourceSets.main.java.srcDirs = [ "src/" ] + + +eclipse.project { + name = appName + "-core" +} diff --git a/core/gdx-tools.jar b/core/gdx-tools.jar new file mode 100644 index 0000000..8a517df Binary files /dev/null and b/core/gdx-tools.jar differ diff --git a/core/pom.xml b/core/pom.xml deleted file mode 100644 index 17e45c3..0000000 --- a/core/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - 4.0.0 - - com.moribitotech - mtx - 1.0-SNAPSHOT - - - mtx-core - jar - Main Core - - - - com.badlogicgames.gdx - gdx - ${gdx.version} - - - - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - generate-resources - - jar-no-fork - - - - - - - diff --git a/core/src/main/java/com/moribitotech/mtx/MainStarter.java b/core/src/com/moribitotech/mtx/MainStarter.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/MainStarter.java rename to core/src/com/moribitotech/mtx/MainStarter.java diff --git a/core/src/main/java/com/moribitotech/mtx/android/IAdController.java b/core/src/com/moribitotech/mtx/android/IAdController.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/android/IAdController.java rename to core/src/com/moribitotech/mtx/android/IAdController.java diff --git a/core/src/main/java/com/moribitotech/mtx/android/IAdControllerAdMob.java b/core/src/com/moribitotech/mtx/android/IAdControllerAdMob.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/android/IAdControllerAdMob.java rename to core/src/com/moribitotech/mtx/android/IAdControllerAdMob.java diff --git a/core/src/main/java/com/moribitotech/mtx/android/IAdControllerAirpush.java b/core/src/com/moribitotech/mtx/android/IAdControllerAirpush.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/android/IAdControllerAirpush.java rename to core/src/com/moribitotech/mtx/android/IAdControllerAirpush.java diff --git a/core/src/main/java/com/moribitotech/mtx/android/IAdControllerAppBrain.java b/core/src/com/moribitotech/mtx/android/IAdControllerAppBrain.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/android/IAdControllerAppBrain.java rename to core/src/com/moribitotech/mtx/android/IAdControllerAppBrain.java diff --git a/core/src/main/java/com/moribitotech/mtx/android/IAdControllerLeadbolt.java b/core/src/com/moribitotech/mtx/android/IAdControllerLeadbolt.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/android/IAdControllerLeadbolt.java rename to core/src/com/moribitotech/mtx/android/IAdControllerLeadbolt.java diff --git a/core/src/main/java/com/moribitotech/mtx/android/IAdControllerTapjoy.java b/core/src/com/moribitotech/mtx/android/IAdControllerTapjoy.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/android/IAdControllerTapjoy.java rename to core/src/com/moribitotech/mtx/android/IAdControllerTapjoy.java diff --git a/core/src/main/java/com/moribitotech/mtx/android/IAndroidIntents.java b/core/src/com/moribitotech/mtx/android/IAndroidIntents.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/android/IAndroidIntents.java rename to core/src/com/moribitotech/mtx/android/IAndroidIntents.java diff --git a/core/src/main/java/com/moribitotech/mtx/android/IAndroidObject.java b/core/src/com/moribitotech/mtx/android/IAndroidObject.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/android/IAndroidObject.java rename to core/src/com/moribitotech/mtx/android/IAndroidObject.java diff --git a/core/src/main/java/com/moribitotech/mtx/android/IOpenFeint.java b/core/src/com/moribitotech/mtx/android/IOpenFeint.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/android/IOpenFeint.java rename to core/src/com/moribitotech/mtx/android/IOpenFeint.java diff --git a/core/src/main/java/com/moribitotech/mtx/android/IScoreLoop.java b/core/src/com/moribitotech/mtx/android/IScoreLoop.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/android/IScoreLoop.java rename to core/src/com/moribitotech/mtx/android/IScoreLoop.java diff --git a/core/src/main/java/com/moribitotech/mtx/android/ISwarm.java b/core/src/com/moribitotech/mtx/android/ISwarm.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/android/ISwarm.java rename to core/src/com/moribitotech/mtx/android/ISwarm.java diff --git a/core/src/main/java/com/moribitotech/mtx/animation/AnimationCreator.java b/core/src/com/moribitotech/mtx/animation/AnimationCreator.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/animation/AnimationCreator.java rename to core/src/com/moribitotech/mtx/animation/AnimationCreator.java diff --git a/core/src/main/java/com/moribitotech/mtx/asset/AbstractAssets.java b/core/src/com/moribitotech/mtx/asset/AbstractAssets.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/asset/AbstractAssets.java rename to core/src/com/moribitotech/mtx/asset/AbstractAssets.java diff --git a/core/src/main/java/com/moribitotech/mtx/game/AbstractGame.java b/core/src/com/moribitotech/mtx/game/AbstractGame.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/game/AbstractGame.java rename to core/src/com/moribitotech/mtx/game/AbstractGame.java diff --git a/core/src/main/java/com/moribitotech/mtx/game/AbstractGameManager.java b/core/src/com/moribitotech/mtx/game/AbstractGameManager.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/game/AbstractGameManager.java rename to core/src/com/moribitotech/mtx/game/AbstractGameManager.java diff --git a/core/src/main/java/com/moribitotech/mtx/game/GameState.java b/core/src/com/moribitotech/mtx/game/GameState.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/game/GameState.java rename to core/src/com/moribitotech/mtx/game/GameState.java diff --git a/core/src/main/java/com/moribitotech/mtx/input/InputIntent.java b/core/src/com/moribitotech/mtx/input/InputIntent.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/input/InputIntent.java rename to core/src/com/moribitotech/mtx/input/InputIntent.java diff --git a/core/src/main/java/com/moribitotech/mtx/interfaces/IAssets.java b/core/src/com/moribitotech/mtx/interfaces/IAssets.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/interfaces/IAssets.java rename to core/src/com/moribitotech/mtx/interfaces/IAssets.java diff --git a/core/src/main/java/com/moribitotech/mtx/interfaces/IAudioManager.java b/core/src/com/moribitotech/mtx/interfaces/IAudioManager.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/interfaces/IAudioManager.java rename to core/src/com/moribitotech/mtx/interfaces/IAudioManager.java diff --git a/core/src/main/java/com/moribitotech/mtx/interfaces/IGame.java b/core/src/com/moribitotech/mtx/interfaces/IGame.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/interfaces/IGame.java rename to core/src/com/moribitotech/mtx/interfaces/IGame.java diff --git a/core/src/main/java/com/moribitotech/mtx/interfaces/IGameManager.java b/core/src/com/moribitotech/mtx/interfaces/IGameManager.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/interfaces/IGameManager.java rename to core/src/com/moribitotech/mtx/interfaces/IGameManager.java diff --git a/core/src/main/java/com/moribitotech/mtx/interfaces/IGameScreen.java b/core/src/com/moribitotech/mtx/interfaces/IGameScreen.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/interfaces/IGameScreen.java rename to core/src/com/moribitotech/mtx/interfaces/IGameScreen.java diff --git a/core/src/main/java/com/moribitotech/mtx/interfaces/IGameSettingManager.java b/core/src/com/moribitotech/mtx/interfaces/IGameSettingManager.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/interfaces/IGameSettingManager.java rename to core/src/com/moribitotech/mtx/interfaces/IGameSettingManager.java diff --git a/core/src/main/java/com/moribitotech/mtx/interfaces/IScreen.java b/core/src/com/moribitotech/mtx/interfaces/IScreen.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/interfaces/IScreen.java rename to core/src/com/moribitotech/mtx/interfaces/IScreen.java diff --git a/core/src/main/java/com/moribitotech/mtx/interfaces/IScreenLoading.java b/core/src/com/moribitotech/mtx/interfaces/IScreenLoading.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/interfaces/IScreenLoading.java rename to core/src/com/moribitotech/mtx/interfaces/IScreenLoading.java diff --git a/core/src/main/java/com/moribitotech/mtx/managers/AudioManager.java b/core/src/com/moribitotech/mtx/managers/AudioManager.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/managers/AudioManager.java rename to core/src/com/moribitotech/mtx/managers/AudioManager.java diff --git a/core/src/main/java/com/moribitotech/mtx/managers/BenchmarkManager.java b/core/src/com/moribitotech/mtx/managers/BenchmarkManager.java similarity index 96% rename from core/src/main/java/com/moribitotech/mtx/managers/BenchmarkManager.java rename to core/src/com/moribitotech/mtx/managers/BenchmarkManager.java index ac2e0e9..9a5beee 100644 --- a/core/src/main/java/com/moribitotech/mtx/managers/BenchmarkManager.java +++ b/core/src/com/moribitotech/mtx/managers/BenchmarkManager.java @@ -74,11 +74,11 @@ private void setUpBencmarks() { labelRunTime = new Label(getRunTime(), style); labelFps = new Label(getFPS(), style); // - table.add().row().left(); - table.add(labelResolution).row().left(); - table.add(labelRunTime).row().left(); - table.add(labelFps).row().left(); - table.add().left(); + table.add().row(); + table.add(labelResolution).row(); + table.add(labelRunTime).row(); + table.add(labelFps).row(); + table.add(); } /** diff --git a/core/src/main/java/com/moribitotech/mtx/managers/FileManager.java b/core/src/com/moribitotech/mtx/managers/FileManager.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/managers/FileManager.java rename to core/src/com/moribitotech/mtx/managers/FileManager.java diff --git a/core/src/main/java/com/moribitotech/mtx/managers/MusicManager.java b/core/src/com/moribitotech/mtx/managers/MusicManager.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/managers/MusicManager.java rename to core/src/com/moribitotech/mtx/managers/MusicManager.java diff --git a/core/src/main/java/com/moribitotech/mtx/managers/SettingsManager.java b/core/src/com/moribitotech/mtx/managers/SettingsManager.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/managers/SettingsManager.java rename to core/src/com/moribitotech/mtx/managers/SettingsManager.java diff --git a/core/src/main/java/com/moribitotech/mtx/managers/TiltManager.java b/core/src/com/moribitotech/mtx/managers/TiltManager.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/managers/TiltManager.java rename to core/src/com/moribitotech/mtx/managers/TiltManager.java diff --git a/core/src/main/java/com/moribitotech/mtx/managers/VibrationManager.java b/core/src/com/moribitotech/mtx/managers/VibrationManager.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/managers/VibrationManager.java rename to core/src/com/moribitotech/mtx/managers/VibrationManager.java diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/AbstractActor.java b/core/src/com/moribitotech/mtx/scene2d/AbstractActor.java similarity index 98% rename from core/src/main/java/com/moribitotech/mtx/scene2d/AbstractActor.java rename to core/src/com/moribitotech/mtx/scene2d/AbstractActor.java index ba900e5..6e25333 100644 --- a/core/src/main/java/com/moribitotech/mtx/scene2d/AbstractActor.java +++ b/core/src/com/moribitotech/mtx/scene2d/AbstractActor.java @@ -18,6 +18,7 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.g2d.Animation; +import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.ParticleEffect; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; @@ -117,7 +118,7 @@ public void act(float delta) { } @Override - public void draw(SpriteBatch batch, float parentAlpha) { + public void draw(Batch batch, float parentAlpha) { super.draw(batch, parentAlpha); // For fade out/in effect batch.setColor(this.getColor().r, this.getColor().g, this.getColor().b, @@ -309,7 +310,7 @@ public void setAnimationMomentary(Animation animationMomentary, if (!isAnimationMomentaryWaitingToBeCompleted) { this.animationMomentary = animationMomentary; - this.animationMomentary.setPlayMode(Animation.NORMAL); + this.animationMomentary.setPlayMode(Animation.PlayMode.NORMAL); this.isAnimationMomentaryActive = isAnimationMomentaryActive; // if (isAnimationMomentaryActive) { @@ -320,7 +321,7 @@ public void setAnimationMomentary(Animation animationMomentary, } else { if (isAnimationMomentaryFinished) { this.animationMomentary = animationMomentary; - this.animationMomentary.setPlayMode(Animation.NORMAL); + this.animationMomentary.setPlayMode(Animation.PlayMode.NORMAL); this.isAnimationMomentaryActive = isAnimationMomentaryActive; // if (isAnimationMomentaryActive) { diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/AbstractActorLight.java b/core/src/com/moribitotech/mtx/scene2d/AbstractActorLight.java similarity index 98% rename from core/src/main/java/com/moribitotech/mtx/scene2d/AbstractActorLight.java rename to core/src/com/moribitotech/mtx/scene2d/AbstractActorLight.java index 0995a3e..93827fa 100644 --- a/core/src/main/java/com/moribitotech/mtx/scene2d/AbstractActorLight.java +++ b/core/src/com/moribitotech/mtx/scene2d/AbstractActorLight.java @@ -16,7 +16,7 @@ package com.moribitotech.mtx.scene2d; -import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.actions.MoveByAction; @@ -87,7 +87,7 @@ public void act(float delta) { } @Override - public void draw(SpriteBatch batch, float parentAlpha) { + public void draw(Batch batch, float parentAlpha) { super.draw(batch, parentAlpha); // For fade out/in effect batch.setColor(this.getColor().r, this.getColor().g, this.getColor().b, diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/AbstractGroup.java b/core/src/com/moribitotech/mtx/scene2d/AbstractGroup.java similarity index 98% rename from core/src/main/java/com/moribitotech/mtx/scene2d/AbstractGroup.java rename to core/src/com/moribitotech/mtx/scene2d/AbstractGroup.java index 9230450..6148ffa 100644 --- a/core/src/main/java/com/moribitotech/mtx/scene2d/AbstractGroup.java +++ b/core/src/com/moribitotech/mtx/scene2d/AbstractGroup.java @@ -18,8 +18,8 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.g2d.Animation; +import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.ParticleEffect; -import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.scenes.scene2d.Group; import com.moribitotech.mtx.settings.AppSettings; @@ -113,7 +113,7 @@ public void act(float delta) { } @Override - public void draw(SpriteBatch batch, float parentAlpha) { + public void draw(Batch batch, float parentAlpha) { super.draw(batch, parentAlpha); // For fade out/in effect batch.setColor(this.getColor().r, this.getColor().g, this.getColor().b, @@ -305,7 +305,7 @@ public void setAnimationMomentary(Animation animationMomentary, if (!isAnimationMomentaryWaitingToBeCompleted) { this.animationMomentary = animationMomentary; - this.animationMomentary.setPlayMode(Animation.NORMAL); + this.animationMomentary.setPlayMode(Animation.PlayMode.NORMAL); this.isAnimationMomentaryActive = isAnimationMomentaryActive; if (isAnimationMomentaryActive) { stateTime = 0; @@ -315,7 +315,7 @@ public void setAnimationMomentary(Animation animationMomentary, } else { if (isAnimationMomentaryFinished) { this.animationMomentary = animationMomentary; - this.animationMomentary.setPlayMode(Animation.NORMAL); + this.animationMomentary.setPlayMode(Animation.PlayMode.NORMAL); this.isAnimationMomentaryActive = isAnimationMomentaryActive; // if (isAnimationMomentaryActive) { diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/AbstractGroupLight.java b/core/src/com/moribitotech/mtx/scene2d/AbstractGroupLight.java similarity index 97% rename from core/src/main/java/com/moribitotech/mtx/scene2d/AbstractGroupLight.java rename to core/src/com/moribitotech/mtx/scene2d/AbstractGroupLight.java index 855f1f4..c465e10 100644 --- a/core/src/main/java/com/moribitotech/mtx/scene2d/AbstractGroupLight.java +++ b/core/src/com/moribitotech/mtx/scene2d/AbstractGroupLight.java @@ -16,7 +16,7 @@ package com.moribitotech.mtx.scene2d; -import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.scenes.scene2d.Group; import com.moribitotech.mtx.settings.AppSettings; @@ -76,7 +76,7 @@ public AbstractGroupLight() { } @Override - public void draw(SpriteBatch batch, float parentAlpha) { + public void draw(Batch batch, float parentAlpha) { super.draw(batch, parentAlpha); // For fade out/in effect batch.setColor(this.getColor().r, this.getColor().g, this.getColor().b, diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/AbstractWorldScene2d.java b/core/src/com/moribitotech/mtx/scene2d/AbstractWorldScene2d.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/scene2d/AbstractWorldScene2d.java rename to core/src/com/moribitotech/mtx/scene2d/AbstractWorldScene2d.java diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/collision/CollisionDetector.java b/core/src/com/moribitotech/mtx/scene2d/collision/CollisionDetector.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/scene2d/collision/CollisionDetector.java rename to core/src/com/moribitotech/mtx/scene2d/collision/CollisionDetector.java diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/effects/EffectCreator.java b/core/src/com/moribitotech/mtx/scene2d/effects/EffectCreator.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/scene2d/effects/EffectCreator.java rename to core/src/com/moribitotech/mtx/scene2d/effects/EffectCreator.java diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/models/EmptyActor.java b/core/src/com/moribitotech/mtx/scene2d/models/EmptyActor.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/scene2d/models/EmptyActor.java rename to core/src/com/moribitotech/mtx/scene2d/models/EmptyActor.java diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/models/EmptyActorLight.java b/core/src/com/moribitotech/mtx/scene2d/models/EmptyActorLight.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/scene2d/models/EmptyActorLight.java rename to core/src/com/moribitotech/mtx/scene2d/models/EmptyActorLight.java diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/models/EmptyGroup.java b/core/src/com/moribitotech/mtx/scene2d/models/EmptyGroup.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/scene2d/models/EmptyGroup.java rename to core/src/com/moribitotech/mtx/scene2d/models/EmptyGroup.java diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/models/EmptyGroupLight.java b/core/src/com/moribitotech/mtx/scene2d/models/EmptyGroupLight.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/scene2d/models/EmptyGroupLight.java rename to core/src/com/moribitotech/mtx/scene2d/models/EmptyGroupLight.java diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/models/SmartActor.java b/core/src/com/moribitotech/mtx/scene2d/models/SmartActor.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/scene2d/models/SmartActor.java rename to core/src/com/moribitotech/mtx/scene2d/models/SmartActor.java diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/models/SmartGroup.java b/core/src/com/moribitotech/mtx/scene2d/models/SmartGroup.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/scene2d/models/SmartGroup.java rename to core/src/com/moribitotech/mtx/scene2d/models/SmartGroup.java diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/ui/AbstractButton.java b/core/src/com/moribitotech/mtx/scene2d/ui/AbstractButton.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/scene2d/ui/AbstractButton.java rename to core/src/com/moribitotech/mtx/scene2d/ui/AbstractButton.java diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/ui/ButtonGame.java b/core/src/com/moribitotech/mtx/scene2d/ui/ButtonGame.java similarity index 82% rename from core/src/main/java/com/moribitotech/mtx/scene2d/ui/ButtonGame.java rename to core/src/com/moribitotech/mtx/scene2d/ui/ButtonGame.java index 86beaa8..08765bd 100644 --- a/core/src/main/java/com/moribitotech/mtx/scene2d/ui/ButtonGame.java +++ b/core/src/com/moribitotech/mtx/scene2d/ui/ButtonGame.java @@ -16,11 +16,9 @@ package com.moribitotech.mtx.scene2d.ui; - +import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; - - import com.badlogic.gdx.scenes.scene2d.utils.Drawable; public class ButtonGame extends AbstractButton { @@ -35,7 +33,7 @@ public ButtonGame(BitmapFont bitMapFont, Drawable up, Drawable down, } @Override - public void draw(SpriteBatch batch, float parentAlpha) { + public void draw(Batch batch, float parentAlpha) { // If button locked // ################################################################## if (isLockActive && textureLocked != null) { @@ -58,17 +56,19 @@ else if (text != "" && bitMapFont != null && isTextActive) { } } - private void drawExternalTexture(SpriteBatch batch) { - if(isExternalTextureActive && textureExternal != null){ - batch.draw(textureExternal, getX() + externalTexturePosX, getY() + externalTexturePosY, externalTextureSizeW, externalTextureSizeH); + private void drawExternalTexture(Batch batch) { + if (isExternalTextureActive && textureExternal != null) { + batch.draw(textureExternal, getX() + externalTexturePosX, getY() + + externalTexturePosY, externalTextureSizeW, + externalTextureSizeH); } } - private void drawLocked(SpriteBatch batch) { + private void drawLocked(Batch batch) { batch.draw(textureLocked, getX(), getY(), getWidth(), getHeight()); } - - private void drawText(SpriteBatch batch) { - bitMapFont.draw(batch, text, getX() + textPosX, getY() + textPosY); + + private void drawText(Batch batch) { + bitMapFont.draw(batch, text, getX() + textPosX, getY() + textPosY); } } diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/ui/ButtonLight.java b/core/src/com/moribitotech/mtx/scene2d/ui/ButtonLight.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/scene2d/ui/ButtonLight.java rename to core/src/com/moribitotech/mtx/scene2d/ui/ButtonLight.java diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/ui/ButtonSlider.java b/core/src/com/moribitotech/mtx/scene2d/ui/ButtonSlider.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/scene2d/ui/ButtonSlider.java rename to core/src/com/moribitotech/mtx/scene2d/ui/ButtonSlider.java diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/ui/ButtonToggle.java b/core/src/com/moribitotech/mtx/scene2d/ui/ButtonToggle.java similarity index 94% rename from core/src/main/java/com/moribitotech/mtx/scene2d/ui/ButtonToggle.java rename to core/src/com/moribitotech/mtx/scene2d/ui/ButtonToggle.java index 1be68e3..440da03 100644 --- a/core/src/main/java/com/moribitotech/mtx/scene2d/ui/ButtonToggle.java +++ b/core/src/com/moribitotech/mtx/scene2d/ui/ButtonToggle.java @@ -16,6 +16,7 @@ package com.moribitotech.mtx.scene2d.ui; +import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; @@ -49,7 +50,7 @@ public ButtonToggle(BitmapFont bitMapFont, Drawable up, Drawable down, } @Override - public void draw(SpriteBatch batch, float parentAlpha) { + public void draw(Batch batch, float parentAlpha) { // If button locked // ################################################################## if (isToggleActive && textureLocked != null) { @@ -90,7 +91,7 @@ public Actor hit(float x, float y, boolean t) { } } - private void drawToggle(SpriteBatch batch) { + private void drawToggle(Batch batch) { if (isToggleActive) { batch.draw(textureToggleOn, getX(), getY(), getWidth(), getHeight()); } else { @@ -100,7 +101,7 @@ private void drawToggle(SpriteBatch batch) { } } - private void drawExternalTexture(SpriteBatch batch) { + private void drawExternalTexture(Batch batch) { if (isExternalTextureActive && textureExternal != null) { batch.draw(textureExternal, getX() + externalTexturePosX, getY() + externalTexturePosY, externalTextureSizeW, @@ -108,11 +109,11 @@ private void drawExternalTexture(SpriteBatch batch) { } } - private void drawLocked(SpriteBatch batch) { + private void drawLocked(Batch batch) { batch.draw(textureLocked, getX(), getY(), getWidth(), getHeight()); } - private void drawText(SpriteBatch batch) { + private void drawText(Batch batch) { bitMapFont.draw(batch, text, getX() + textPosX, getY() + textPosY); } diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/ui/MenuCreator.java b/core/src/com/moribitotech/mtx/scene2d/ui/MenuCreator.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/scene2d/ui/MenuCreator.java rename to core/src/com/moribitotech/mtx/scene2d/ui/MenuCreator.java diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/ui/TableModel.java b/core/src/com/moribitotech/mtx/scene2d/ui/TableModel.java similarity index 95% rename from core/src/main/java/com/moribitotech/mtx/scene2d/ui/TableModel.java rename to core/src/com/moribitotech/mtx/scene2d/ui/TableModel.java index 485a08c..56e8fa5 100644 --- a/core/src/main/java/com/moribitotech/mtx/scene2d/ui/TableModel.java +++ b/core/src/com/moribitotech/mtx/scene2d/ui/TableModel.java @@ -16,12 +16,12 @@ package com.moribitotech.mtx.scene2d.ui; -import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.scenes.scene2d.Actor; +import com.badlogic.gdx.scenes.scene2d.ui.Cell; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.Table; -import com.esotericsoftware.tablelayout.Cell; import com.moribitotech.mtx.settings.AppSettings; public class TableModel extends Table { @@ -103,7 +103,7 @@ public Cell add(Actor actor, float width, float height, boolean DIPActive) { } @Override - public void draw(SpriteBatch batch, float parentAlpha) { + public void draw(Batch batch, float parentAlpha) { // Then draw child actors over bg super.draw(batch, parentAlpha); diff --git a/core/src/main/java/com/moribitotech/mtx/scene2d/ui/Text.java b/core/src/com/moribitotech/mtx/scene2d/ui/Text.java similarity index 93% rename from core/src/main/java/com/moribitotech/mtx/scene2d/ui/Text.java rename to core/src/com/moribitotech/mtx/scene2d/ui/Text.java index b0bb748..740af4e 100644 --- a/core/src/main/java/com/moribitotech/mtx/scene2d/ui/Text.java +++ b/core/src/com/moribitotech/mtx/scene2d/ui/Text.java @@ -16,6 +16,7 @@ package com.moribitotech.mtx.scene2d.ui; +import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.moribitotech.mtx.scene2d.AbstractActorLight; @@ -46,13 +47,13 @@ public void setBitMapFont(BitmapFont bitMapFont, boolean DIPActive) { } @Override - public void draw(SpriteBatch batch, float parentAlpha) { + public void draw(Batch batch, float parentAlpha) { super.draw(batch, parentAlpha); // drawText(batch); } - private void drawText(SpriteBatch batch) { + private void drawText(Batch batch) { if (bitMapFont != null) { bitMapFont.draw(batch, text, getX(), getY()); } diff --git a/core/src/main/java/com/moribitotech/mtx/screen/AbstractScreen.java b/core/src/com/moribitotech/mtx/screen/AbstractScreen.java similarity index 94% rename from core/src/main/java/com/moribitotech/mtx/screen/AbstractScreen.java rename to core/src/com/moribitotech/mtx/screen/AbstractScreen.java index dfc7366..c34b1cd 100644 --- a/core/src/main/java/com/moribitotech/mtx/screen/AbstractScreen.java +++ b/core/src/com/moribitotech/mtx/screen/AbstractScreen.java @@ -29,6 +29,8 @@ import com.badlogic.gdx.scenes.scene2d.utils.Drawable; import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable; import com.badlogic.gdx.utils.Scaling; +import com.badlogic.gdx.utils.viewport.ScreenViewport; +import com.badlogic.gdx.utils.viewport.Viewport; import com.moribitotech.mtx.game.AbstractGame; import com.moribitotech.mtx.settings.AppSettings; import com.moribitotech.mtx.settings.MtxLogger; @@ -91,10 +93,14 @@ public AbstractScreen(AbstractGame game, String screenName) { + "AppSettings.setUp() not called anywhere, Stage size will be 0,0"); } // - stage = new Stage(AppSettings.SCREEN_W, AppSettings.SCREEN_H, false); - stage.getCamera().position.set(AppSettings.SCREEN_W / 2, - AppSettings.SCREEN_H / 2, 0); - + // stage = new Stage(AppSettings.SCREEN_W, AppSettings.SCREEN_H, false); + // i'm luyentm, fix this bug + // stage.getCamera().position.set(AppSettings.SCREEN_W / 2, + // AppSettings.SCREEN_H / 2, 0);\ + Viewport luyentmViewPort = new ScreenViewport(); + luyentmViewPort.setScreenSize((int) AppSettings.SCREEN_W, + (int) AppSettings.SCREEN_H); + stage = new Stage(luyentmViewPort); // Receive inputs from stage Gdx.input.setInputProcessor(stage); diff --git a/core/src/main/java/com/moribitotech/mtx/screen/AbstractScreenLoading.java b/core/src/com/moribitotech/mtx/screen/AbstractScreenLoading.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/screen/AbstractScreenLoading.java rename to core/src/com/moribitotech/mtx/screen/AbstractScreenLoading.java diff --git a/core/src/main/java/com/moribitotech/mtx/settings/AppSettings.java b/core/src/com/moribitotech/mtx/settings/AppSettings.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/settings/AppSettings.java rename to core/src/com/moribitotech/mtx/settings/AppSettings.java diff --git a/core/src/main/java/com/moribitotech/mtx/settings/MtxLogger.java b/core/src/com/moribitotech/mtx/settings/MtxLogger.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/settings/MtxLogger.java rename to core/src/com/moribitotech/mtx/settings/MtxLogger.java diff --git a/core/src/main/java/com/moribitotech/mtx/utils/UtilsActor.java b/core/src/com/moribitotech/mtx/utils/UtilsActor.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/utils/UtilsActor.java rename to core/src/com/moribitotech/mtx/utils/UtilsActor.java diff --git a/core/src/main/java/com/moribitotech/mtx/utils/UtilsAssets.java b/core/src/com/moribitotech/mtx/utils/UtilsAssets.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/utils/UtilsAssets.java rename to core/src/com/moribitotech/mtx/utils/UtilsAssets.java diff --git a/core/src/main/java/com/moribitotech/mtx/utils/UtilsDevice.java b/core/src/com/moribitotech/mtx/utils/UtilsDevice.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/utils/UtilsDevice.java rename to core/src/com/moribitotech/mtx/utils/UtilsDevice.java diff --git a/core/src/main/java/com/moribitotech/mtx/utils/UtilsDisposer.java b/core/src/com/moribitotech/mtx/utils/UtilsDisposer.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/utils/UtilsDisposer.java rename to core/src/com/moribitotech/mtx/utils/UtilsDisposer.java diff --git a/core/src/main/java/com/moribitotech/mtx/utils/UtilsNumbers.java b/core/src/com/moribitotech/mtx/utils/UtilsNumbers.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/utils/UtilsNumbers.java rename to core/src/com/moribitotech/mtx/utils/UtilsNumbers.java diff --git a/core/src/main/java/com/moribitotech/mtx/utils/UtilsOrigin.java b/core/src/com/moribitotech/mtx/utils/UtilsOrigin.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/utils/UtilsOrigin.java rename to core/src/com/moribitotech/mtx/utils/UtilsOrigin.java diff --git a/core/src/main/java/com/moribitotech/mtx/utils/UtilsPositioner.java b/core/src/com/moribitotech/mtx/utils/UtilsPositioner.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/utils/UtilsPositioner.java rename to core/src/com/moribitotech/mtx/utils/UtilsPositioner.java diff --git a/core/src/main/java/com/moribitotech/mtx/utils/UtilsRandomizer.java b/core/src/com/moribitotech/mtx/utils/UtilsRandomizer.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/utils/UtilsRandomizer.java rename to core/src/com/moribitotech/mtx/utils/UtilsRandomizer.java diff --git a/core/src/main/java/com/moribitotech/mtx/utils/UtilsString.java b/core/src/com/moribitotech/mtx/utils/UtilsString.java similarity index 100% rename from core/src/main/java/com/moribitotech/mtx/utils/UtilsString.java rename to core/src/com/moribitotech/mtx/utils/UtilsString.java diff --git a/core/src/main/java/com/moribitotech/samples/core/ButtonLevel.java b/core/src/com/moribitotech/samples/core/ButtonLevel.java similarity index 66% rename from core/src/main/java/com/moribitotech/samples/core/ButtonLevel.java rename to core/src/com/moribitotech/samples/core/ButtonLevel.java index 370c84f..aac0e69 100644 --- a/core/src/main/java/com/moribitotech/samples/core/ButtonLevel.java +++ b/core/src/com/moribitotech/samples/core/ButtonLevel.java @@ -1,5 +1,6 @@ package com.moribitotech.samples.core; +import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; @@ -12,8 +13,8 @@ public class ButtonLevel extends AbstractButton { private TextureRegion textureStarHolder; private TextureRegion textureStar; private int numberOfTotalStars = 1; - private int numberOfEarnedStars = 1; - private float starSizeWidth; + private int numberOfEarnedStars = 1; + private float starSizeWidth; private float starSizeHeight; private float starPosXStart = 0; private float starPosYStart = 0; @@ -30,7 +31,7 @@ public ButtonLevel(Drawable up, Drawable down) { } @Override - public void draw(SpriteBatch batch, float parentAlpha) { + public void draw(Batch batch, float parentAlpha) { // If level locked // ################################################################## if (isLockActive && textureLocked != null) { @@ -57,90 +58,105 @@ else if (levelNumber != -999 && bitMapFont != null) { } } - private void drawStars(SpriteBatch batch) { - if(textureStarHolder != null && textureStar != null){ + private void drawStars(Batch batch) { + if (textureStarHolder != null && textureStar != null) { // Updated start positions - float activePosXStart = (getX() + getWidth() / 2) - ((starSizeWidth * numberOfTotalStars) / 2); - float activePoxYStart = (getY() + starSizeHeight / 1.3f); - + float activePosXStart = (getX() + getWidth() / 2) + - ((starSizeWidth * numberOfTotalStars) / 2); + float activePoxYStart = (getY() + starSizeHeight / 1.3f); + // Stars align together next by next (increase for each star) // S as Star // SSS (together aligned due to their widths) float currentPosX = getX(); - - for(int i = 0; i < numberOfTotalStars; i++){ + + for (int i = 0; i < numberOfTotalStars; i++) { // Update new star holder positions (for multiple stars) currentPosX = activePosXStart + (starSizeWidth * i); - batch.draw(textureStarHolder, currentPosX + starPosXStart, activePoxYStart + starPosYStart,starSizeWidth, starSizeHeight); + batch.draw(textureStarHolder, currentPosX + starPosXStart, + activePoxYStart + starPosYStart, starSizeWidth, + starSizeHeight); } - - for(int j = 0; j < numberOfEarnedStars; j++){ + + for (int j = 0; j < numberOfEarnedStars; j++) { // Update new star position (for multiple stars) currentPosX = activePosXStart + (starSizeWidth * j); - batch.draw(textureStar, currentPosX + starPosXStart, activePoxYStart + starPosYStart,starSizeWidth, starSizeHeight); + batch.draw(textureStar, currentPosX + starPosXStart, + activePoxYStart + starPosYStart, starSizeWidth, + starSizeHeight); } } } - - private void drawText(SpriteBatch batch) { - if(isTextActive && bitMapFont != null){ - bitMapFont.draw(batch, text, getX() + textPosX, getY() + textPosY); + + private void drawText(Batch batch) { + if (isTextActive && bitMapFont != null) { + bitMapFont.draw(batch, text, getX() + textPosX, getY() + textPosY); } } - private void drawLocked(SpriteBatch batch) { + private void drawLocked(Batch batch) { batch.draw(textureLocked, getX(), getY(), getWidth(), getHeight()); } - - private void drawExternalTexture(SpriteBatch batch) { - if(isExternalTextureActive && textureExternal != null){ - batch.draw(textureExternal, getX() + externalTexturePosX, getY() + externalTexturePosY, externalTextureSizeW, externalTextureSizeH); + + private void drawExternalTexture(Batch batch) { + if (isExternalTextureActive && textureExternal != null) { + batch.draw(textureExternal, getX() + externalTexturePosX, getY() + + externalTexturePosY, externalTextureSizeW, + externalTextureSizeH); } } - - private void drawLevelNumber(SpriteBatch batch) { + + private void drawLevelNumber(Batch batch) { // TODO Set precise position of level number for each game - // there i single numbers ( < 10) + // there i single numbers ( < 10) // there is double numbers (9 >) float singePositionArranger = 2.5f; float doublePositionArranger = 2.8f; - + if (levelNumber < 10) { - bitMapFont.draw(batch, "" + levelNumber, getX() + getWidth() / singePositionArranger, - getY() + getHeight() / 1.4f); + bitMapFont.draw(batch, "" + levelNumber, getX() + getWidth() + / singePositionArranger, getY() + getHeight() / 1.4f); } else { - bitMapFont.draw(batch, "" + levelNumber, getX() + getWidth() / doublePositionArranger, - getY() + getHeight() / 1.4f); + bitMapFont.draw(batch, "" + levelNumber, getX() + getWidth() + / doublePositionArranger, getY() + getHeight() / 1.4f); } } - + /** * Set level stars (It can be any other object) for level achievements *

* EXAMPLE
- * There are 5 stars maximum can be achieved, and user earned 3 stars. It auto calculates the position and sizes of stars due to - * button sizes. However further adjustment can be done (optinal) with "setLevelStarSizeRatio", "setLevelStarPosXStart" and "setLevelStarPosYStart". - * !!starHolderTexture and starTexture should be in same sizes!! + * There are 5 stars maximum can be achieved, and user earned 3 stars. It + * auto calculates the position and sizes of stars due to button sizes. + * However further adjustment can be done (optinal) with + * "setLevelStarSizeRatio", "setLevelStarPosXStart" and + * "setLevelStarPosYStart". !!starHolderTexture and starTexture should be in + * same sizes!! * - * @param starHolderTexture the holder texture for star or other achievement object. - * @param starTexture the texture for star or other achievement object. - * @param numberOfTotalStars number of total stars - * @param numberOfEarnedStars number of earned/achieved stars + * @param starHolderTexture + * the holder texture for star or other achievement object. + * @param starTexture + * the texture for star or other achievement object. + * @param numberOfTotalStars + * number of total stars + * @param numberOfEarnedStars + * number of earned/achieved stars * */ - public void setLevelStars(TextureRegion starHolderTexture, TextureRegion starTexture, int numberOfTotalStars, int numberOfEarnedStars){ + public void setLevelStars(TextureRegion starHolderTexture, + TextureRegion starTexture, int numberOfTotalStars, + int numberOfEarnedStars) { textureStarHolder = starHolderTexture; textureStar = starTexture; this.numberOfTotalStars = numberOfTotalStars; this.numberOfEarnedStars = numberOfEarnedStars; - + // float btnSizeW = getWidth() - (getWidth() / starSizeRatio); float btnSizeH = getHeight() - (getHeight() / starSizeRatio); starSizeWidth = btnSizeW / numberOfTotalStars; starSizeHeight = btnSizeH / numberOfTotalStars; } - - + /** * Get level starts X position * */ @@ -149,8 +165,8 @@ public float getLevelStarPosXStart() { } /** - * Set level stars X position. This is being calculated automaticly and centered. Do not suggest to play - * width. + * Set level stars X position. This is being calculated automaticly and + * centered. Do not suggest to play width. * */ public void setLevelStarPosXStart(float starPosXStart) { this.starPosXStart = starPosXStart; @@ -162,9 +178,10 @@ public void setLevelStarPosXStart(float starPosXStart) { public float getLevelStarPosYStart() { return starPosYStart; } + /** - * Set level stars Y position. This can be used to lift all stars (holders and stars) up or down for - * adjusments + * Set level stars Y position. This can be used to lift all stars (holders + * and stars) up or down for adjusments * */ public void setLevelStarPosYStart(float starPosYStart) { this.starPosYStart = starPosYStart; @@ -176,10 +193,10 @@ public void setLevelStarPosYStart(float starPosYStart) { public float getLevelStarSizeRatio() { return starSizeRatio; } - + /** - * Set level stars size ratio. This makes stars smaller or bigger (Default is 5). Bigger number makes stars/holders - * bigger and vice-versa. + * Set level stars size ratio. This makes stars smaller or bigger (Default + * is 5). Bigger number makes stars/holders bigger and vice-versa. * */ public void setLevelStarSizeRatio(float starSizeRatio) { this.starSizeRatio = starSizeRatio; @@ -188,7 +205,7 @@ public void setLevelStarSizeRatio(float starSizeRatio) { starSizeWidth = btnSizeW / numberOfTotalStars; starSizeHeight = btnSizeH / numberOfTotalStars; } - + /** * Get level number * */ @@ -203,11 +220,11 @@ public void setLevelNumber(int levelNumber, BitmapFont font) { this.levelNumber = levelNumber; bitMapFont = font; } - + /** * Set level number changes * */ - public void setLevelNumberChange(int levelNumber){ + public void setLevelNumberChange(int levelNumber) { this.levelNumber = levelNumber; } @@ -226,7 +243,7 @@ public void setTextureStarHolder(TextureRegion textureStarHolder) { } /** - * Get achievement object + * Get achievement object * */ public TextureRegion getTextureStar() { return textureStar; @@ -250,7 +267,7 @@ public int getNumberOfTotalStars() { * Set number of total achievement object * */ public void setNumberOfTotalStars(int numberOfTotalStars) { - this.numberOfTotalStars = numberOfTotalStars; + this.numberOfTotalStars = numberOfTotalStars; } /** @@ -261,13 +278,14 @@ public int getNumberOfEarnedStars() { } /** - * Set number of earned achievement object. This number cannot be higher/lower than numberOfTotalStars, it auto - * overrides if is less or more than numberOfTotalStars + * Set number of earned achievement object. This number cannot be + * higher/lower than numberOfTotalStars, it auto overrides if is less or + * more than numberOfTotalStars * */ public void setNumberOfEarnedStars(int numberOfEarnedStars) { - if(numberOfEarnedStars > numberOfTotalStars){ + if (numberOfEarnedStars > numberOfTotalStars) { numberOfEarnedStars = numberOfTotalStars; - } else{ + } else { this.numberOfEarnedStars = numberOfEarnedStars; } } diff --git a/core/src/main/java/com/moribitotech/samples/core/TableOverLayer.java b/core/src/com/moribitotech/samples/core/TableOverLayer.java similarity index 77% rename from core/src/main/java/com/moribitotech/samples/core/TableOverLayer.java rename to core/src/com/moribitotech/samples/core/TableOverLayer.java index 50cd007..41335cb 100644 --- a/core/src/main/java/com/moribitotech/samples/core/TableOverLayer.java +++ b/core/src/com/moribitotech/samples/core/TableOverLayer.java @@ -1,6 +1,6 @@ package com.moribitotech.samples.core; -import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.Table; @@ -8,8 +8,9 @@ public abstract class TableOverLayer extends Table { public TextureRegion textureBackground; public boolean isBackgroundTextureActive; - - public TableOverLayer(TextureRegion textureBackground, float x, float y, float width, float height){ + + public TableOverLayer(TextureRegion textureBackground, float x, float y, + float width, float height) { isBackgroundTextureActive = true; this.textureBackground = textureBackground; setBounds(x, y, width, height); @@ -17,23 +18,24 @@ public TableOverLayer(TextureRegion textureBackground, float x, float y, float w setHeight(height); setWidth(width); } - - public TableOverLayer(TextureRegion textureBackground, float width, float height){ + + public TableOverLayer(TextureRegion textureBackground, float width, + float height) { isBackgroundTextureActive = true; this.textureBackground = textureBackground; setHeight(height); setWidth(width); } - - public TableOverLayer(TextureRegion textureBackground){ + + public TableOverLayer(TextureRegion textureBackground) { isBackgroundTextureActive = true; this.textureBackground = textureBackground; } - + public TableOverLayer(Skin skin) { super(skin); } - + public TableOverLayer() { super(); } @@ -42,22 +44,24 @@ public TextureRegion getTextureBackground() { return textureBackground; } - public void setTextureBackground(TextureRegion textureBackground, boolean isBackgroundTextureActive) { + public void setTextureBackground(TextureRegion textureBackground, + boolean isBackgroundTextureActive) { this.textureBackground = textureBackground; this.isBackgroundTextureActive = isBackgroundTextureActive; } - public void setBackgroundTextureActive(boolean isBackgroundTextureActive){ + public void setBackgroundTextureActive(boolean isBackgroundTextureActive) { this.isBackgroundTextureActive = isBackgroundTextureActive; } - + @Override - public void draw(SpriteBatch batch, float parentAlpha) { + public void draw(Batch batch, float parentAlpha) { // First draw bg - if(textureBackground != null && isBackgroundTextureActive){ - batch.draw(textureBackground, getX(), getY(), getWidth(), getHeight()); + if (textureBackground != null && isBackgroundTextureActive) { + batch.draw(textureBackground, getX(), getY(), getWidth(), + getHeight()); } - + // Then draw child actors over bg super.draw(batch, parentAlpha); } diff --git a/core/src/main/java/com/moribitotech/samples/core/testassets/Assets.java b/core/src/com/moribitotech/samples/core/testassets/Assets.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/core/testassets/Assets.java rename to core/src/com/moribitotech/samples/core/testassets/Assets.java diff --git a/core/src/main/java/com/moribitotech/samples/core/testmain/TestMtxMainGame.java b/core/src/com/moribitotech/samples/core/testmain/TestMtxMainGame.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/core/testmain/TestMtxMainGame.java rename to core/src/com/moribitotech/samples/core/testmain/TestMtxMainGame.java diff --git a/core/src/main/java/com/moribitotech/samples/core/testmodels/Bat.java b/core/src/com/moribitotech/samples/core/testmodels/Bat.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/core/testmodels/Bat.java rename to core/src/com/moribitotech/samples/core/testmodels/Bat.java diff --git a/core/src/main/java/com/moribitotech/samples/core/testmodels/Hulk.java b/core/src/com/moribitotech/samples/core/testmodels/Hulk.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/core/testmodels/Hulk.java rename to core/src/com/moribitotech/samples/core/testmodels/Hulk.java diff --git a/core/src/main/java/com/moribitotech/samples/core/testmodels/Loading.java b/core/src/com/moribitotech/samples/core/testmodels/Loading.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/core/testmodels/Loading.java rename to core/src/com/moribitotech/samples/core/testmodels/Loading.java diff --git a/core/src/main/java/com/moribitotech/samples/core/testmodels/MenuSideBoxOverLayer.java b/core/src/com/moribitotech/samples/core/testmodels/MenuSideBoxOverLayer.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/core/testmodels/MenuSideBoxOverLayer.java rename to core/src/com/moribitotech/samples/core/testmodels/MenuSideBoxOverLayer.java diff --git a/core/src/main/java/com/moribitotech/samples/core/tests/Test0_AllTestsScreen.java b/core/src/com/moribitotech/samples/core/tests/Test0_AllTestsScreen.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/core/tests/Test0_AllTestsScreen.java rename to core/src/com/moribitotech/samples/core/tests/Test0_AllTestsScreen.java diff --git a/core/src/main/java/com/moribitotech/samples/core/tests/Test1_AbstractScreen.java b/core/src/com/moribitotech/samples/core/tests/Test1_AbstractScreen.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/core/tests/Test1_AbstractScreen.java rename to core/src/com/moribitotech/samples/core/tests/Test1_AbstractScreen.java diff --git a/core/src/main/java/com/moribitotech/samples/core/tests/Test2_AbstractActor.java b/core/src/com/moribitotech/samples/core/tests/Test2_AbstractActor.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/core/tests/Test2_AbstractActor.java rename to core/src/com/moribitotech/samples/core/tests/Test2_AbstractActor.java diff --git a/core/src/main/java/com/moribitotech/samples/core/tests/Test3_Buttons.java b/core/src/com/moribitotech/samples/core/tests/Test3_Buttons.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/core/tests/Test3_Buttons.java rename to core/src/com/moribitotech/samples/core/tests/Test3_Buttons.java diff --git a/core/src/main/java/com/moribitotech/samples/core/tests/Test4_Animations.java b/core/src/com/moribitotech/samples/core/tests/Test4_Animations.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/core/tests/Test4_Animations.java rename to core/src/com/moribitotech/samples/core/tests/Test4_Animations.java diff --git a/core/src/main/java/com/moribitotech/samples/core/tests/Test5_SplashScreen.java b/core/src/com/moribitotech/samples/core/tests/Test5_SplashScreen.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/core/tests/Test5_SplashScreen.java rename to core/src/com/moribitotech/samples/core/tests/Test5_SplashScreen.java diff --git a/core/src/main/java/com/moribitotech/samples/core/tests/Test6_CoolMainMenu.java b/core/src/com/moribitotech/samples/core/tests/Test6_CoolMainMenu.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/core/tests/Test6_CoolMainMenu.java rename to core/src/com/moribitotech/samples/core/tests/Test6_CoolMainMenu.java diff --git a/core/src/main/java/com/moribitotech/samples/core/tests/Test7_LevelsScreen.java b/core/src/com/moribitotech/samples/core/tests/Test7_LevelsScreen.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/core/tests/Test7_LevelsScreen.java rename to core/src/com/moribitotech/samples/core/tests/Test7_LevelsScreen.java diff --git a/core/src/main/java/com/moribitotech/samples/core/tests/Test8_GameMenu.java b/core/src/com/moribitotech/samples/core/tests/Test8_GameMenu.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/core/tests/Test8_GameMenu.java rename to core/src/com/moribitotech/samples/core/tests/Test8_GameMenu.java diff --git a/core/src/main/java/com/moribitotech/samples/gameworld/MainStarter.java b/core/src/com/moribitotech/samples/gameworld/MainStarter.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/gameworld/MainStarter.java rename to core/src/com/moribitotech/samples/gameworld/MainStarter.java diff --git a/core/src/main/java/com/moribitotech/samples/gameworld/assets/Assets.java b/core/src/com/moribitotech/samples/gameworld/assets/Assets.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/gameworld/assets/Assets.java rename to core/src/com/moribitotech/samples/gameworld/assets/Assets.java diff --git a/core/src/main/java/com/moribitotech/samples/gameworld/managers/GameManager.java b/core/src/com/moribitotech/samples/gameworld/managers/GameManager.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/gameworld/managers/GameManager.java rename to core/src/com/moribitotech/samples/gameworld/managers/GameManager.java diff --git a/core/src/main/java/com/moribitotech/samples/gameworld/models/FlyingEnemy.java b/core/src/com/moribitotech/samples/gameworld/models/FlyingEnemy.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/gameworld/models/FlyingEnemy.java rename to core/src/com/moribitotech/samples/gameworld/models/FlyingEnemy.java diff --git a/core/src/main/java/com/moribitotech/samples/gameworld/screen/helpers/GameScreenMenu.java b/core/src/com/moribitotech/samples/gameworld/screen/helpers/GameScreenMenu.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/gameworld/screen/helpers/GameScreenMenu.java rename to core/src/com/moribitotech/samples/gameworld/screen/helpers/GameScreenMenu.java diff --git a/core/src/main/java/com/moribitotech/samples/gameworld/screens/GameScreen.java b/core/src/com/moribitotech/samples/gameworld/screens/GameScreen.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/gameworld/screens/GameScreen.java rename to core/src/com/moribitotech/samples/gameworld/screens/GameScreen.java diff --git a/core/src/main/java/com/moribitotech/samples/gameworld/world/World.java b/core/src/com/moribitotech/samples/gameworld/world/World.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/gameworld/world/World.java rename to core/src/com/moribitotech/samples/gameworld/world/World.java diff --git a/core/src/main/java/com/moribitotech/samples/gameworld/world/WorldLayer1.java b/core/src/com/moribitotech/samples/gameworld/world/WorldLayer1.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/gameworld/world/WorldLayer1.java rename to core/src/com/moribitotech/samples/gameworld/world/WorldLayer1.java diff --git a/core/src/main/java/com/moribitotech/samples/gameworld/world/WorldLayer2.java b/core/src/com/moribitotech/samples/gameworld/world/WorldLayer2.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/gameworld/world/WorldLayer2.java rename to core/src/com/moribitotech/samples/gameworld/world/WorldLayer2.java diff --git a/core/src/main/java/com/moribitotech/samples/gameworld/world/WorldLayer3.java b/core/src/com/moribitotech/samples/gameworld/world/WorldLayer3.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/gameworld/world/WorldLayer3.java rename to core/src/com/moribitotech/samples/gameworld/world/WorldLayer3.java diff --git a/core/src/main/java/com/moribitotech/samples/jungle/MainStarter.java b/core/src/com/moribitotech/samples/jungle/MainStarter.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/jungle/MainStarter.java rename to core/src/com/moribitotech/samples/jungle/MainStarter.java diff --git a/core/src/main/java/com/moribitotech/samples/jungle/assets/Assets.java b/core/src/com/moribitotech/samples/jungle/assets/Assets.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/jungle/assets/Assets.java rename to core/src/com/moribitotech/samples/jungle/assets/Assets.java diff --git a/core/src/main/java/com/moribitotech/samples/jungle/buttons/JungleGameButton.java b/core/src/com/moribitotech/samples/jungle/buttons/JungleGameButton.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/jungle/buttons/JungleGameButton.java rename to core/src/com/moribitotech/samples/jungle/buttons/JungleGameButton.java diff --git a/core/src/main/java/com/moribitotech/samples/jungle/screens/JungleMainMenuScreen.java b/core/src/com/moribitotech/samples/jungle/screens/JungleMainMenuScreen.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/jungle/screens/JungleMainMenuScreen.java rename to core/src/com/moribitotech/samples/jungle/screens/JungleMainMenuScreen.java diff --git a/core/src/main/java/com/moribitotech/samples/jungle/screens/helpers/JungleMainMenuScreenButtons.java b/core/src/com/moribitotech/samples/jungle/screens/helpers/JungleMainMenuScreenButtons.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/jungle/screens/helpers/JungleMainMenuScreenButtons.java rename to core/src/com/moribitotech/samples/jungle/screens/helpers/JungleMainMenuScreenButtons.java diff --git a/core/src/main/java/com/moribitotech/samples/jungle/screens/helpers/JungleMainMenuScreenEnvironment.java b/core/src/com/moribitotech/samples/jungle/screens/helpers/JungleMainMenuScreenEnvironment.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/jungle/screens/helpers/JungleMainMenuScreenEnvironment.java rename to core/src/com/moribitotech/samples/jungle/screens/helpers/JungleMainMenuScreenEnvironment.java diff --git a/core/src/main/java/com/moribitotech/samples/jungle/screens/helpers/JungleMainMenuScreenInstructions.java b/core/src/com/moribitotech/samples/jungle/screens/helpers/JungleMainMenuScreenInstructions.java similarity index 100% rename from core/src/main/java/com/moribitotech/samples/jungle/screens/helpers/JungleMainMenuScreenInstructions.java rename to core/src/com/moribitotech/samples/jungle/screens/helpers/JungleMainMenuScreenInstructions.java diff --git a/desktop/build.gradle b/desktop/build.gradle new file mode 100644 index 0000000..92bdc55 --- /dev/null +++ b/desktop/build.gradle @@ -0,0 +1,46 @@ +apply plugin: "java" + +sourceCompatibility = 1.6 +sourceSets.main.java.srcDirs = [ "src/" ] + +project.ext.mainClassName = "luyentm.uet.desktop.DesktopLauncher" +project.ext.assetsDir = new File("../android/assets"); + +task run(dependsOn: classes, type: JavaExec) { + main = project.mainClassName + classpath = sourceSets.main.runtimeClasspath + standardInput = System.in + workingDir = project.assetsDir + ignoreExitValue = true +} + +task dist(type: Jar) { + from files(sourceSets.main.output.classesDir) + from files(sourceSets.main.output.resourcesDir) + from {configurations.compile.collect {zipTree(it)}} + from files(project.assetsDir); + + manifest { + attributes 'Main-Class': project.mainClassName + } +} + +dist.dependsOn classes + +eclipse { + project { + name = appName + "-desktop" + linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/android/assets' + } +} + +task afterEclipseImport(description: "Post processing after project generation", group: "IDE") { + doLast { + def classpath = new XmlParser().parse(file(".classpath")) + new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ]); + def writer = new FileWriter(file(".classpath")) + def printer = new XmlNodePrinter(new PrintWriter(writer)) + printer.setPreserveWhitespace(true) + printer.print(classpath) + } +} \ No newline at end of file diff --git a/desktop/pom.xml b/desktop/pom.xml deleted file mode 100644 index 5b9dd8f..0000000 --- a/desktop/pom.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - 4.0.0 - - com.moribitotech - mtx - 1.0-SNAPSHOT - - - mtx-desktop - jar - Main desktop - - - com.moribitotech.mtx.Main - - - - - com.moribitotech - mtx-core - ${project.version} - - - - com.badlogicgames.gdx - gdx - ${gdx.version} - - - - com.badlogicgames.gdx - gdx-backend-lwjgl - ${gdx.version} - - - - com.badlogicgames.gdx - gdx-platform - ${gdx.version} - natives-desktop - - - - - - - ../assets - - - - - - - com.googlecode.mavennatives - maven-nativedependencies-plugin - 0.0.6 - - - unpacknatives - pre-integration-test - copy - - - - - maven-antrun-plugin - 1.6 - - - integration-test - - - - - - - - - run - - - - - - - - maven-assembly-plugin - 2.4 - - - jar-with-dependencies - - - - ${mainClass} - - - - - - make-assembly - package - - single - - - - - - - diff --git a/desktop/src/main/java/com/moribitotech/mtx/Main.java b/desktop/src/com/moribitotech/mtx/Main.java similarity index 95% rename from desktop/src/main/java/com/moribitotech/mtx/Main.java rename to desktop/src/com/moribitotech/mtx/Main.java index e0023b8..3aae8fa 100644 --- a/desktop/src/main/java/com/moribitotech/mtx/Main.java +++ b/desktop/src/com/moribitotech/mtx/Main.java @@ -7,7 +7,6 @@ public class Main { public static void main(String[] args) { LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration(); cfg.title = "A_MtxFramework"; - cfg.useGL20 = true; cfg.width = 960; cfg.height = 540; diff --git a/desktop/src/com/moribitotech/samples/core/Main.java b/desktop/src/com/moribitotech/samples/core/Main.java new file mode 100644 index 0000000..946f143 --- /dev/null +++ b/desktop/src/com/moribitotech/samples/core/Main.java @@ -0,0 +1,17 @@ +package com.moribitotech.samples.core; + +import com.badlogic.gdx.backends.lwjgl.LwjglApplication; +import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; +import com.moribitotech.mtx.MainStarter; +import com.moribitotech.samples.core.testmain.TestMtxMainGame; + +public class Main { + public static void main(String[] args) { + LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration(); + cfg.title = "A_MtxFramework"; + cfg.width = 960; + cfg.height = 540; + + new LwjglApplication(new TestMtxMainGame(), cfg); + } +} diff --git a/desktop/src/main/java/com/moribitotech/samples/gameworld/Main.java b/desktop/src/com/moribitotech/samples/gameworld/Main.java similarity index 94% rename from desktop/src/main/java/com/moribitotech/samples/gameworld/Main.java rename to desktop/src/com/moribitotech/samples/gameworld/Main.java index 4762f3b..90cf782 100644 --- a/desktop/src/main/java/com/moribitotech/samples/gameworld/Main.java +++ b/desktop/src/com/moribitotech/samples/gameworld/Main.java @@ -7,10 +7,9 @@ public class Main { public static void main(String[] args) { LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration(); cfg.title = "MtxGameWorld"; - cfg.useGL20 = true; cfg.width = 800; cfg.height = 480; - + new LwjglApplication(new MainStarter(), cfg); } } diff --git a/desktop/src/main/java/com/moribitotech/samples/jungle/Main.java b/desktop/src/com/moribitotech/samples/jungle/Main.java similarity index 94% rename from desktop/src/main/java/com/moribitotech/samples/jungle/Main.java rename to desktop/src/com/moribitotech/samples/jungle/Main.java index 29dc119..ca136d7 100644 --- a/desktop/src/main/java/com/moribitotech/samples/jungle/Main.java +++ b/desktop/src/com/moribitotech/samples/jungle/Main.java @@ -7,10 +7,9 @@ public class Main { public static void main(String[] args) { LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration(); cfg.title = "MtxJungleGameMenu"; - cfg.useGL20 = false; cfg.width = 800; cfg.height = 480; - + new LwjglApplication(new MainStarter(), cfg); } } diff --git a/desktop/src/main/java/com/moribitotech/samples/core/Main.java b/desktop/src/main/java/com/moribitotech/samples/core/Main.java deleted file mode 100644 index b7c02c6..0000000 --- a/desktop/src/main/java/com/moribitotech/samples/core/Main.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.moribitotech.samples.core; - -import com.badlogic.gdx.backends.lwjgl.LwjglApplication; -import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; -import com.moribitotech.mtx.MainStarter; -import com.moribitotech.samples.core.testmain.TestMtxMainGame; - -public class Main { - public static void main(String[] args) { - LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration(); - cfg.title = "A_MtxFramework"; - cfg.useGL20 = true; - cfg.width = 960; - cfg.height = 540; - - new LwjglApplication(new TestMtxMainGame(), cfg); - } -} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..fa55fd1 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.daemon=true +org.gradle.jvmargs=-Xms128m -Xmx512m +org.gradle.configureondemand=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..b979729 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..8e600c9 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Sat Sep 21 13:08:26 CEST 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=http\://services.gradle.org/distributions/gradle-2.2-all.zip diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..91a7e26 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/html/pom.xml b/html/pom.xml deleted file mode 100644 index 869d08a..0000000 --- a/html/pom.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - 4.0.0 - - com.moribitotech - mtx - 1.0-SNAPSHOT - - - mtx-html - war - Main HTML - - - com.moribitotech.mtx.Main - mtx - - - - - com.moribitotech - mtx-core - ${project.version} - - - - com.badlogicgames.gdx - gdx-backend-gwt - ${gdx.version} - - - - com.moribitotech - mtx-core - ${project.version} - sources - provided - - - - com.badlogicgames.gdx - gdx - ${gdx.version} - sources - provided - - - - com.badlogicgames.gdx - gdx-backend-gwt - ${gdx.version} - sources - provided - - - - com.google.gwt - gwt-user - ${gwt.version} - provided - - - com.google.gwt - gwt-servlet - ${gwt.version} - runtime - - - - - - - ${project.basedir}/src/main/java - true - - **/*.gwt.xml - - - - - - - org.codehaus.mojo - gwt-maven-plugin - ${gwt.maven.version} - - ${project.build.directory}/webapp - index.html - - - - - compile - - - - - - org.apache.maven.plugins - maven-war-plugin - 2.3 - - ${project.build.directory}/webapp - - - - - - org.mortbay.jetty - jetty-maven-plugin - 8.0.0.v20110901 - - ${project.basedir}/target/webapp - - - - test-html - integration-test - - run-exploded - - - - - - - diff --git a/html/src/main/java/com/moribitotech/mtx/Main.gwt.xml b/html/src/main/java/com/moribitotech/mtx/Main.gwt.xml deleted file mode 100644 index e78af19..0000000 --- a/html/src/main/java/com/moribitotech/mtx/Main.gwt.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/html/src/main/java/com/moribitotech/mtx/html/MainHtml.java b/html/src/main/java/com/moribitotech/mtx/html/MainHtml.java deleted file mode 100644 index a442f1c..0000000 --- a/html/src/main/java/com/moribitotech/mtx/html/MainHtml.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.moribitotech.mtx.html; - -import com.moribitotech.mtx.core.Main; - -import com.badlogic.gdx.ApplicationListener; -import com.badlogic.gdx.backends.gwt.GwtApplication; -import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration; - -public class MainHtml extends GwtApplication { - @Override - public ApplicationListener getApplicationListener () { - return new Main(); - } - - @Override - public GwtApplicationConfiguration getConfig () { - return new GwtApplicationConfiguration(480, 320); - } -} diff --git a/html/src/main/webapp/WEB-INF/web.xml b/html/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index f72ebb6..0000000 --- a/html/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/html/src/main/webapp/favicon.ico b/html/src/main/webapp/favicon.ico deleted file mode 100644 index 8ea2312..0000000 Binary files a/html/src/main/webapp/favicon.ico and /dev/null differ diff --git a/html/src/main/webapp/index.html b/html/src/main/webapp/index.html deleted file mode 100644 index 95585b4..0000000 --- a/html/src/main/webapp/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - Main - - - - - diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 6f6cff1..0000000 --- a/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - 4.0.0 - com.moribitotech - mtx - 1.0-SNAPSHOT - pom - Main Parent - - - 0.9.9 - 4.1.1.4 - 3.6.0 - 2.5.0 - 2.5.0 - - - - - gdx-nightlies - https://oss.sonatype.org/content/repositories/snapshots/ - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.5.1 - - 1.6 - 1.6 - - - - - - - - desktop - - desktop - - - - android - - android - - - - html - - html - - - - ios - - ios - - - - - - core - - diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..74fc652 --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +include 'desktop', 'core' \ No newline at end of file