mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-06 08:38:30 +09:00
gdx font: can customise font spritesheet location
This commit is contained in:
@@ -26,7 +26,7 @@ class TestTestTest : ApplicationAdapter() {
|
|||||||
batch = SpriteBatch()
|
batch = SpriteBatch()
|
||||||
img = Texture("assets/test_texture.tga")
|
img = Texture("assets/test_texture.tga")
|
||||||
|
|
||||||
gameFont = GameFontBase(false)
|
gameFont = GameFontBase("assets/graphics/fonts")
|
||||||
//gameFont = BitmapFont()
|
//gameFont = BitmapFont()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import java.util.zip.GZIPInputStream
|
|||||||
*
|
*
|
||||||
* Created by minjaesong on 2017-06-15.
|
* Created by minjaesong on 2017-06-15.
|
||||||
*/
|
*/
|
||||||
class GameFontBase(val noShadow: Boolean = false) : BitmapFont() {
|
class GameFontBase(fontDir: String, val noShadow: Boolean = false) : BitmapFont() {
|
||||||
|
|
||||||
private fun getHanChosung(hanIndex: Int) = hanIndex / (JUNG_COUNT * JONG_COUNT)
|
private fun getHanChosung(hanIndex: Int) = hanIndex / (JUNG_COUNT * JONG_COUNT)
|
||||||
private fun getHanJungseong(hanIndex: Int) = hanIndex / JONG_COUNT % JUNG_COUNT
|
private fun getHanJungseong(hanIndex: Int) = hanIndex / JONG_COUNT % JUNG_COUNT
|
||||||
@@ -140,7 +140,7 @@ class GameFontBase(val noShadow: Boolean = false) : BitmapFont() {
|
|||||||
SHEET_THAI_VARW
|
SHEET_THAI_VARW
|
||||||
)
|
)
|
||||||
|
|
||||||
private val fontParentDir = "assets/graphics/fonts/"
|
private val fontParentDir = if (fontDir.endsWith('/') || fontDir.endsWith('\\')) fontDir else "$fontDir/"
|
||||||
private val fileList = arrayOf( // MUST BE MATCHING WITH SHEET INDICES!!
|
private val fileList = arrayOf( // MUST BE MATCHING WITH SHEET INDICES!!
|
||||||
"ascii_variable.tga",
|
"ascii_variable.tga",
|
||||||
"hangul_johab.tga",
|
"hangul_johab.tga",
|
||||||
|
|||||||
Reference in New Issue
Block a user