remove hard-drawn shadow from images, they're now drawn by the software
Former-commit-id: fe09a6ba3dd3b2f9e53874c854210f4f73bac160 Former-commit-id: f2b1571609c36cf4e177488ed2978df671ffa80a
|
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 418 B After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 149 B After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 434 B After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 476 B After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 934 B After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 134 B After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 197 B After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 386 B After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 503 KiB After Width: | Height: | Size: 438 KiB |
|
Before Width: | Height: | Size: 497 KiB After Width: | Height: | Size: 439 KiB |
@@ -263,17 +263,17 @@ constructor() : Font {
|
||||
indexJong, jongRow
|
||||
)*/
|
||||
|
||||
hangulSheet.getSubImage(indexCho, choRow).draw(
|
||||
hangulSheet.getSubImage(indexCho, choRow).drawWithShadow(
|
||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
||||
Math.round(((H - H_HANGUL) / 2).toFloat() + y + 1f).toFloat(),
|
||||
scale.toFloat(), thisCol
|
||||
)
|
||||
hangulSheet.getSubImage(indexJung, jungRow).draw(
|
||||
hangulSheet.getSubImage(indexJung, jungRow).drawWithShadow(
|
||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
||||
Math.round(((H - H_HANGUL) / 2).toFloat() + y + 1f).toFloat(),
|
||||
scale.toFloat(), thisCol
|
||||
)
|
||||
hangulSheet.getSubImage(indexJong, jongRow).draw(
|
||||
hangulSheet.getSubImage(indexJong, jongRow).drawWithShadow(
|
||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
||||
Math.round(((H - H_HANGUL) / 2).toFloat() + y + 1f).toFloat(),
|
||||
scale.toFloat(), thisCol
|
||||
@@ -321,7 +321,7 @@ constructor() : Font {
|
||||
wenQuanYiIndexX(ch),
|
||||
wenQuanYi1IndexY(ch)
|
||||
)*/
|
||||
wenQuanYi_1.getSubImage(wenQuanYiIndexX(ch), wenQuanYi1IndexY(ch)).draw(
|
||||
wenQuanYi_1.getSubImage(wenQuanYiIndexX(ch), wenQuanYi1IndexY(ch)).drawWithShadow(
|
||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
||||
Math.round((H - H_UNIHAN) / 2 + y).toFloat(),
|
||||
scale.toFloat(), thisCol
|
||||
@@ -349,7 +349,7 @@ constructor() : Font {
|
||||
wenQuanYiIndexX(ch),
|
||||
wenQuanYi2IndexY(ch)
|
||||
)*/
|
||||
wenQuanYi_2.getSubImage(wenQuanYiIndexX(ch), wenQuanYi2IndexY(ch)).draw(
|
||||
wenQuanYi_2.getSubImage(wenQuanYiIndexX(ch), wenQuanYi2IndexY(ch)).drawWithShadow(
|
||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
||||
Math.round((H - H_UNIHAN) / 2 + y).toFloat(),
|
||||
scale.toFloat(), thisCol
|
||||
@@ -461,7 +461,7 @@ constructor() : Font {
|
||||
else 0,
|
||||
sheetX, sheetY
|
||||
)*/
|
||||
sheetKey[prevInstance]!!.getSubImage(sheetX, sheetY).draw(
|
||||
sheetKey[prevInstance]!!.getSubImage(sheetX, sheetY).drawWithShadow(
|
||||
Math.round(x + getWidthSubstr(s, i + 1) - glyphW).toFloat(),
|
||||
|
||||
// to deal with the height difference of the sheets
|
||||
@@ -738,5 +738,17 @@ constructor() : Font {
|
||||
Pair("x", colourKey[0x1A.toChar()]),
|
||||
Pair("k", colourKey[0x1B.toChar()])
|
||||
)
|
||||
}
|
||||
|
||||
}// end of companion object
|
||||
}
|
||||
|
||||
fun Image.drawWithShadow(x: Float, y: Float, color: Color) =
|
||||
this.drawWithShadow(x, y, 1f, color)
|
||||
|
||||
fun Image.drawWithShadow(x: Float, y: Float, scale: Float, color: Color) {
|
||||
this.draw(x + 1, y + 1, scale, color.darker(0.5f))
|
||||
this.draw(x , y + 1, scale, color.darker(0.5f))
|
||||
this.draw(x + 1, y , scale, color.darker(0.5f))
|
||||
|
||||
this.draw(x, y, scale, color)
|
||||
}
|
||||
|
||||
@@ -60,24 +60,11 @@ class TinyAlphNum : Font {
|
||||
thisCol = GameFontBase.colourKey[ch]!!
|
||||
continue
|
||||
}
|
||||
if (index != null) {
|
||||
// shadow
|
||||
fontSheet.getSubImage(index % 16, index / 16).draw(
|
||||
x + textPosOffset + 1, y, thisCol.darker(0.5f)
|
||||
)
|
||||
fontSheet.getSubImage(index % 16, index / 16).draw(
|
||||
x + textPosOffset + 1, y + 1, thisCol.darker(0.5f)
|
||||
)
|
||||
fontSheet.getSubImage(index % 16, index / 16).draw(
|
||||
x + textPosOffset, y + 1, thisCol.darker(0.5f)
|
||||
)
|
||||
|
||||
fontSheet.getSubImage(index % 16, index / 16).drawWithShadow(
|
||||
x + textPosOffset, y, thisCol
|
||||
)
|
||||
|
||||
// main
|
||||
fontSheet.getSubImage(index % 16, index / 16).draw(
|
||||
x + textPosOffset, y, thisCol
|
||||
)
|
||||
}
|
||||
textPosOffset += W
|
||||
}
|
||||
}
|
||||
|
||||