summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-11-09 11:35:28 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-11-09 11:35:28 +0100
commitc7e871e749e6531deb3b49311e0c5b71523aeff8 (patch)
treeb9dcd9ba57c2804347293cb445a0a3413ff83dbd /core/src
parent1ecc5abda207f70b0054415fa9abe9c5423c2206 (diff)
downloadRustAndDust-c7e871e749e6531deb3b49311e0c5b71523aeff8.zip
RustAndDust-c7e871e749e6531deb3b49311e0c5b71523aeff8.tar.gz
use freetype font
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/rustanddust/RustAndDust.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/src/ch/asynk/rustanddust/RustAndDust.java b/core/src/ch/asynk/rustanddust/RustAndDust.java
index 52732a3..9c91efe 100644
--- a/core/src/ch/asynk/rustanddust/RustAndDust.java
+++ b/core/src/ch/asynk/rustanddust/RustAndDust.java
@@ -4,9 +4,12 @@ import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.audio.Sound;
+import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
+import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
+import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter;
import ch.asynk.rustanddust.screens.MenuScreen;
import ch.asynk.rustanddust.screens.GameScreen;
@@ -146,8 +149,13 @@ public class RustAndDust extends Game
manager.load("data/ui.atlas", TextureAtlas.class);
manager.finishLoading();
uiAtlas = manager.get("data/ui.atlas", TextureAtlas.class);
- fontB = new BitmapFont(Gdx.files.internal("skin/veteran.fnt"), uiAtlas.findRegion("veteran-black"));
- fontW = new BitmapFont(Gdx.files.internal("skin/veteran.fnt"), uiAtlas.findRegion("veteran-white"));
+ FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("skin/veteran-typewriter.ttf"));
+ FreeTypeFontParameter parameter = new FreeTypeFontParameter();
+ parameter.size = 20;
+ parameter.color = Color.BLACK;
+ fontB = generator.generateFont(parameter);
+ parameter.color = Color.WHITE;
+ fontW = generator.generateFont(parameter);
}
private void unloadUiAssets()