fixed up the test app

- exports the drawn text as demo.PNG
- scrollable with scroll wheels and arrow keys
This commit is contained in:
minjaesong
2018-08-09 17:42:16 +09:00
parent cf3091421f
commit cdd0514ca0
6 changed files with 138 additions and 80 deletions

View File

@@ -313,17 +313,19 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
// unpack gz if applicable
if (it.endsWith(".gz")) {
val tmpFileName = "tmp_${it.dropLast(7)}.tga"
val gzi = GZIPInputStream(Gdx.files.internal(fontParentDir + it).read(8192))
val wholeFile = gzi.readBytes()
gzi.close()
val fos = BufferedOutputStream(FileOutputStream("tmp_wenquanyi.tga"))
val fos = BufferedOutputStream(FileOutputStream(tmpFileName))
fos.write(wholeFile)
fos.flush()
fos.close()
pixmap = Pixmap(Gdx.files.internal("tmp_wenquanyi.tga"))
pixmap = Pixmap(Gdx.files.internal(tmpFileName))
File("tmp_wenquanyi.tga").delete()
File(tmpFileName).delete()
}
else {
pixmap = Pixmap(Gdx.files.internal(fontParentDir + it))