• R/O
  • SSH

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂efe8ac8299dd8bb67b64b27eed2a57a4e31d0c86 (tree)
時間2022-01-10 06:21:20
作者sebastian_bugiu
Commitersebastian_bugiu

Log Message

Added new font ttfs.

Change Summary

差異

diff -r f67716a9e6c2 -r efe8ac8299dd android/assets/Republica Minor Bold Italic.ttf
Binary file android/assets/Republica Minor Bold Italic.ttf has changed
diff -r f67716a9e6c2 -r efe8ac8299dd android/assets/Republica Minor Regular.ttf
Binary file android/assets/Republica Minor Regular.ttf has changed
diff -r f67716a9e6c2 -r efe8ac8299dd android/assets/arial.ttf
Binary file android/assets/arial.ttf has changed
diff -r f67716a9e6c2 -r efe8ac8299dd android/assets/uiskin.json
--- a/android/assets/uiskin.json Sun Jan 09 21:46:47 2022 +0200
+++ b/android/assets/uiskin.json Sun Jan 09 23:21:20 2022 +0200
@@ -1,5 +1,5 @@
11 {
2-BitmapFont: { default-font: { file: default.fnt } },
2+
33 Color: {
44 green: { a: 1, b: 0, g: 1, r: 0 },
55 white: { a: 1, b: 1, g: 1, r: 1 },
diff -r f67716a9e6c2 -r efe8ac8299dd build.gradle
--- a/build.gradle Sun Jan 09 21:46:47 2022 +0200
+++ b/build.gradle Sun Jan 09 23:21:20 2022 +0200
@@ -12,7 +12,7 @@
1212 classpath 'com.android.tools.build:gradle:4.1.3'
1313 classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.12'
1414 classpath "com.badlogicgames.gdx:gdx-tools:1.10.0"
15-
15+ classpath "com.badlogicgames.gdx:gdx-freetype:1.10.0"
1616 }
1717 }
1818
@@ -49,7 +49,7 @@
4949 api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
5050 api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
5151 api "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
52-
52+ api "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
5353 }
5454 }
5555
@@ -70,6 +70,11 @@
7070 natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a"
7171 natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
7272 natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64"
73+ api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
74+ natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
75+ natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
76+ natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
77+ natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
7378
7479 }
7580 }
@@ -86,7 +91,7 @@
8691 api "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
8792 api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
8893 api "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios"
89-
94+ api "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
9095 }
9196 }
9297
@@ -97,7 +102,7 @@
97102 dependencies {
98103 api "com.badlogicgames.gdx:gdx:$gdxVersion"
99104 api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
100-
105+ api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
101106 }
102107 }
103108
diff -r f67716a9e6c2 -r efe8ac8299dd core/src/com/headwayent/spacerocket/CreditsActivity.java
--- a/core/src/com/headwayent/spacerocket/CreditsActivity.java Sun Jan 09 21:46:47 2022 +0200
+++ b/core/src/com/headwayent/spacerocket/CreditsActivity.java Sun Jan 09 23:21:20 2022 +0200
@@ -34,7 +34,7 @@
3434
3535 Gdx.input.setInputProcessor(stage);
3636
37- Skin skin = new Skin(Gdx.files.internal("uiskin.json"));
37+ Skin skin = SpaceRocket.getGame().getSkin();
3838
3939 titleLabel = new Label("Options", skin);
4040 creditsLabel = new Label("Sound enabled", skin);
diff -r f67716a9e6c2 -r efe8ac8299dd core/src/com/headwayent/spacerocket/HelpActivity.java
--- a/core/src/com/headwayent/spacerocket/HelpActivity.java Sun Jan 09 21:46:47 2022 +0200
+++ b/core/src/com/headwayent/spacerocket/HelpActivity.java Sun Jan 09 23:21:20 2022 +0200
@@ -37,7 +37,7 @@
3737 Gdx.input.setInputProcessor(stage);
3838
3939 // temporary until we have asset manager in
40- Skin skin = new Skin(Gdx.files.internal("uiskin.json"));
40+ Skin skin = SpaceRocket.getGame().getSkin();
4141
4242 String helpString = "CONTROLS \n\n For movement use direction keys or the\n" +
4343 "arrows on the screen or the accelerometer.\n" +
diff -r f67716a9e6c2 -r efe8ac8299dd core/src/com/headwayent/spacerocket/HighScoreActivity.java
--- a/core/src/com/headwayent/spacerocket/HighScoreActivity.java Sun Jan 09 21:46:47 2022 +0200
+++ b/core/src/com/headwayent/spacerocket/HighScoreActivity.java Sun Jan 09 23:21:20 2022 +0200
@@ -87,7 +87,7 @@
8787 //table.setDebug(true);
8888 stage.addActor(table);
8989
90- Skin skin = new Skin(Gdx.files.internal("uiskin.json"));
90+ Skin skin = SpaceRocket.getGame().getSkin();
9191
9292 Label titleLabel = new Label("High Score", skin);
9393
diff -r f67716a9e6c2 -r efe8ac8299dd core/src/com/headwayent/spacerocket/MainMenuActivity.java
--- a/core/src/com/headwayent/spacerocket/MainMenuActivity.java Sun Jan 09 21:46:47 2022 +0200
+++ b/core/src/com/headwayent/spacerocket/MainMenuActivity.java Sun Jan 09 23:21:20 2022 +0200
@@ -36,7 +36,7 @@
3636 Gdx.input.setInputProcessor(stage);
3737
3838 // temporary until we have asset manager in
39- Skin skin = new Skin(Gdx.files.internal("uiskin.json"));
39+ Skin skin = SpaceRocket.getGame().getSkin();
4040
4141 //create buttons
4242 Label title = new Label("Hotshot", skin);
diff -r f67716a9e6c2 -r efe8ac8299dd core/src/com/headwayent/spacerocket/OptionsMenuActivity.java
--- a/core/src/com/headwayent/spacerocket/OptionsMenuActivity.java Sun Jan 09 21:46:47 2022 +0200
+++ b/core/src/com/headwayent/spacerocket/OptionsMenuActivity.java Sun Jan 09 23:21:20 2022 +0200
@@ -42,7 +42,7 @@
4242
4343 Gdx.input.setInputProcessor(stage);
4444
45- Skin skin = new Skin(Gdx.files.internal("uiskin.json"));
45+ Skin skin = SpaceRocket.getGame().getSkin();
4646
4747 titleLabel = new Label("Options", skin);
4848 soundLabel = new Label("Sound enabled", skin);
@@ -97,16 +97,16 @@
9797 });
9898
9999 table.add(titleLabel).colspan(2);
100- table.row().pad(10, 10, 10, 10);
100+ table.row().pad(10, 0, 10, 0);
101101 table.add(soundLabel).left();
102102 table.add(soundCheckbox);
103- table.row().pad(10, 10, 10, 10);
103+ table.row().pad(10, 0, 10, 0);
104104 table.add(vibrationLabel).left();
105105 table.add(vibrationCheckbox);
106- table.row().pad(10, 10, 10, 10);
106+ table.row().pad(10, 0, 10, 0);
107107 table.add(shipMovementLabel).left();
108108 table.add(shipMovementSelectBox);
109- table.row().pad(10, 10, 10, 10);
109+ table.row().pad(10, 0, 10, 0);
110110 table.add(backButton).colspan(2).fillX().uniformX();
111111
112112
diff -r f67716a9e6c2 -r efe8ac8299dd core/src/com/headwayent/spacerocket/SpaceRocket.java
--- a/core/src/com/headwayent/spacerocket/SpaceRocket.java Sun Jan 09 21:46:47 2022 +0200
+++ b/core/src/com/headwayent/spacerocket/SpaceRocket.java Sun Jan 09 23:21:20 2022 +0200
@@ -2,12 +2,18 @@
22
33 import com.badlogic.gdx.Game;
44 import com.badlogic.gdx.Gdx;
5+import com.badlogic.gdx.assets.AssetManager;
6+import com.badlogic.gdx.assets.loaders.SkinLoader;
57 import com.badlogic.gdx.files.FileHandle;
8+import com.badlogic.gdx.graphics.Color;
69 import com.badlogic.gdx.graphics.g2d.BitmapFont;
710 import com.badlogic.gdx.graphics.g2d.SpriteBatch;
811 import com.badlogic.gdx.graphics.g2d.TextureAtlas;
912 import com.badlogic.gdx.graphics.g2d.TextureRegion;
13+import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
14+import com.badlogic.gdx.scenes.scene2d.ui.Skin;
1015 import com.badlogic.gdx.utils.Array;
16+import com.badlogic.gdx.utils.ObjectMap;
1117 import com.badlogic.gdx.utils.ScreenUtils;
1218 import com.headwayent.spacerocket.old.BossSprite;
1319 import com.headwayent.spacerocket.old.DifficultySelection;
@@ -40,6 +46,8 @@
4046 private MultiplayerJoinGameActivity multiplayerJoinGameActivity;
4147 private MultiplayerLobbyActivity multiplayerLobbyActivity;
4248 private FinalResultsActivity finalResultsActivity;
49+ private Skin skin;
50+ private AssetManager assetManager;
4351
4452 public enum Mode {
4553 CLIENT, SERVER
@@ -73,7 +81,33 @@
7381 TextureRegion t = tr.get(i);
7482 t.flip(false, true);
7583 }
76- font = new BitmapFont(true);
84+ FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("Republica Minor Regular.ttf"));
85+ FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
86+ parameter.size = 13;
87+ parameter.borderWidth = 1;
88+ parameter.color = Color.GREEN;
89+// parameter.shadowOffsetX = 3;
90+// parameter.shadowOffsetY = 3;
91+// parameter.shadowColor = new Color(0, 0.5f, 0, 0.75f);
92+// parameter.flip = true;
93+ font = generator.generateFont(parameter); // For the menu ttf.
94+// ObjectMap<String, Object> fontMap = new ObjectMap<>();
95+// fontMap.put("default-font", font);
96+//
97+// SkinLoader.SkinParameter skinParameter = new SkinLoader.SkinParameter(fontMap);
98+// assetManager = new AssetManager();
99+// assetManager.load("uiskin.json", Skin.class, skinParameter);
100+// assetManager.finishLoading();
101+// skin = assetManager.get("uiskin.json", Skin.class);
102+ skin = new Skin();
103+ skin.addRegions(new TextureAtlas(Gdx.files.internal("uiskin.atlas")));
104+// skin.remove("default-font", BitmapFont.class);
105+ skin.add("default-font", font, BitmapFont.class);
106+ skin.load(Gdx.files.internal("uiskin.json"));
107+// font = new BitmapFont(true);
108+ parameter.flip = true;
109+ font = generator.generateFont(parameter); // For the in game flipped ttf.
110+ generator.dispose();
77111 canvas = new ExtendedCanvas();
78112 setScreen(new MainMenuActivity(this));
79113 }
@@ -317,6 +351,14 @@
317351 return canvas;
318352 }
319353
354+ public Skin getSkin() {
355+ return skin;
356+ }
357+
358+ public AssetManager getAssetManager() {
359+ return assetManager;
360+ }
361+
320362 public VersionStats getVersionStats() {
321363 return versionStats;
322364 }
diff -r f67716a9e6c2 -r efe8ac8299dd core/src/com/headwayent/spacerocket/old/DifficultySelection.java
--- a/core/src/com/headwayent/spacerocket/old/DifficultySelection.java Sun Jan 09 21:46:47 2022 +0200
+++ b/core/src/com/headwayent/spacerocket/old/DifficultySelection.java Sun Jan 09 23:21:20 2022 +0200
@@ -64,7 +64,7 @@
6464 Gdx.input.setInputProcessor(stage);
6565
6666 // temporary until we have asset manager in
67- Skin skin = new Skin(Gdx.files.internal("uiskin.json"));
67+ Skin skin = SpaceRocket.getGame().getSkin();
6868
6969 Label title = new Label("Select difficulty", skin);
7070 title.setAlignment(Align.center);