diff --git a/cardgen/src/commonMain/kotlin/card/card.kt b/cardgen/src/commonMain/kotlin/card/card.kt index 61d9a56..e7f2116 100644 --- a/cardgen/src/commonMain/kotlin/card/card.kt +++ b/cardgen/src/commonMain/kotlin/card/card.kt @@ -29,26 +29,26 @@ fun Stage.putBorder(cdi: CardDrawingInput) { } } -/** @return The tile's y */ +/** @return The tile's bottom y */ fun Stage.putCreatureTile(cdi: CardDrawingInput): Double { val imgx = (width - (cdi.cbmp.width * creatureScale)) / 2; val imgxCenter = imgx + (cdi.cbmp.width / 2) val imgy = (height - (cdi.cbmp.height * creatureScale)) / 8; val imgyCenter = imgy + (cdi.cbmp.height / 2) - image(cdi.cbmp) { + val img = image(cdi.cbmp) { position(imgx, imgy) scale = creatureScale smoothing = false } - return imgy + return imgy + img.height } /** - * @param tiley The creature's tile y + * @param tileboty The creature's tile bottom y * @return The text's y */ -fun Stage.putCreatureName(cdi: CardDrawingInput, tiley: Double): Double { - val texty = tiley + cdi.cbmp.height / 2 + (cdi.font.fontSize * 2) +fun Stage.putCreatureName(cdi: CardDrawingInput, tileboty: Double): Double { + val texty = tileboty val w = width text(cdi.creature.name, font = cdi.font, textSize = cdi.font.fontSize.toDouble(), color = cdi.creature.team.color) { diff --git a/cardgen/src/commonMain/kotlin/main.kt b/cardgen/src/commonMain/kotlin/main.kt index d274c96..9c8d37b 100644 --- a/cardgen/src/commonMain/kotlin/main.kt +++ b/cardgen/src/commonMain/kotlin/main.kt @@ -19,7 +19,7 @@ suspend fun main() = Korge(width = (24 * 9), height = ((24 * 4) + 12) * 3, bgcol val tiles = Tile.loadFromDisk(dataJson, resourcesVfs["tiles.png"].readBitmap()) val creatures = Creature.loadFromDisk(dataJson, resourcesVfs["creatures.png"].readBitmap()) - val font = resourcesVfs["romulus_medium_32.fnt"].readBitmapFont() + val font = resourcesVfs["romulus_medium_24.fnt"].readBitmapFont() for ((i, p) in creatures.withIndex()) { prepareCard(p.first, p.second, font, tiles) diff --git a/cardgen/src/commonMain/resources/romulus_medium_24.fnt b/cardgen/src/commonMain/resources/romulus_medium_24.fnt new file mode 100644 index 0000000..7416f88 --- /dev/null +++ b/cardgen/src/commonMain/resources/romulus_medium_24.fnt @@ -0,0 +1,98 @@ +info face="Romulus" size=24 bold=0 italic=0 smooth=1 spacing=0,0 +common lineHeight=30 base=22 scaleW=256 scaleH=128 pages=1 +page id=0 file="romulus_medium_24.png" +char id=32 x=1 y=17 width=0 height=0 xoffset=0 yoffset=22 xadvance=10 page=0 +char id=33 x=2 y=3 width=4 height=14 xoffset=0 yoffset=8 xadvance=6 page=0 +char id=34 x=7 y=3 width=10 height=6 xoffset=0 yoffset=8 xadvance=12 page=0 +char id=35 x=18 y=3 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=36 x=33 y=1 width=12 height=18 xoffset=0 yoffset=6 xadvance=14 page=0 +char id=37 x=46 y=3 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0 +char id=38 x=63 y=3 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=39 x=78 y=3 width=4 height=6 xoffset=0 yoffset=8 xadvance=6 page=0 +char id=40 x=83 y=1 width=6 height=18 xoffset=0 yoffset=6 xadvance=8 page=0 +char id=41 x=90 y=1 width=6 height=18 xoffset=0 yoffset=6 xadvance=8 page=0 +char id=42 x=97 y=3 width=6 height=8 xoffset=0 yoffset=8 xadvance=8 page=0 +char id=43 x=104 y=5 width=12 height=10 xoffset=0 yoffset=10 xadvance=14 page=0 +char id=44 x=117 y=13 width=4 height=8 xoffset=0 yoffset=18 xadvance=6 page=0 +char id=45 x=122 y=11 width=8 height=2 xoffset=0 yoffset=16 xadvance=10 page=0 +char id=46 x=131 y=13 width=4 height=4 xoffset=0 yoffset=18 xadvance=6 page=0 +char id=47 x=136 y=3 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0 +char id=48 x=153 y=3 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=49 x=166 y=3 width=8 height=14 xoffset=0 yoffset=8 xadvance=10 page=0 +char id=50 x=175 y=3 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=51 x=188 y=3 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=52 x=201 y=3 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=53 x=214 y=3 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=54 x=227 y=3 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=55 x=240 y=3 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=56 x=1 y=22 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=57 x=14 y=22 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=58 x=27 y=24 width=4 height=12 xoffset=0 yoffset=10 xadvance=6 page=0 +char id=59 x=32 y=24 width=4 height=16 xoffset=0 yoffset=10 xadvance=6 page=0 +char id=60 x=37 y=22 width=10 height=14 xoffset=0 yoffset=8 xadvance=12 page=0 +char id=61 x=48 y=26 width=12 height=6 xoffset=0 yoffset=12 xadvance=14 page=0 +char id=62 x=61 y=22 width=10 height=14 xoffset=0 yoffset=8 xadvance=12 page=0 +char id=63 x=72 y=22 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=64 x=85 y=22 width=18 height=18 xoffset=0 yoffset=8 xadvance=20 page=0 +char id=65 x=104 y=22 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=66 x=117 y=22 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=67 x=132 y=22 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=68 x=147 y=22 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=69 x=162 y=22 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=70 x=177 y=22 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=71 x=192 y=22 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=72 x=207 y=22 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0 +char id=73 x=224 y=22 width=8 height=14 xoffset=0 yoffset=8 xadvance=10 page=0 +char id=74 x=233 y=22 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=75 x=1 y=41 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0 +char id=76 x=18 y=41 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=77 x=31 y=41 width=20 height=14 xoffset=0 yoffset=8 xadvance=22 page=0 +char id=78 x=52 y=41 width=18 height=14 xoffset=0 yoffset=8 xadvance=20 page=0 +char id=79 x=71 y=41 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=80 x=86 y=41 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=81 x=101 y=41 width=14 height=18 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=82 x=116 y=41 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0 +char id=83 x=133 y=41 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=84 x=146 y=41 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=85 x=159 y=41 width=18 height=14 xoffset=0 yoffset=8 xadvance=20 page=0 +char id=86 x=178 y=41 width=18 height=14 xoffset=0 yoffset=8 xadvance=20 page=0 +char id=87 x=197 y=41 width=20 height=14 xoffset=0 yoffset=8 xadvance=22 page=0 +char id=88 x=218 y=41 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0 +char id=89 x=235 y=41 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0 +char id=90 x=1 y=60 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0 +char id=91 x=14 y=60 width=6 height=16 xoffset=0 yoffset=8 xadvance=8 page=0 +char id=92 x=21 y=60 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0 +char id=93 x=38 y=60 width=6 height=16 xoffset=0 yoffset=8 xadvance=8 page=0 +char id=94 x=45 y=60 width=14 height=8 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=95 x=60 y=72 width=12 height=2 xoffset=0 yoffset=20 xadvance=14 page=0 +char id=96 x=73 y=60 width=6 height=4 xoffset=0 yoffset=8 xadvance=8 page=0 +char id=97 x=80 y=64 width=14 height=10 xoffset=0 yoffset=12 xadvance=16 page=0 +char id=98 x=95 y=60 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=99 x=110 y=64 width=10 height=10 xoffset=0 yoffset=12 xadvance=12 page=0 +char id=100 x=121 y=60 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=101 x=136 y=64 width=12 height=10 xoffset=0 yoffset=12 xadvance=14 page=0 +char id=102 x=149 y=60 width=10 height=14 xoffset=0 yoffset=8 xadvance=12 page=0 +char id=103 x=160 y=64 width=14 height=14 xoffset=0 yoffset=12 xadvance=16 page=0 +char id=104 x=175 y=60 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=105 x=190 y=60 width=8 height=14 xoffset=0 yoffset=8 xadvance=10 page=0 +char id=106 x=199 y=60 width=6 height=18 xoffset=0 yoffset=8 xadvance=8 page=0 +char id=107 x=206 y=60 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0 +char id=108 x=221 y=60 width=8 height=14 xoffset=0 yoffset=8 xadvance=10 page=0 +char id=109 x=230 y=64 width=18 height=10 xoffset=0 yoffset=12 xadvance=20 page=0 +char id=110 x=1 y=83 width=16 height=10 xoffset=0 yoffset=12 xadvance=18 page=0 +char id=111 x=18 y=83 width=12 height=10 xoffset=0 yoffset=12 xadvance=14 page=0 +char id=112 x=31 y=83 width=14 height=14 xoffset=0 yoffset=12 xadvance=16 page=0 +char id=113 x=46 y=83 width=14 height=14 xoffset=0 yoffset=12 xadvance=16 page=0 +char id=114 x=61 y=83 width=12 height=10 xoffset=0 yoffset=12 xadvance=14 page=0 +char id=115 x=74 y=83 width=10 height=10 xoffset=0 yoffset=12 xadvance=12 page=0 +char id=116 x=85 y=81 width=8 height=12 xoffset=0 yoffset=10 xadvance=10 page=0 +char id=117 x=94 y=83 width=14 height=10 xoffset=0 yoffset=12 xadvance=16 page=0 +char id=118 x=109 y=83 width=14 height=10 xoffset=0 yoffset=12 xadvance=16 page=0 +char id=119 x=124 y=83 width=18 height=10 xoffset=0 yoffset=12 xadvance=20 page=0 +char id=120 x=143 y=83 width=14 height=10 xoffset=0 yoffset=12 xadvance=16 page=0 +char id=121 x=158 y=83 width=14 height=14 xoffset=0 yoffset=12 xadvance=16 page=0 +char id=122 x=173 y=83 width=12 height=10 xoffset=0 yoffset=12 xadvance=14 page=0 +char id=123 x=186 y=79 width=8 height=16 xoffset=0 yoffset=8 xadvance=10 page=0 +char id=124 x=195 y=79 width=4 height=18 xoffset=0 yoffset=8 xadvance=6 page=0 +char id=125 x=200 y=79 width=8 height=16 xoffset=0 yoffset=8 xadvance=10 page=0 +char id=126 x=209 y=83 width=12 height=6 xoffset=0 yoffset=12 xadvance=14 page=0 diff --git a/cardgen/src/commonMain/resources/romulus_medium_24.png b/cardgen/src/commonMain/resources/romulus_medium_24.png new file mode 100644 index 0000000..ad6f1b0 Binary files /dev/null and b/cardgen/src/commonMain/resources/romulus_medium_24.png differ diff --git a/fonts/fontbuilder_tab_font.png b/fonts/fontbuilder_tab_font.png index f31e5b5..ab6a047 100644 Binary files a/fonts/fontbuilder_tab_font.png and b/fonts/fontbuilder_tab_font.png differ diff --git a/fonts/fontbuilder_tab_output.png b/fonts/fontbuilder_tab_output.png index e1a0ff0..135d64b 100644 Binary files a/fonts/fontbuilder_tab_output.png and b/fonts/fontbuilder_tab_output.png differ