l) {
122 | for (Line t : l)
123 | addLine(t, null);
124 | }
125 |
126 | static public class TextPanelStyle {
127 | /** Optional. */
128 | public Drawable background;
129 | public LabelStyle labelStyle;
130 |
131 | public TextPanelStyle() {
132 | }
133 |
134 | public TextPanelStyle(TextPanelStyle style) {
135 | background = style.background;
136 | labelStyle = style.labelStyle;
137 | }
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/core/src/main/java/com/bladecoder/inkplayer/ui/UI.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2014 Rafael Garcia Moreno.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.bladecoder.inkplayer.ui;
17 |
18 | import java.util.ResourceBundle;
19 |
20 | import com.badlogic.gdx.Application.ApplicationType;
21 | import com.badlogic.gdx.Gdx;
22 | import com.badlogic.gdx.files.FileHandle;
23 | import com.badlogic.gdx.graphics.g2d.SpriteBatch;
24 | import com.badlogic.gdx.graphics.g2d.TextureAtlas;
25 | import com.badlogic.gdx.scenes.scene2d.ui.Skin;
26 | import com.badlogic.gdx.utils.reflect.ClassReflection;
27 | import com.bladecoder.inkplayer.StoryManager;
28 | import com.bladecoder.inkplayer.assets.EngineAssetManager;
29 | import com.bladecoder.inkplayer.common.RectangleRenderer;
30 | import com.bladecoder.inkplayer.i18n.I18N;
31 |
32 | public class UI {
33 | private static final String TAG="UI";
34 |
35 | private static final String SKIN_FILENAME = "ui/ui.json";
36 |
37 | private boolean fullscreen = false;
38 |
39 | private AppScreen screen;
40 |
41 | private SpriteBatch batch;
42 | private Skin skin;
43 |
44 | private StoryManager storyManager;
45 |
46 | private static ResourceBundle i18n;
47 |
48 | public enum Screens {
49 | INIT_SCREEN, STORY_SCREEN, LOADING_SCREEN, MENU_SCREEN, HELP_SCREEN, CREDIT_SCREEN, LOAD_GAME_SCREEN, SAVE_GAME_SCREEN
50 | }
51 |
52 | private final AppScreen screens[];
53 |
54 | public UI(StoryManager storyManager) {
55 | this.storyManager = storyManager;
56 |
57 | batch = new SpriteBatch();
58 |
59 | screens = new AppScreen[Screens.values().length];
60 |
61 | Gdx.input.setCatchMenuKey(true);
62 |
63 | loadAssets();
64 |
65 | screens[Screens.INIT_SCREEN.ordinal()] = getScreenInstance(Screens.INIT_SCREEN.toString(), InitScreen.class);
66 | screens[Screens.STORY_SCREEN.ordinal()] = getScreenInstance(Screens.STORY_SCREEN.toString(), StoryScreen.class);
67 | screens[Screens.LOADING_SCREEN.ordinal()] = null;
68 | screens[Screens.MENU_SCREEN.ordinal()] = getScreenInstance(Screens.MENU_SCREEN.toString(), MenuScreen.class);
69 | screens[Screens.HELP_SCREEN.ordinal()] = null;
70 | screens[Screens.CREDIT_SCREEN.ordinal()] = getScreenInstance(Screens.CREDIT_SCREEN.toString(),
71 | CreditsScreen.class);
72 | screens[Screens.LOAD_GAME_SCREEN.ordinal()] = null;
73 | screens[Screens.SAVE_GAME_SCREEN.ordinal()] = null;
74 |
75 | for (AppScreen s : screens)
76 | if(s != null)
77 | s.setUI(this);
78 |
79 | setCurrentScreen(Screens.INIT_SCREEN);
80 | }
81 |
82 | private AppScreen getScreenInstance(String prop, Class> defaultClass) {
83 |
84 | try {
85 | return (AppScreen) ClassReflection.newInstance(defaultClass);
86 | } catch (Exception e) {
87 | Gdx.app.error(TAG, "Error instancing screen", e);
88 | }
89 |
90 | return null;
91 | }
92 |
93 | public AppScreen getScreen(Screens state) {
94 | return screens[state.ordinal()];
95 | }
96 |
97 | public void setScreen(Screens state, AppScreen s) {
98 | screens[state.ordinal()] = s;
99 | }
100 |
101 | public SpriteBatch getBatch() {
102 | return batch;
103 | }
104 |
105 | public AppScreen getCurrentScreen() {
106 | return screen;
107 | }
108 |
109 | public void setCurrentScreen(Screens s) {
110 | Gdx.app.debug(TAG, "Setting SCREEN: " + s.name());
111 | setCurrentScreen(screens[s.ordinal()]);
112 | }
113 |
114 | public void setCurrentScreen(AppScreen s) {
115 |
116 | if (screen != null) {
117 | screen.hide();
118 | }
119 |
120 | screen = s;
121 |
122 | screen.show();
123 |
124 | resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
125 | }
126 |
127 | public TextureAtlas getUIAtlas() {
128 | return skin.getAtlas();
129 | }
130 |
131 | public Skin getSkin() {
132 | return skin;
133 | }
134 |
135 | public void render() {
136 | // for long processing frames, limit delta to 1/30f to avoid skipping animations
137 | float delta = Math.min(Gdx.graphics.getDeltaTime(), 1 / 30f);
138 |
139 | screen.render(delta);
140 | }
141 |
142 | private void loadAssets() {
143 | BladeSkin.addStyleTag(ChoicesUI.ChoicesUIStyle.class);
144 | BladeSkin.addStyleTag(CreditsScreen.CreditScreenStyle.class);
145 | BladeSkin.addStyleTag(MenuScreen.MenuScreenStyle.class);
146 |
147 | BladeSkin.addStyleTag(StoryScreen.StoryScreenStyle.class);
148 | BladeSkin.addStyleTag(TextPanel.TextPanelStyle.class);
149 |
150 | loadI18NBundle();
151 |
152 | FileHandle skinFile = EngineAssetManager.getInstance().getAsset(SKIN_FILENAME);
153 | TextureAtlas atlas = new TextureAtlas(EngineAssetManager.getInstance()
154 | .getResAsset(SKIN_FILENAME.substring(0, SKIN_FILENAME.lastIndexOf('.')) + ".atlas"));
155 | skin = new BladeSkin(skinFile, atlas);
156 | }
157 |
158 | public void resize(int width, int height) {
159 | if (screen != null)
160 | screen.resize(width, height);
161 | }
162 |
163 | public void toggleFullScreen() {
164 | if (!fullscreen) {
165 | Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
166 | fullscreen = true;
167 | } else {
168 | Gdx.graphics.setWindowedMode(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2);
169 | fullscreen = false;
170 | }
171 | }
172 |
173 | public void dispose() {
174 | screen.hide();
175 | batch.dispose();
176 | skin.dispose();
177 |
178 | RectangleRenderer.dispose();
179 |
180 | // DISPOSE ALL SCREENS
181 | for (AppScreen s : screens)
182 | if(s != null)
183 | s.dispose();
184 |
185 | EngineAssetManager.getInstance().dispose();
186 | }
187 |
188 | public void resume() {
189 | if (Gdx.app.getType() != ApplicationType.Desktop) {
190 | // RESTORE GL CONTEXT
191 | RectangleRenderer.dispose();
192 | }
193 |
194 | if (screen != null)
195 | screen.resume();
196 | }
197 |
198 | public void pause() {
199 | if (screen != null)
200 | screen.pause();
201 | }
202 |
203 | public StoryManager getStoryManager() {
204 | return storyManager;
205 | }
206 |
207 | public void loadI18NBundle() {
208 | if (EngineAssetManager.getInstance().getAsset("ui/ui.properties").exists())
209 | i18n = I18N.getBundle("ui/ui", true);
210 | }
211 |
212 | public String translate(String key) {
213 | String translated = key;
214 |
215 | try {
216 | translated = i18n.getString(key);
217 | } catch (Exception e) {
218 | Gdx.app.error(TAG, "MISSING TRANSLATION KEY: " + key);
219 | }
220 |
221 | return translated;
222 | }
223 | }
224 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | version=0.01
2 | appName=the-intercept
3 | bladeInkVersion=1.2.0
4 | robovmVersion=2.3.20
5 | gdxVersion=1.12.1
6 | androidPluginVersion=8.2.2
7 | android.enableR8.fullMode=false
8 | graalHelperVersion=2.0.1
9 | enableGraalNative=false
10 | org.gradle.daemon=true
11 | org.gradle.jvmargs=-Xms512M -Xmx1G
12 | org.gradle.configureondemand=false
13 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/ios/Info.plist.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${app.name}
9 | CFBundleExecutable
10 | ${app.executable}
11 | CFBundleIdentifier
12 | ${app.id}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${app.name}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | ${app.version}
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | ${app.build}
25 | LSRequiresIPhoneOS
26 |
27 | UIViewControllerBasedStatusBarAppearance
28 |
29 | UIStatusBarHidden
30 |
31 | MinimumOSVersion
32 | 8.0
33 | UIDeviceFamily
34 |
35 | 1
36 | 2
37 |
38 | UIRequiredDeviceCapabilities
39 |
40 | opengles-2
41 |
42 | UISupportedInterfaceOrientations
43 |
44 | UIInterfaceOrientationPortrait
45 | UIInterfaceOrientationPortraitUpsideDown
46 | UIInterfaceOrientationLandscapeLeft
47 | UIInterfaceOrientationLandscapeRight
48 |
49 | UILaunchStoryboardName
50 | LaunchScreen
51 | CFBundleIconName
52 | AppIcon
53 | UIRequiresFullScreen
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/ios/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | }
5 | dependencies {
6 | classpath "com.mobidevelop.robovm:robovm-gradle-plugin:$robovmVersion"
7 | }
8 | }
9 | apply plugin: 'robovm'
10 |
11 | [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
12 |
13 | ext {
14 | mainClassName = "com.bladecoder.inkplayer.ios.IOSLauncher"
15 | }
16 |
17 | launchIPhoneSimulator.dependsOn build
18 | launchIPadSimulator.dependsOn build
19 | launchIOSDevice.dependsOn build
20 | createIPA.dependsOn build
21 |
22 | eclipse.project {
23 | name = appName + "-ios"
24 | natures 'org.robovm.eclipse.RoboVMNature'
25 | }
26 |
27 | dependencies {
28 | implementation "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
29 | implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
30 | implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
31 | implementation "com.mobidevelop.robovm:robovm-cocoatouch:$robovmVersion"
32 | implementation "com.mobidevelop.robovm:robovm-rt:$robovmVersion"
33 | implementation project(':core')
34 | }
35 |
--------------------------------------------------------------------------------
/ios/data/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "iphone-notification-icon-20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "iphone-notification-icon-20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "iphone-spotlight-settings-icon-29@2x.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "iphone-spotlight-settings-icon-29@3x.png",
25 | "scale" : "3x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "iphone-spotlight-icon-40@2x.png",
31 | "scale" : "2x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "iphone-spotlight-icon-40@3x.png",
37 | "scale" : "3x"
38 | },
39 | {
40 | "size" : "60x60",
41 | "idiom" : "iphone",
42 | "filename" : "iphone-app-icon-60@2x.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "iphone-app-icon-60@3x.png",
49 | "scale" : "3x"
50 | },
51 | {
52 | "size" : "20x20",
53 | "idiom" : "ipad",
54 | "filename" : "ipad-notifications-icon-20@1x.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "ipad-notifications-icon-20@2x.png",
61 | "scale" : "2x"
62 | },
63 | {
64 | "size" : "29x29",
65 | "idiom" : "ipad",
66 | "filename" : "ipad-settings-icon-29@1x.png",
67 | "scale" : "1x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "ipad-settings-icon-29@2x.png",
73 | "scale" : "2x"
74 | },
75 | {
76 | "size" : "40x40",
77 | "idiom" : "ipad",
78 | "filename" : "ipad-spotlight-icon-40@1x.png",
79 | "scale" : "1x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "ipad-spotlight-icon-40@2x.png",
85 | "scale" : "2x"
86 | },
87 | {
88 | "size" : "76x76",
89 | "idiom" : "ipad",
90 | "filename" : "ipad-app-icon-76@1x.png",
91 | "scale" : "1x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "ipad-app-icon-76@2x.png",
97 | "scale" : "2x"
98 | },
99 | {
100 | "size" : "83.5x83.5",
101 | "idiom" : "ipad",
102 | "filename" : "ipad-pro-app-icon-83.5@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "1024x1024",
107 | "idiom" : "ios-marketing",
108 | "filename" : "app-store-icon-1024@1x.png",
109 | "scale" : "1x"
110 | }
111 | ],
112 | "info" : {
113 | "version" : 1,
114 | "author" : "xcode"
115 | }
116 | }
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/app-store-icon-1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/app-store-icon-1024@1x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/ipad-app-icon-76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/ipad-app-icon-76@1x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/ipad-app-icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/ipad-app-icon-76@2x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/ipad-notifications-icon-20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/ipad-notifications-icon-20@1x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/ipad-notifications-icon-20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/ipad-notifications-icon-20@2x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/ipad-pro-app-icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/ipad-pro-app-icon-83.5@2x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/ipad-settings-icon-29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/ipad-settings-icon-29@1x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/ipad-settings-icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/ipad-settings-icon-29@2x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/ipad-spotlight-icon-40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/ipad-spotlight-icon-40@1x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/ipad-spotlight-icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/ipad-spotlight-icon-40@2x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/iphone-app-icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/iphone-app-icon-60@2x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/iphone-app-icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/iphone-app-icon-60@3x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/iphone-notification-icon-20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/iphone-notification-icon-20@2x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/iphone-notification-icon-20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/iphone-notification-icon-20@3x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-icon-40@2x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-icon-40@3x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-settings-icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-settings-icon-29@2x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-settings-icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-settings-icon-29@3x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/Logo.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "libgdx@1x.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "libgdx@2x.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "libgdx@3x.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/Logo.imageset/libgdx@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/Logo.imageset/libgdx@1x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/Logo.imageset/libgdx@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/Logo.imageset/libgdx@2x.png
--------------------------------------------------------------------------------
/ios/data/Media.xcassets/Logo.imageset/libgdx@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/ios/data/Media.xcassets/Logo.imageset/libgdx@3x.png
--------------------------------------------------------------------------------
/ios/robovm.properties:
--------------------------------------------------------------------------------
1 | app.name=The Intercept
2 | app.id=com.bladecoder.theintercept
3 | app.version=0.0.1-SNAPSHOT
4 | app.mainclass=com.bladecoder.inkplayer.ios.IOSLauncher
5 | app.executable=IOSLauncher
6 | app.build=1
7 |
--------------------------------------------------------------------------------
/ios/robovm.xml:
--------------------------------------------------------------------------------
1 |
2 | ${app.executable}
3 | ${app.mainclass}
4 | ios
5 | ios
6 | Info.plist.xml
7 |
8 |
9 | ../assets
10 |
11 | **
12 |
13 | true
14 |
15 |
16 | data
17 |
18 |
19 |
20 | com.bladecoder.inkplayer.**
21 | com.badlogic.gdx.scenes.scene2d.ui.*
22 | com.badlogic.gdx.graphics.g3d.particles.**
23 | com.android.okhttp.HttpHandler
24 | com.android.okhttp.HttpsHandler
25 | com.android.org.conscrypt.**
26 | com.android.org.bouncycastle.jce.provider.BouncyCastleProvider
27 | com.android.org.bouncycastle.jcajce.provider.keystore.BC$Mappings
28 | com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi
29 | com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi$Std
30 | com.android.org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi
31 | com.android.org.bouncycastle.crypto.digests.AndroidDigestFactoryOpenSSL
32 | org.apache.harmony.security.provider.cert.DRLCertFactory
33 | org.apache.harmony.security.provider.crypto.CryptoProvider
34 |
35 |
36 | z
37 |
38 |
39 | UIKit
40 | OpenGLES
41 | QuartzCore
42 | CoreGraphics
43 | OpenAL
44 | AudioToolbox
45 | AVFoundation
46 |
47 |
48 |
--------------------------------------------------------------------------------
/ios/src/main/java/com/bladecoder/inkplayer/ios/IOSLauncher.java:
--------------------------------------------------------------------------------
1 | package com.bladecoder.inkplayer.ios;
2 |
3 | import org.robovm.apple.foundation.NSAutoreleasePool;
4 | import org.robovm.apple.uikit.UIApplication;
5 |
6 | import com.badlogic.gdx.backends.iosrobovm.IOSApplication;
7 | import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration;
8 | import com.bladecoder.inkplayer.InkApp;
9 |
10 | /** Launches the iOS (RoboVM) application. */
11 | public class IOSLauncher extends IOSApplication.Delegate {
12 | @Override
13 | protected IOSApplication createApplication() {
14 | IOSApplicationConfiguration configuration = new IOSApplicationConfiguration();
15 | return new IOSApplication(new InkApp(), configuration);
16 | }
17 |
18 | public static void main(String[] argv) {
19 | NSAutoreleasePool pool = new NSAutoreleasePool();
20 | UIApplication.main(argv, null, IOSLauncher.class);
21 | pool.close();
22 | }
23 | }
--------------------------------------------------------------------------------
/lwjgl3/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | gradlePluginPortal()
4 | }
5 | dependencies {
6 | // using jpackage only works if the JDK version is 14 or higher.
7 | // your JAVA_HOME environment variable may also need to be a JDK with version 14 or higher.
8 | if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_14)) {
9 | classpath "org.beryx:badass-runtime-plugin:1.13.0"
10 | }
11 | if(enableGraalNative == 'true') {
12 | classpath "org.graalvm.buildtools.native:org.graalvm.buildtools.native.gradle.plugin:0.9.28"
13 | }
14 | }
15 | }
16 |
17 | if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_14)) {
18 | apply plugin: 'org.beryx.runtime'
19 | }
20 | else {
21 | apply plugin: 'application'
22 | }
23 |
24 | sourceSets.main.resources.srcDirs += [ rootProject.file('assets').path ]
25 | mainClassName = 'com.bladecoder.inkplayer.lwjgl3.Lwjgl3Launcher'
26 | application.setMainClass(mainClassName)
27 | eclipse.project.name = appName + '-lwjgl3'
28 | java.sourceCompatibility = 11
29 | java.targetCompatibility = 11
30 |
31 | dependencies {
32 | implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
33 | implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
34 | implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
35 | implementation project(':core')
36 | }
37 |
38 | def jarName = "${appName}-${version}.jar"
39 | def os = System.properties['os.name'].toLowerCase()
40 |
41 | run {
42 | workingDir = rootProject.file('assets').path
43 | setIgnoreExitValue(true)
44 |
45 | if (os.contains('mac')) jvmArgs += "-XstartOnFirstThread"
46 | }
47 |
48 | jar {
49 | // sets the name of the .jar file this produces to the name of the game or app.
50 | archiveFileName.set(jarName)
51 | // using 'lib' instead of the default 'libs' appears to be needed by jpackageimage.
52 | destinationDirectory = file("${project.layout.buildDirectory.asFile.get().absolutePath}/lib")
53 | // the duplicatesStrategy matters starting in Gradle 7.0; this setting works.
54 | duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
55 | dependsOn configurations.runtimeClasspath
56 | from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
57 | // these "exclude" lines remove some unnecessary duplicate files in the output JAR.
58 | exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA')
59 | dependencies {
60 | exclude('META-INF/INDEX.LIST', 'META-INF/maven/**')
61 | }
62 | // setting the manifest makes the JAR runnable.
63 | manifest {
64 | attributes 'Main-Class': project.mainClassName
65 | }
66 | // this last step may help on some OSes that need extra instruction to make runnable JARs.
67 | doLast {
68 | file(archiveFile).setExecutable(true, false)
69 | }
70 | }
71 |
72 | if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_14)) {
73 | tasks.jpackageImage.doNotTrackState("This task both reads from and writes to the build folder.")
74 | runtime {
75 | options.set(['--strip-debug',
76 | '--compress', '2',
77 | '--no-header-files',
78 | '--no-man-pages',
79 | '--strip-native-commands',
80 | '--vm', 'server'])
81 | // you could very easily need more modules than this one.
82 | // use the lwjgl3:suggestModules task to see which modules may be needed.
83 | modules.set([
84 | 'jdk.unsupported'
85 | ])
86 | distDir.set(file(project.layout.buildDirectory))
87 | jpackage {
88 | imageName = appName
89 | // you can set this to false if you want to build an installer, or keep it as true to build just an app.
90 | skipInstaller = true
91 | // this may need to be set to a different path if your JAVA_HOME points to a low JDK version.
92 | jpackageHome = javaHome.getOrElse("")
93 | mainJar = jarName
94 | if (os.contains('win')) {
95 | imageOptions = ["--icon", "icons/logo.ico"]
96 | } else if (os.contains('nix') || os.contains('nux') || os.contains('bsd')) {
97 | imageOptions = ["--icon", "icons/logo.png"]
98 | } else if (os.contains('mac')) {
99 |
100 | imageOptions = ["--icon", "icons/logo.icns", "--java-options", "-XstartOnFirstThread"]
101 | }
102 | }
103 | }
104 | }
105 |
106 | // Equivalent to the jar task; here for compatibility with gdx-setup.
107 | tasks.register('dist') {
108 | dependsOn 'jar'
109 | }
110 |
111 | if(enableGraalNative == 'true') {
112 | apply from: file("nativeimage.gradle")
113 | }
114 |
--------------------------------------------------------------------------------
/lwjgl3/icons/logo.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/lwjgl3/icons/logo.icns
--------------------------------------------------------------------------------
/lwjgl3/icons/logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/lwjgl3/icons/logo.ico
--------------------------------------------------------------------------------
/lwjgl3/icons/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/lwjgl3/icons/logo.png
--------------------------------------------------------------------------------
/lwjgl3/nativeimage.gradle:
--------------------------------------------------------------------------------
1 |
2 | project(":lwjgl3") {
3 | apply plugin: "org.graalvm.buildtools.native"
4 |
5 | dependencies {
6 | implementation "io.github.berstanio:gdx-svmhelper-backend-lwjgl3:$graalHelperVersion"
7 | implementation "io.github.berstanio:gdx-svmhelper-extension-freetype:$graalHelperVersion"
8 | }
9 | graalvmNative {
10 | binaries {
11 | main {
12 | imageName = appName
13 | mainClass = project.mainClassName
14 | requiredVersion = '23.0'
15 | buildArgs.add("-march=compatibility")
16 | jvmArgs.addAll("-Dfile.encoding=UTF8")
17 | sharedLibrary = false
18 | }
19 | }
20 | }
21 |
22 | run {
23 | doNotTrackState("Running the app should not be affected by Graal.")
24 | }
25 |
26 | // Modified from https://lyze.dev/2021/04/29/libGDX-Internal-Assets-List/ ; thanks again, Lyze!
27 | // This creates a resource-config.json file based on the contents of the assets folder (and the libGDX icons).
28 | // This file is used by Graal Native to embed those specific files.
29 | // This has to run before nativeCompile, so it runs at the start of an unrelated resource-handling command.
30 | generateResourcesConfigFile.doFirst {
31 | def assetsFolder = new File("${project.rootDir}/assets/")
32 | def lwjgl3 = project(':lwjgl3')
33 | def resFolder = new File("${lwjgl3.projectDir}/src/main/resources/META-INF/native-image/${lwjgl3.ext.appName}")
34 | resFolder.mkdirs()
35 | def resFile = new File(resFolder, "resource-config.json")
36 | resFile.delete()
37 | resFile.append(
38 | """{
39 | "resources":{
40 | "includes":[
41 | {
42 | "pattern": ".*(""")
43 | // This adds every filename in the assets/ folder to a pattern that adds those files as resources.
44 | fileTree(assetsFolder).each {
45 | // The backslash-Q and backslash-E escape the start and end of a literal string, respectively.
46 | resFile.append("\\\\Q${it.name}\\\\E|")
47 | }
48 | // We also match all of the window icon images this way and the font files that are part of libGDX.
49 | resFile.append(
50 | """libgdx.+\\\\.png|lsans.+)"
51 | }
52 | ]},
53 | "bundles":[]
54 | }"""
55 | )
56 | }
57 | }
58 |
59 | project(":core") {
60 | dependencies {
61 | implementation "io.github.berstanio:gdx-svmhelper-annotations:$graalHelperVersion"
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/lwjgl3/src/main/java/com/bladecoder/inkplayer/desktop/Lwjgl3Launcher.java:
--------------------------------------------------------------------------------
1 | package com.bladecoder.inkplayer.desktop;
2 |
3 | import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
4 | import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
5 | import com.bladecoder.inkplayer.InkApp;
6 |
7 | /** Launches the desktop (LWJGL3) application. */
8 | public class Lwjgl3Launcher {
9 | private static boolean fullscreen = true;
10 |
11 | public static void main(String[] args) {
12 | if (StartupHelper.startNewJvmIfRequired(args)) return; // This handles macOS support and helps on Windows.
13 |
14 | InkApp app = new InkApp();
15 |
16 | parseArgs(args, app);
17 |
18 | new Lwjgl3Application(app, getDefaultConfiguration());
19 | }
20 |
21 | private static Lwjgl3ApplicationConfiguration getDefaultConfiguration() {
22 | Lwjgl3ApplicationConfiguration configuration = new Lwjgl3ApplicationConfiguration();
23 | configuration.setTitle("Blade Ink Template");
24 | configuration.useVsync(true);
25 | //// Limits FPS to the refresh rate of the currently active monitor.
26 | configuration.setForegroundFPS(Lwjgl3ApplicationConfiguration.getDisplayMode().refreshRate);
27 | //// If you remove the above line and set Vsync to false, you can get unlimited FPS, which can be
28 | //// useful for testing performance, but can also be very stressful to some hardware.
29 | //// You may also need to configure GPU drivers to fully disable Vsync; this can cause screen tearing.
30 |
31 | if(fullscreen) {
32 | configuration.setFullscreenMode(Lwjgl3ApplicationConfiguration.getDisplayMode());
33 | } else {
34 | configuration.setWindowedMode(1920/2, 1080/2);
35 | configuration.setResizable(true);
36 | }
37 |
38 | configuration.setWindowIcon("icon128.png", "icon64.png", "icon32.png", "icon16.png");
39 | return configuration;
40 | }
41 |
42 | private static void parseArgs(String[] args, InkApp app) {
43 | for (int i = 0; i < args.length; i++) {
44 | String s = args[i];
45 | if (s.equals("-p")) {
46 | if (i + 1 < args.length) {
47 | i++;
48 | app.setPlayMode(args[i]);
49 | }
50 | } else if (s.equals("-initPath")) {
51 | if (i + 1 < args.length) {
52 | i++;
53 | app.setInitPath(args[i]);
54 | }
55 | } else if (s.equals("-f")) {
56 | fullscreen = true;
57 | } else if (s.equals("-d")) {
58 | app.setDebugMode();
59 | } else if (s.equals("-r")) {
60 | app.setRestart();
61 | } else if (s.equals("-res")) {
62 | if (i + 1 < args.length) {
63 | i++;
64 | app.forceResolution(args[i]);
65 | }
66 | } else if (s.equals("-w")) {
67 | fullscreen = false;
68 | } else if (s.equals("-l")) {
69 | if (i + 1 < args.length) {
70 | i++;
71 | app.loadGameState(args[i]);
72 | }
73 | } else if (s.equals("-h")) {
74 | usage();
75 | } else {
76 | if (i == 0 && !s.startsWith("-"))
77 | continue; // When embeded JRE the 0 parameter is the app
78 | // name
79 | System.out.println("Unrecognized parameter: " + s);
80 | usage();
81 | }
82 | }
83 | }
84 |
85 | private static void usage() {
86 | System.out.println("Usage:\n"
87 | + "-p record_name\tPlay previusly recorded games\n"
88 | + "-initPath path\tRun the specified path\n"
89 | + "-f\tSet fullscreen mode\n" + "-w\tSet windowed mode\n"
90 | + "-d\tShow debug messages\n"
91 | + "-res width\tForce the resolution width\n"
92 | + "-l game_state\tLoad the previusly saved game state\n"
93 | + "-aspect aspect_ratio\tSets the specified screen aspect (16:9, 9:16, 4:3, 16:10)\n");
94 |
95 | System.exit(0);
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/lwjgl3/src/main/java/com/bladecoder/inkplayer/desktop/StartupHelper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 damios
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at:
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software
10 | * distributed under the License is distributed on an "AS IS" BASIS,
11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | * See the License for the specific language governing permissions and
13 | * limitations under the License.
14 | */
15 | //Note, the above license and copyright applies to this file only.
16 |
17 | package com.bladecoder.inkplayer.desktop;
18 |
19 | import org.lwjgl.system.macosx.LibC;
20 |
21 | import java.io.BufferedReader;
22 | import java.io.File;
23 | import java.io.InputStreamReader;
24 | import java.lang.management.ManagementFactory;
25 | import java.util.ArrayList;
26 | import java.util.Collections;
27 |
28 | /**
29 | * Adds some utilities to ensure that the JVM was started with the
30 | * {@code -XstartOnFirstThread} argument, which is required on macOS for LWJGL 3
31 | * to function. Also helps on Windows when users have names with characters from
32 | * outside the Latin alphabet, a common cause of startup crashes.
33 | *
34 | * Based on this java-gaming.org post by kappa
35 | * @author damios
36 | */
37 | public class StartupHelper {
38 |
39 | private static final String JVM_RESTARTED_ARG = "jvmIsRestarted";
40 |
41 | private StartupHelper() {
42 | throw new UnsupportedOperationException();
43 | }
44 |
45 | /**
46 | * Starts a new JVM if the application was started on macOS without the
47 | * {@code -XstartOnFirstThread} argument. This also includes some code for
48 | * Windows, for the case where the user's home directory includes certain
49 | * non-Latin-alphabet characters (without this code, most LWJGL3 apps fail
50 | * immediately for those users). Returns whether a new JVM was started and
51 | * thus no code should be executed.
52 | *
53 | * Usage:
54 | *
55 | *
56 | * public static void main(String... args) {
57 | * if (StartupHelper.startNewJvmIfRequired(true)) return; // This handles macOS support and helps on Windows.
58 | * // after this is the actual main method code
59 | * }
60 | *
61 | *
62 | * @param redirectOutput
63 | * whether the output of the new JVM should be rerouted to the
64 | * old JVM, so it can be accessed in the same place; keeps the
65 | * old JVM running if enabled
66 | * @return whether a new JVM was started and thus no code should be executed
67 | * in this one
68 | */
69 | public static boolean startNewJvmIfRequired(boolean redirectOutput, String[] args) {
70 | String osName = System.getProperty("os.name").toLowerCase();
71 | if (!osName.contains("mac")) {
72 | if (osName.contains("windows")) {
73 | // Here, we are trying to work around an issue with how LWJGL3 loads its extracted .dll files.
74 | // By default, LWJGL3 extracts to the directory specified by "java.io.tmpdir", which is usually the user's home.
75 | // If the user's name has non-ASCII (or some non-alphanumeric) characters in it, that would fail.
76 | // By extracting to the relevant "ProgramData" folder, which is usually "C:\ProgramData", we avoid this.
77 | System.setProperty("java.io.tmpdir", System.getenv("ProgramData") + "/libGDX-temp");
78 | }
79 | return false;
80 | }
81 |
82 | // There is no need for -XstartOnFirstThread on Graal native image
83 | if (!System.getProperty("org.graalvm.nativeimage.imagecode", "").isEmpty()) {
84 | return false;
85 | }
86 |
87 | long pid = LibC.getpid();
88 |
89 | // check whether -XstartOnFirstThread is enabled
90 | if ("1".equals(System.getenv("JAVA_STARTED_ON_FIRST_THREAD_" + pid))) {
91 | return false;
92 | }
93 |
94 | // check whether the JVM was previously restarted
95 | // avoids looping, but most certainly leads to a crash
96 | if ("true".equals(System.getProperty(JVM_RESTARTED_ARG))) {
97 | System.err.println(
98 | "There was a problem evaluating whether the JVM was started with the -XstartOnFirstThread argument.");
99 | return false;
100 | }
101 |
102 | // Restart the JVM with -XstartOnFirstThread
103 | ArrayList jvmArgs = new ArrayList<>();
104 | String separator = System.getProperty("file.separator");
105 | // The following line is used assuming you target Java 8, the minimum for LWJGL3.
106 | String javaExecPath = System.getProperty("java.home") + separator + "bin" + separator + "java";
107 | // If targeting Java 9 or higher, you could use the following instead of the above line:
108 | //String javaExecPath = ProcessHandle.current().info().command().orElseThrow();
109 |
110 | if (!(new File(javaExecPath)).exists()) {
111 | System.err.println(
112 | "A Java installation could not be found. If you are distributing this app with a bundled JRE, be sure to set the -XstartOnFirstThread argument manually!");
113 | return false;
114 | }
115 |
116 | jvmArgs.add(javaExecPath);
117 | jvmArgs.add("-XstartOnFirstThread");
118 | jvmArgs.add("-D" + JVM_RESTARTED_ARG + "=true");
119 | jvmArgs.addAll(ManagementFactory.getRuntimeMXBean().getInputArguments());
120 | jvmArgs.add("-cp");
121 | jvmArgs.add(System.getProperty("java.class.path"));
122 | String mainClass = System.getenv("JAVA_MAIN_CLASS_" + pid);
123 | if (mainClass == null) {
124 | StackTraceElement[] trace = Thread.currentThread().getStackTrace();
125 | if (trace.length > 0) {
126 | mainClass = trace[trace.length - 1].getClassName();
127 | } else {
128 | System.err.println("The main class could not be determined.");
129 | return false;
130 | }
131 | }
132 | jvmArgs.add(mainClass);
133 | Collections.addAll(jvmArgs, args);
134 |
135 | try {
136 | if (!redirectOutput) {
137 | ProcessBuilder processBuilder = new ProcessBuilder(jvmArgs);
138 | processBuilder.start();
139 | } else {
140 | Process process = (new ProcessBuilder(jvmArgs))
141 | .redirectErrorStream(true).start();
142 | BufferedReader processOutput = new BufferedReader(
143 | new InputStreamReader(process.getInputStream()));
144 | String line;
145 |
146 | while ((line = processOutput.readLine()) != null) {
147 | System.out.println(line);
148 | }
149 |
150 | process.waitFor();
151 | }
152 | } catch (Exception e) {
153 | System.err.println("There was a problem restarting the JVM");
154 | e.printStackTrace();
155 | }
156 |
157 | return true;
158 | }
159 |
160 | /**
161 | * Starts a new JVM if the application was started on macOS without the
162 | * {@code -XstartOnFirstThread} argument. Returns whether a new JVM was
163 | * started and thus no code should be executed. Redirects the output of the
164 | * new JVM to the old one.
165 | *
166 | * Usage:
167 | *
168 | *
169 | * public static void main(String... args) {
170 | * if (StartupHelper.startNewJvmIfRequired()) return; // This handles macOS support and helps on Windows.
171 | * // the actual main method code
172 | * }
173 | *
174 | *
175 | * @return whether a new JVM was started and thus no code should be executed
176 | * in this one
177 | */
178 | public static boolean startNewJvmIfRequired(String[] args) {
179 | return startNewJvmIfRequired(true, args);
180 | }
181 | }
182 |
--------------------------------------------------------------------------------
/lwjgl3/src/main/resources/icon128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/lwjgl3/src/main/resources/icon128.png
--------------------------------------------------------------------------------
/lwjgl3/src/main/resources/icon16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/lwjgl3/src/main/resources/icon16.png
--------------------------------------------------------------------------------
/lwjgl3/src/main/resources/icon32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/lwjgl3/src/main/resources/icon32.png
--------------------------------------------------------------------------------
/lwjgl3/src/main/resources/icon64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/lwjgl3/src/main/resources/icon64.png
--------------------------------------------------------------------------------
/raw/icons/bladeinktemplate.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Type=Application
3 | Name=Blade Ink Template
4 | Comment=Blade Ink Template
5 | Exec=$HOME/bladeinktemplate/bin/bladeinktemplate
6 | Terminal=false
7 | Categories=Games;
8 |
--------------------------------------------------------------------------------
/raw/icons/genicons.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ "$(uname)" == "Darwin" ]; then
4 | PATH=$PATH:/Applications/Inkscape.app/Contents/MacOS/
5 | fi
6 |
7 | #ANDROID ICONS
8 | inkscape -w 192 -h 192 --export-area-page --export-filename=../../android/res/drawable-xxxhdpi/ic_launcher.png icon.svg;
9 | inkscape -w 144 -h 144 --export-area-page --export-filename=../../android/res/drawable-xxhdpi/ic_launcher.png icon.svg;
10 | inkscape -w 96 -h 96 --export-area-page --export-filename=../../android/res/drawable-xhdpi/ic_launcher.png icon.svg;
11 | inkscape -w 72 -h 72 --export-area-page --export-filename=../../android/res/drawable-hdpi/ic_launcher.png icon.svg;
12 | inkscape -w 48 -h 48 --export-area-page --export-filename=../../android/res/drawable-mdpi/ic_launcher.png icon.svg;
13 |
14 | #inkscape -w 432 -h 432 --export-area-page --export-filename=../../android/res/drawable-xxxhdpi/ic_launcher_foreground.png icon_fg.svg;
15 | #inkscape -w 324 -h 324 --export-area-page --export-filename=../../android/res/drawable-xxhdpi/ic_launcher_foreground.png icon_fg.svg;
16 | #inkscape -w 216 -h 216 --export-area-page --export-filename=../../android/res/drawable-xhdpi/ic_launcher_foreground.png icon_fg.svg;
17 | #inkscape -w 162 -h 162 --export-area-page --export-filename=../../android/res/drawable-hdpi/ic_launcher_foreground.png icon_fg.svg;
18 | #inkscape -w 108 -h 108 --export-area-page --export-filename=../../android/res/drawable-mdpi/ic_launcher_foreground.png icon_fg.svg;
19 |
20 | inkscape -w 512 -h 512 --export-area-page --export-filename=../../android/ic_launcher-web.png icon.svg;
21 |
22 |
23 | #DESKTOP
24 | inkscape -w 16 -h 16 --export-area-page --export-filename=../../lwjgl3/src/main/resources/icon16.png icon.svg;
25 | inkscape -w 32 -h 32 --export-area-page --export-filename=../../lwjgl3/src/main/resources/icon32.png icon.svg;
26 | inkscape -w 64 -h 64 --export-area-page --export-filename=../../lwjgl3/src/main/resources/icon64.png icon.svg;
27 | inkscape -w 128 -h 128 --export-area-page --export-filename=../../lwjgl3/src/main/resources/icon128.png icon.svg;
28 |
29 | #IOS
30 | #inkscape -w 1024 -h 1024 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/app-store-icon-1024@1x.png icon.svg;
31 | #inkscape -w 76 -h 76 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/ipad-app-icon-76@1x.png icon.svg;
32 | #inkscape -w 152 -h 152 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/ipad-app-icon-76@2x.png icon.svg;
33 | #inkscape -w 20 -h 20 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/ipad-notifications-icon-20@1x.png icon.svg;
34 | #inkscape -w 40 -h 40 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/ipad-notifications-icon-20@2x.png icon.svg;
35 | #inkscape -w 167 -h 167 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/ipad-pro-app-icon-83.5@2x.png icon.svg;
36 | #inkscape -w 29 -h 29 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/ipad-settings-icon-29@1x.png icon.svg;
37 | #inkscape -w 58 -h 58 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/ipad-settings-icon-29@2x.png icon.svg;
38 | #inkscape -w 40 -h 40 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/ipad-spotlight-icon-40@1x.png icon.svg;
39 | #inkscape -w 80 -h 80 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/ipad-spotlight-icon-40@2x.png icon.svg;
40 | #inkscape -w 120 -h 120 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/iphone-app-icon-60@2x.png icon.svg;
41 | #inkscape -w 180 -h 180 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/iphone-app-icon-60@3x.png icon.svg;
42 | #inkscape -w 40 -h 40 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/iphone-notification-icon-20@2x.png icon.svg;
43 | #inkscape -w 60 -h 60 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/iphone-notification-icon-20@3x.png icon.svg;
44 | #inkscape -w 80 -h 80 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-icon-40@2x.png icon.svg;
45 | #inkscape -w 120 -h 120 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-icon-40@3x.png icon.svg;
46 | #inkscape -w 58 -h 58 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-settings-icon-29@2x.png icon.svg;
47 | #inkscape -w 87 -h 87 --export-area-page --export-filename=../../ios/data/Media.xcassets/AppIcon.appiconset/iphone-spotlight-settings-icon-29@3x.png icon.svg;
48 |
49 |
50 | ####### ICNS AND ICO
51 | ICONS_DIR=tmp.iconset
52 |
53 | mkdir -p $ICONS_DIR
54 | inkscape -w 16 -h 16 --export-area-page -o $ICONS_DIR/icon16.png icon.svg;
55 | inkscape -w 32 -h 32 --export-area-page -o $ICONS_DIR/icon32.png icon.svg;
56 | #inkscape -w 64 -h 64 --export-area-page -o $ICONS_DIR/icon64.png icon.svg;
57 | inkscape -w 128 -h 128 --export-area-page -o $ICONS_DIR/icon128.png icon.svg;
58 | inkscape -w 256 -h 256 --export-area-page -o $ICONS_DIR/icon256.png icon.svg;
59 | inkscape -w 512 -h 512 --export-area-page -o $ICONS_DIR/icon512.png icon.svg;
60 | #inkscape -w 1024 -h 1024 --export-area-page -o $ICONS_DIR/icon1024.png icon.svg;
61 |
62 | #png2icns icon.icns icon16.png icon32.png icon64.png icon128.png icon256.png icon512.png icon1024.png
63 |
64 | # 64x64 dimension not supported
65 | # if macos use iconutil else use png2icns
66 | if [ "$(uname)" == "Darwin" ]; then
67 | iconutil -c icns -o icon.icns $ICONS_DIR
68 | else
69 | png2icns icon.icns $ICONS_DIR/*.png
70 | fi
71 |
72 | convert $ICONS_DIR/*.png icon.ico
73 |
74 | mv icon.ico ../../lwjgl3/icons/logo.ico
75 | mv icon.icns ../../lwjgl3/icons/logo.icns
76 | cp $ICONS_DIR/icon128.png ../../lwjgl3/icons/logo.png
77 |
78 | rm -rf $ICONS_DIR
79 |
80 |
--------------------------------------------------------------------------------
/raw/ui/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/back.png
--------------------------------------------------------------------------------
/raw/ui/border_rect.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/border_rect.9.png
--------------------------------------------------------------------------------
/raw/ui/credits.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/credits.png
--------------------------------------------------------------------------------
/raw/ui/debug.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/debug.png
--------------------------------------------------------------------------------
/raw/ui/delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/delete.png
--------------------------------------------------------------------------------
/raw/ui/dialog_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/dialog_down.png
--------------------------------------------------------------------------------
/raw/ui/dialog_up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/dialog_up.png
--------------------------------------------------------------------------------
/raw/ui/facebook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/facebook.png
--------------------------------------------------------------------------------
/raw/ui/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/help.png
--------------------------------------------------------------------------------
/raw/ui/instagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/instagram.png
--------------------------------------------------------------------------------
/raw/ui/leave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/leave.png
--------------------------------------------------------------------------------
/raw/ui/menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/menu.png
--------------------------------------------------------------------------------
/raw/ui/pack.json:
--------------------------------------------------------------------------------
1 | {
2 | pot: false,
3 | paddingX: 2,
4 | paddingY: 2,
5 | duplicatePadding: true,
6 | edgePadding: true,
7 | rotation: false,
8 | minWidth: 16,
9 | minHeight: 16,
10 | maxWidth: 4096,
11 | maxHeight: 4096,
12 | stripWhitespaceX: true,
13 | stripWhitespaceY: true,
14 | alphaThreshold: 0,
15 | filterMin: Linear,
16 | filterMag: Linear,
17 | wrapX: ClampToEdge,
18 | wrapY: ClampToEdge,
19 | format: RGBA8888,
20 | alias: true,
21 | outputFormat: png,
22 | jpegQuality: 0.9,
23 | ignoreBlankImages: true,
24 | fast: false,
25 | debug: false,
26 | }
27 |
--------------------------------------------------------------------------------
/raw/ui/plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/plus.png
--------------------------------------------------------------------------------
/raw/ui/rect.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/rect.9.png
--------------------------------------------------------------------------------
/raw/ui/twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/twitter.png
--------------------------------------------------------------------------------
/raw/ui/white_pixel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bladecoder/blade-ink-template/03b7f65b31bbfe5cc1b0b1bb70e46fd730ddbfac/raw/ui/white_pixel.png
--------------------------------------------------------------------------------
/release.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | # The destination folder for the packaged application
5 | DIST_DIR=$HOME"/PACKAGES"
6 |
7 | # IOS signing
8 | IOS_SIGN_IDENTITY="Apple Distribution"
9 | IOS_PROVISIONING_PROFILE=XXX
10 |
11 | # Android signing
12 | ANDROID_KEYSTORE=$HOME/Dropbox/docs/ids/rgarcia_android.keystore
13 | ANDROID_KEY_ALIAS=bladecoder
14 |
15 | PROJECT_NAME=`cat gradle.properties | grep appName | cut -d'=' -f2`
16 |
17 | if [ "$#" -eq 0 ]
18 | then
19 | echo "Release type param needed: android, ios or desktop"
20 | exit 0
21 | else
22 | RELEASE_MODE=$1
23 | fi
24 |
25 | echo -n "Version: "
26 | read VERSION
27 | echo
28 |
29 | if [[ "$OSTYPE" == 'darwin'* ]]; then
30 | sed -i .bak 's/version=.*/version='$VERSION'/' gradle.properties
31 | else
32 | sed -i 's/version=.*/version='$VERSION'/' gradle.properties
33 | fi
34 |
35 | if [ "$RELEASE_MODE" == "android" ] || [ "$RELEASE_MODE" == "apk" ] || [ "$RELEASE_MODE" == "aab" ]; then
36 | echo -n "Version Code: "
37 | read VERSION_CODE
38 | echo
39 | echo -n "Keystore Password: "
40 | read -s KEYSTORE_PASSWD
41 | echo
42 | echo -n "Key Password: "
43 | read -s KEY_PASSWD
44 | echo
45 |
46 | if [ "$RELEASE_MODE" == "aab" ] ; then
47 | RELFILENAME="$DIST_DIR"/$PROJECT_NAME-$VERSION.aab
48 |
49 | ./gradlew -Pkeystore=$ANDROID_KEYSTORE -PstorePassword=$KEYSTORE_PASSWD -Palias=$ANDROID_KEY_ALIAS -PkeyPassword=$KEY_PASSWD android:bundleRelease -Pversion=$VERSION -PversionCode=$VERSION_CODE -Passet_pack
50 | cp android/build/outputs/bundle/release/android-release.aab "$RELFILENAME"
51 | else
52 | RELFILENAME="$DIST_DIR"/$PROJECT_NAME-$VERSION.apk
53 |
54 | ./gradlew -Pkeystore=$ANDROID_KEYSTORE -PstorePassword=$KEYSTORE_PASSWD -Palias=$ANDROID_KEY_ALIAS -PkeyPassword=$KEY_PASSWD android:assembleRelease -Pversion=$VERSION -PversionCode=$VERSION_CODE
55 | cp android/build/outputs/apk/release/android-release.apk "$RELFILENAME"
56 | fi
57 |
58 | elif [[ "$RELEASE_MODE" == "desktop" ]]; then
59 | RELFILENAME="$DIST_DIR"/$PROJECT_NAME-steam-$VERSION.jar
60 | ./gradlew desktop:dist -Pversion=$VERSION
61 | cp desktop/build/libs/$PROJECT_NAME-desktop-$VERSION.jar "$RELFILENAME"
62 | elif [[ "$RELEASE_MODE" == "ios" ]]; then
63 | RELFILENAME="$DIST_DIR"/$PROJECT_NAME-$VERSION.ipa
64 |
65 | echo -n "Version Code: "
66 | read VERSION_CODE
67 | echo
68 |
69 | # Update ios/robovm.properties
70 | sed -i .bak 's/app.version=.*/app.version='$VERSION'/' ios/robovm.properties
71 | sed -i .bak 's/app.build=.*/app.build='$VERSION_CODE'/' ios/robovm.properties
72 |
73 | ./gradlew -Probovm.iosSignIdentity="$IOS_SIGN_IDENTITY" -Probovm.iosProvisioningProfile="$IOS_PROVISIONING_PROFILE" ios:clean ios:createIPA
74 | cp ios/build/robovm/IOSLauncher.ipa "$RELFILENAME"
75 | else
76 | echo Release type param not valid: $RELEASE_MODE. Valid options: android, ios or desktop.
77 | exit -1
78 | fi
79 |
80 | echo -- RELEASE OK: $RELFILENAME --
81 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | // Can be used to automatically download a JDK with the correct version.
2 | plugins {
3 | id('org.gradle.toolchains.foojay-resolver-convention') version '0.7.0'
4 | }
5 | // A list of which subprojects to load as part of the same larger project.
6 | // You can remove Strings from the list and reload the Gradle project
7 | // if you want to temporarily disable a subproject.
8 | include 'core', 'android', 'ios', 'lwjgl3'
9 |
--------------------------------------------------------------------------------