mirror of
https://github.com/curioustorvald/Terrarum-sans-bitmap.git
synced 2026-03-07 20:01:52 +09:00
fixed bad offset but still bad render
This commit is contained in:
Binary file not shown.
BIN
demo.PNG
BIN
demo.PNG
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 15 KiB |
@@ -507,9 +507,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
|
||||
sheetsPack.add(texRegPack)
|
||||
|
||||
|
||||
|
||||
//pixmap.dispose() // you are terminated
|
||||
pixmap.dispose() // you are terminated
|
||||
}
|
||||
|
||||
sheets = sheetsPack.toTypedArray()
|
||||
@@ -550,7 +548,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
private var pixmapTextureHolder: Texture? = null
|
||||
private var pixmapHolder: Pixmap? = null
|
||||
|
||||
private val pixmapOffsetY = -10
|
||||
private val pixmapOffsetY = 10
|
||||
|
||||
override fun draw(batch: Batch, charSeq: CharSequence, x: Float, y: Float): GlyphLayout? {
|
||||
val oldProjectionMatrix = batch.projectionMatrix
|
||||
@@ -622,7 +620,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
pixmapHolder?.dispose() /* you can do this one */
|
||||
//pixmapTextureHolder?.dispose() /* you CAN'T do this however */
|
||||
|
||||
pixmapHolder = Pixmap(getWidth(textBuffer), H + -(pixmapOffsetY * 2), Pixmap.Format.RGBA8888)
|
||||
pixmapHolder = Pixmap(getWidth(textBuffer), H + (pixmapOffsetY * 2), Pixmap.Format.RGBA8888)
|
||||
|
||||
var index = 0
|
||||
while (index <= textBuffer.lastIndex) {
|
||||
@@ -712,7 +710,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
||||
batch.color = mainCol
|
||||
makeShadow(pixmapHolder)
|
||||
pixmapTextureHolder = Texture(pixmapHolder)
|
||||
batch.draw(pixmapTextureHolder, x.toFloat(), y.toFloat())
|
||||
batch.draw(pixmapTextureHolder, x.toFloat(), (y - pixmapOffsetY).toFloat())
|
||||
|
||||
/*textTexture.end()
|
||||
|
||||
|
||||
@@ -1,3 +1,27 @@
|
||||
/*
|
||||
* Terrarum Sans Bitmap
|
||||
*
|
||||
* Copyright (c) 2018 Minjae Song (Torvald)
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.torvald.terrarumsansbitmap.gdx
|
||||
|
||||
import com.badlogic.gdx.files.FileHandle
|
||||
|
||||
Reference in New Issue
Block a user