Font rendering fixed & added a free font.

This commit is contained in:
Jeasonfire 2015-05-13 21:12:13 +03:00
parent 59207fb8a0
commit 43ca403385
5 changed files with 556 additions and 38 deletions

458
core/assets/fonts/roman.fnt Normal file
View File

@ -0,0 +1,458 @@
info face="Roman SD" size=32 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=4 padding=0,0,0,0 spacing=1,1 outline=0
common lineHeight=32 base=28 scaleW=512 scaleH=256 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0
page id=0 file="roman_0.png"
chars count=218
char id=32 x=502 y=34 width=1 height=1 xoffset=0 yoffset=0 xadvance=20 page=0 chnl=15
char id=33 x=196 y=134 width=5 height=26 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=15
char id=34 x=248 y=233 width=9 height=8 xoffset=0 yoffset=1 xadvance=13 page=0 chnl=15
char id=35 x=429 y=157 width=24 height=25 xoffset=0 yoffset=3 xadvance=27 page=0 chnl=15
char id=36 x=169 y=71 width=16 height=33 xoffset=0 yoffset=0 xadvance=19 page=0 chnl=15
char id=37 x=171 y=162 width=26 height=25 xoffset=0 yoffset=3 xadvance=30 page=0 chnl=15
char id=38 x=313 y=103 width=33 height=27 xoffset=0 yoffset=3 xadvance=36 page=0 chnl=15
char id=39 x=507 y=130 width=4 height=8 xoffset=0 yoffset=1 xadvance=7 page=0 chnl=15
char id=40 x=221 y=104 width=7 height=28 xoffset=0 yoffset=0 xadvance=10 page=0 chnl=15
char id=41 x=229 y=104 width=7 height=28 xoffset=0 yoffset=3 xadvance=10 page=0 chnl=15
char id=42 x=498 y=208 width=12 height=12 xoffset=0 yoffset=1 xadvance=15 page=0 chnl=15
char id=43 x=414 y=209 width=19 height=15 xoffset=0 yoffset=10 xadvance=23 page=0 chnl=15
char id=44 x=177 y=236 width=7 height=9 xoffset=0 yoffset=23 xadvance=10 page=0 chnl=15
char id=45 x=463 y=225 width=14 height=4 xoffset=0 yoffset=15 xadvance=17 page=0 chnl=15
char id=46 x=357 y=227 width=7 height=5 xoffset=0 yoffset=23 xadvance=10 page=0 chnl=15
char id=47 x=32 y=218 width=13 height=25 xoffset=0 yoffset=3 xadvance=16 page=0 chnl=15
char id=48 x=366 y=183 width=18 height=25 xoffset=0 yoffset=3 xadvance=22 page=0 chnl=15
char id=49 x=180 y=135 width=9 height=26 xoffset=0 yoffset=2 xadvance=13 page=0 chnl=15
char id=50 x=346 y=183 width=19 height=25 xoffset=0 yoffset=3 xadvance=23 page=0 chnl=15
char id=51 x=164 y=135 width=15 height=26 xoffset=0 yoffset=2 xadvance=19 page=0 chnl=15
char id=52 x=415 y=103 width=23 height=27 xoffset=0 yoffset=2 xadvance=26 page=0 chnl=15
char id=53 x=113 y=137 width=18 height=26 xoffset=0 yoffset=2 xadvance=22 page=0 chnl=15
char id=54 x=385 y=183 width=18 height=25 xoffset=0 yoffset=3 xadvance=22 page=0 chnl=15
char id=55 x=324 y=183 width=21 height=25 xoffset=0 yoffset=3 xadvance=24 page=0 chnl=15
char id=56 x=404 y=183 width=17 height=25 xoffset=0 yoffset=3 xadvance=21 page=0 chnl=15
char id=57 x=94 y=137 width=18 height=26 xoffset=0 yoffset=3 xadvance=21 page=0 chnl=15
char id=58 x=375 y=209 width=7 height=16 xoffset=0 yoffset=13 xadvance=10 page=0 chnl=15
char id=59 x=252 y=212 width=7 height=19 xoffset=0 yoffset=13 xadvance=10 page=0 chnl=15
char id=60 x=224 y=213 width=13 height=20 xoffset=0 yoffset=7 xadvance=17 page=0 chnl=15
char id=61 x=127 y=237 width=14 height=9 xoffset=0 yoffset=13 xadvance=17 page=0 chnl=15
char id=62 x=194 y=214 width=14 height=20 xoffset=0 yoffset=7 xadvance=17 page=0 chnl=15
char id=63 x=456 y=183 width=16 height=25 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=15
char id=64 x=302 y=157 width=25 height=25 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=15
char id=65 x=115 y=164 width=27 height=25 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=15
char id=66 x=214 y=187 width=21 height=25 xoffset=0 yoffset=3 xadvance=24 page=0 chnl=15
char id=67 x=96 y=190 width=23 height=25 xoffset=0 yoffset=3 xadvance=25 page=0 chnl=15
char id=68 x=354 y=157 width=24 height=25 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=15
char id=69 x=54 y=137 width=19 height=26 xoffset=0 yoffset=4 xadvance=21 page=0 chnl=15
char id=70 x=148 y=136 width=15 height=26 xoffset=0 yoffset=3 xadvance=19 page=0 chnl=15
char id=71 x=67 y=217 width=24 height=24 xoffset=0 yoffset=4 xadvance=27 page=0 chnl=15
char id=72 x=24 y=192 width=23 height=25 xoffset=0 yoffset=3 xadvance=27 page=0 chnl=15
char id=73 x=503 y=156 width=6 height=25 xoffset=0 yoffset=3 xadvance=11 page=0 chnl=15
char id=74 x=502 y=102 width=9 height=27 xoffset=-1 yoffset=3 xadvance=12 page=0 chnl=15
char id=75 x=144 y=189 width=23 height=25 xoffset=0 yoffset=3 xadvance=26 page=0 chnl=15
char id=76 x=460 y=103 width=15 height=27 xoffset=0 yoffset=3 xadvance=18 page=0 chnl=15
char id=77 x=383 y=131 width=31 height=25 xoffset=0 yoffset=3 xadvance=35 page=0 chnl=15
char id=78 x=0 y=166 width=29 height=25 xoffset=0 yoffset=3 xadvance=33 page=0 chnl=15
char id=79 x=0 y=139 width=26 height=26 xoffset=0 yoffset=3 xadvance=31 page=0 chnl=15
char id=80 x=473 y=183 width=16 height=25 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=15
char id=81 x=153 y=106 width=33 height=28 xoffset=0 yoffset=3 xadvance=31 page=0 chnl=15
char id=82 x=236 y=186 width=21 height=25 xoffset=0 yoffset=4 xadvance=24 page=0 chnl=15
char id=83 x=490 y=182 width=16 height=25 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=15
char id=84 x=191 y=188 width=22 height=25 xoffset=0 yoffset=3 xadvance=23 page=0 chnl=15
char id=85 x=404 y=157 width=24 height=25 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=15
char id=86 x=224 y=160 width=25 height=25 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=15
char id=87 x=242 y=132 width=37 height=25 xoffset=0 yoffset=3 xadvance=41 page=0 chnl=15
char id=88 x=198 y=161 width=25 height=25 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=15
char id=89 x=0 y=192 width=23 height=25 xoffset=0 yoffset=3 xadvance=25 page=0 chnl=15
char id=90 x=31 y=107 width=22 height=30 xoffset=0 yoffset=1 xadvance=27 page=0 chnl=15
char id=91 x=474 y=70 width=11 height=31 xoffset=0 yoffset=0 xadvance=15 page=0 chnl=15
char id=92 x=46 y=218 width=13 height=25 xoffset=0 yoffset=3 xadvance=16 page=0 chnl=15
char id=93 x=486 y=70 width=11 height=31 xoffset=0 yoffset=0 xadvance=15 page=0 chnl=15
char id=94 x=207 y=235 width=14 height=8 xoffset=0 yoffset=0 xadvance=17 page=0 chnl=15
char id=95 x=373 y=227 width=34 height=4 xoffset=0 yoffset=28 xadvance=37 page=0 chnl=15
char id=96 x=341 y=228 width=7 height=5 xoffset=0 yoffset=3 xadvance=11 page=0 chnl=15
char id=97 x=143 y=163 width=27 height=25 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=15
char id=98 x=258 y=184 width=21 height=25 xoffset=0 yoffset=3 xadvance=24 page=0 chnl=15
char id=99 x=72 y=190 width=23 height=25 xoffset=0 yoffset=3 xadvance=25 page=0 chnl=15
char id=100 x=454 y=157 width=24 height=25 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=15
char id=101 x=74 y=137 width=19 height=26 xoffset=0 yoffset=4 xadvance=21 page=0 chnl=15
char id=102 x=132 y=136 width=15 height=26 xoffset=0 yoffset=3 xadvance=19 page=0 chnl=15
char id=103 x=92 y=216 width=24 height=24 xoffset=0 yoffset=4 xadvance=27 page=0 chnl=15
char id=104 x=48 y=191 width=23 height=25 xoffset=0 yoffset=3 xadvance=27 page=0 chnl=15
char id=105 x=60 y=217 width=6 height=25 xoffset=0 yoffset=3 xadvance=11 page=0 chnl=15
char id=106 x=492 y=102 width=9 height=27 xoffset=-1 yoffset=3 xadvance=12 page=0 chnl=15
char id=107 x=120 y=190 width=23 height=25 xoffset=0 yoffset=3 xadvance=26 page=0 chnl=15
char id=108 x=476 y=102 width=15 height=27 xoffset=0 yoffset=3 xadvance=18 page=0 chnl=15
char id=109 x=351 y=131 width=31 height=25 xoffset=0 yoffset=3 xadvance=35 page=0 chnl=15
char id=110 x=477 y=130 width=29 height=25 xoffset=0 yoffset=3 xadvance=33 page=0 chnl=15
char id=111 x=27 y=138 width=26 height=26 xoffset=0 yoffset=3 xadvance=31 page=0 chnl=15
char id=112 x=0 y=218 width=16 height=25 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=15
char id=113 x=187 y=105 width=33 height=28 xoffset=0 yoffset=3 xadvance=31 page=0 chnl=15
char id=114 x=302 y=183 width=21 height=25 xoffset=0 yoffset=4 xadvance=24 page=0 chnl=15
char id=115 x=422 y=183 width=16 height=25 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=15
char id=116 x=168 y=189 width=22 height=25 xoffset=0 yoffset=3 xadvance=23 page=0 chnl=15
char id=117 x=379 y=157 width=24 height=25 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=15
char id=118 x=250 y=158 width=25 height=25 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=15
char id=119 x=280 y=131 width=37 height=25 xoffset=0 yoffset=3 xadvance=41 page=0 chnl=15
char id=120 x=276 y=158 width=25 height=25 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=15
char id=121 x=479 y=156 width=23 height=25 xoffset=0 yoffset=3 xadvance=25 page=0 chnl=15
char id=122 x=8 y=107 width=22 height=30 xoffset=0 yoffset=1 xadvance=27 page=0 chnl=15
char id=123 x=498 y=70 width=7 height=31 xoffset=0 yoffset=0 xadvance=10 page=0 chnl=15
char id=124 x=506 y=70 width=3 height=29 xoffset=0 yoffset=1 xadvance=7 page=0 chnl=15
char id=125 x=0 y=107 width=7 height=31 xoffset=0 yoffset=0 xadvance=10 page=0 chnl=15
char id=126 x=448 y=225 width=14 height=4 xoffset=0 yoffset=2 xadvance=17 page=0 chnl=15
char id=160 x=509 y=34 width=1 height=1 xoffset=0 yoffset=0 xadvance=20 page=0 chnl=15
char id=161 x=190 y=134 width=5 height=26 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=15
char id=162 x=445 y=70 width=23 height=32 xoffset=0 yoffset=0 xadvance=26 page=0 chnl=15
char id=163 x=439 y=103 width=20 height=27 xoffset=0 yoffset=3 xadvance=23 page=0 chnl=15
char id=164 x=434 y=209 width=15 height=15 xoffset=0 yoffset=9 xadvance=19 page=0 chnl=15
char id=165 x=280 y=184 width=21 height=25 xoffset=0 yoffset=3 xadvance=25 page=0 chnl=15
char id=166 x=469 y=70 width=4 height=32 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15
char id=167 x=17 y=218 width=14 height=25 xoffset=0 yoffset=3 xadvance=17 page=0 chnl=15
char id=168 x=326 y=228 width=14 height=5 xoffset=0 yoffset=3 xadvance=18 page=0 chnl=15
char id=169 x=450 y=209 width=15 height=15 xoffset=0 yoffset=3 xadvance=18 page=0 chnl=15
char id=170 x=260 y=210 width=23 height=18 xoffset=0 yoffset=0 xadvance=26 page=0 chnl=15
char id=171 x=117 y=216 width=27 height=20 xoffset=0 yoffset=7 xadvance=30 page=0 chnl=15
char id=172 x=92 y=241 width=34 height=14 xoffset=0 yoffset=15 xadvance=38 page=0 chnl=15
char id=173 x=493 y=225 width=14 height=4 xoffset=0 yoffset=15 xadvance=17 page=0 chnl=15
char id=174 x=482 y=209 width=15 height=15 xoffset=0 yoffset=3 xadvance=19 page=0 chnl=15
char id=175 x=433 y=225 width=14 height=4 xoffset=0 yoffset=2 xadvance=17 page=0 chnl=15
char id=176 x=466 y=209 width=15 height=15 xoffset=0 yoffset=3 xadvance=19 page=0 chnl=15
char id=177 x=173 y=215 width=20 height=20 xoffset=0 yoffset=6 xadvance=23 page=0 chnl=15
char id=178 x=301 y=210 width=14 height=18 xoffset=0 yoffset=0 xadvance=17 page=0 chnl=15
char id=179 x=331 y=209 width=11 height=18 xoffset=0 yoffset=0 xadvance=14 page=0 chnl=15
char id=180 x=349 y=228 width=7 height=5 xoffset=0 yoffset=3 xadvance=11 page=0 chnl=15
char id=181 x=104 y=107 width=24 height=29 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=15
char id=182 x=129 y=106 width=23 height=29 xoffset=0 yoffset=3 xadvance=27 page=0 chnl=15
char id=183 x=365 y=227 width=7 height=5 xoffset=0 yoffset=10 xadvance=10 page=0 chnl=15
char id=184 x=185 y=236 width=7 height=9 xoffset=0 yoffset=27 xadvance=10 page=0 chnl=15
char id=185 x=343 y=209 width=6 height=18 xoffset=0 yoffset=0 xadvance=9 page=0 chnl=15
char id=186 x=316 y=209 width=14 height=18 xoffset=0 yoffset=0 xadvance=17 page=0 chnl=15
char id=187 x=145 y=215 width=27 height=20 xoffset=0 yoffset=7 xadvance=31 page=0 chnl=15
char id=188 x=446 y=131 width=30 height=25 xoffset=0 yoffset=3 xadvance=33 page=0 chnl=15
char id=189 x=30 y=165 width=28 height=25 xoffset=0 yoffset=3 xadvance=31 page=0 chnl=15
char id=190 x=318 y=131 width=32 height=25 xoffset=0 yoffset=3 xadvance=35 page=0 chnl=15
char id=191 x=439 y=183 width=16 height=25 xoffset=0 yoffset=3 xadvance=20 page=0 chnl=15
char id=192 x=112 y=38 width=27 height=33 xoffset=0 yoffset=-4 xadvance=30 page=0 chnl=15
char id=193 x=84 y=39 width=27 height=33 xoffset=0 yoffset=-4 xadvance=30 page=0 chnl=15
char id=194 x=176 y=0 width=27 height=35 xoffset=0 yoffset=-6 xadvance=30 page=0 chnl=15
char id=195 x=335 y=70 width=27 height=32 xoffset=0 yoffset=-3 xadvance=30 page=0 chnl=15
char id=196 x=140 y=38 width=27 height=33 xoffset=0 yoffset=-4 xadvance=30 page=0 chnl=15
char id=197 x=28 y=0 width=27 height=38 xoffset=0 yoffset=-9 xadvance=30 page=0 chnl=15
char id=198 x=275 y=103 width=37 height=27 xoffset=0 yoffset=3 xadvance=40 page=0 chnl=15
char id=199 x=73 y=73 width=23 height=33 xoffset=0 yoffset=3 xadvance=26 page=0 chnl=15
char id=200 x=436 y=0 width=19 height=35 xoffset=0 yoffset=-4 xadvance=22 page=0 chnl=15
char id=201 x=336 y=0 width=19 height=35 xoffset=0 yoffset=-4 xadvance=22 page=0 chnl=15
char id=202 x=122 y=0 width=19 height=37 xoffset=0 yoffset=-6 xadvance=22 page=0 chnl=15
char id=203 x=416 y=0 width=19 height=35 xoffset=0 yoffset=-4 xadvance=22 page=0 chnl=15
char id=204 x=267 y=70 width=7 height=33 xoffset=0 yoffset=-4 xadvance=11 page=0 chnl=15
char id=205 x=250 y=70 width=8 height=33 xoffset=0 yoffset=-4 xadvance=11 page=0 chnl=15
char id=206 x=487 y=0 width=14 height=35 xoffset=0 yoffset=-6 xadvance=17 page=0 chnl=15
char id=207 x=235 y=70 width=14 height=33 xoffset=0 yoffset=-4 xadvance=18 page=0 chnl=15
char id=208 x=59 y=164 width=27 height=25 xoffset=0 yoffset=3 xadvance=31 page=0 chnl=15
char id=209 x=275 y=70 width=29 height=32 xoffset=0 yoffset=-3 xadvance=32 page=0 chnl=15
char id=210 x=249 y=36 width=26 height=33 xoffset=0 yoffset=-4 xadvance=30 page=0 chnl=15
char id=211 x=195 y=36 width=26 height=33 xoffset=0 yoffset=-4 xadvance=30 page=0 chnl=15
char id=212 x=259 y=0 width=26 height=35 xoffset=0 yoffset=-6 xadvance=30 page=0 chnl=15
char id=213 x=418 y=70 width=26 height=32 xoffset=0 yoffset=-3 xadvance=30 page=0 chnl=15
char id=214 x=222 y=36 width=26 height=33 xoffset=0 yoffset=-4 xadvance=30 page=0 chnl=15
char id=215 x=284 y=210 width=16 height=18 xoffset=0 yoffset=7 xadvance=19 page=0 chnl=15
char id=216 x=357 y=36 width=26 height=33 xoffset=0 yoffset=0 xadvance=30 page=0 chnl=15
char id=217 x=434 y=36 width=24 height=33 xoffset=0 yoffset=-4 xadvance=28 page=0 chnl=15
char id=218 x=459 y=36 width=24 height=33 xoffset=0 yoffset=-4 xadvance=28 page=0 chnl=15
char id=219 x=311 y=0 width=24 height=35 xoffset=0 yoffset=-6 xadvance=28 page=0 chnl=15
char id=220 x=484 y=36 width=24 height=33 xoffset=0 yoffset=-4 xadvance=28 page=0 chnl=15
char id=221 x=121 y=72 width=23 height=33 xoffset=0 yoffset=-4 xadvance=26 page=0 chnl=15
char id=222 x=203 y=70 width=16 height=33 xoffset=0 yoffset=0 xadvance=20 page=0 chnl=15
char id=223 x=328 y=157 width=25 height=25 xoffset=0 yoffset=3 xadvance=28 page=0 chnl=15
char id=224 x=56 y=39 width=27 height=33 xoffset=0 yoffset=-4 xadvance=30 page=0 chnl=15
char id=225 x=28 y=39 width=27 height=33 xoffset=0 yoffset=-4 xadvance=30 page=0 chnl=15
char id=226 x=204 y=0 width=27 height=35 xoffset=0 yoffset=-6 xadvance=30 page=0 chnl=15
char id=227 x=363 y=70 width=27 height=32 xoffset=0 yoffset=-3 xadvance=30 page=0 chnl=15
char id=228 x=0 y=39 width=27 height=33 xoffset=0 yoffset=-4 xadvance=30 page=0 chnl=15
char id=229 x=0 y=0 width=27 height=38 xoffset=0 yoffset=-9 xadvance=30 page=0 chnl=15
char id=230 x=237 y=104 width=37 height=27 xoffset=0 yoffset=3 xadvance=40 page=0 chnl=15
char id=231 x=97 y=73 width=23 height=33 xoffset=0 yoffset=3 xadvance=26 page=0 chnl=15
char id=232 x=356 y=0 width=19 height=35 xoffset=0 yoffset=-4 xadvance=22 page=0 chnl=15
char id=233 x=376 y=0 width=19 height=35 xoffset=0 yoffset=-4 xadvance=22 page=0 chnl=15
char id=234 x=102 y=0 width=19 height=37 xoffset=0 yoffset=-6 xadvance=22 page=0 chnl=15
char id=235 x=396 y=0 width=19 height=35 xoffset=0 yoffset=-4 xadvance=22 page=0 chnl=15
char id=236 x=259 y=70 width=7 height=33 xoffset=0 yoffset=-4 xadvance=11 page=0 chnl=15
char id=237 x=502 y=0 width=8 height=33 xoffset=0 yoffset=-4 xadvance=11 page=0 chnl=15
char id=238 x=472 y=0 width=14 height=35 xoffset=0 yoffset=-6 xadvance=17 page=0 chnl=15
char id=239 x=220 y=70 width=14 height=33 xoffset=0 yoffset=-4 xadvance=18 page=0 chnl=15
char id=240 x=87 y=164 width=27 height=25 xoffset=0 yoffset=3 xadvance=31 page=0 chnl=15
char id=241 x=305 y=70 width=29 height=32 xoffset=0 yoffset=-3 xadvance=32 page=0 chnl=15
char id=242 x=330 y=36 width=26 height=33 xoffset=0 yoffset=-4 xadvance=30 page=0 chnl=15
char id=243 x=303 y=36 width=26 height=33 xoffset=0 yoffset=-4 xadvance=30 page=0 chnl=15
char id=244 x=232 y=0 width=26 height=35 xoffset=0 yoffset=-6 xadvance=30 page=0 chnl=15
char id=245 x=391 y=70 width=26 height=32 xoffset=0 yoffset=-3 xadvance=30 page=0 chnl=15
char id=246 x=276 y=36 width=26 height=33 xoffset=0 yoffset=-4 xadvance=30 page=0 chnl=15
char id=247 x=350 y=209 width=24 height=17 xoffset=0 yoffset=9 xadvance=27 page=0 chnl=15
char id=248 x=168 y=37 width=26 height=33 xoffset=0 yoffset=0 xadvance=30 page=0 chnl=15
char id=249 x=0 y=73 width=24 height=33 xoffset=0 yoffset=-4 xadvance=28 page=0 chnl=15
char id=250 x=384 y=36 width=24 height=33 xoffset=0 yoffset=-4 xadvance=28 page=0 chnl=15
char id=251 x=286 y=0 width=24 height=35 xoffset=0 yoffset=-6 xadvance=28 page=0 chnl=15
char id=252 x=409 y=36 width=24 height=33 xoffset=0 yoffset=-4 xadvance=28 page=0 chnl=15
char id=253 x=25 y=73 width=23 height=33 xoffset=0 yoffset=-4 xadvance=26 page=0 chnl=15
char id=254 x=186 y=71 width=16 height=33 xoffset=0 yoffset=0 xadvance=20 page=0 chnl=15
char id=255 x=49 y=73 width=23 height=33 xoffset=0 yoffset=-4 xadvance=26 page=0 chnl=15
char id=338 x=347 y=103 width=33 height=27 xoffset=0 yoffset=3 xadvance=37 page=0 chnl=15
char id=339 x=381 y=103 width=33 height=27 xoffset=0 yoffset=3 xadvance=37 page=0 chnl=15
char id=352 x=159 y=0 width=16 height=36 xoffset=0 yoffset=-7 xadvance=19 page=0 chnl=15
char id=353 x=142 y=0 width=16 height=36 xoffset=0 yoffset=-7 xadvance=19 page=0 chnl=15
char id=376 x=145 y=72 width=23 height=33 xoffset=0 yoffset=-4 xadvance=26 page=0 chnl=15
char id=381 x=79 y=0 width=22 height=38 xoffset=0 yoffset=-7 xadvance=26 page=0 chnl=15
char id=382 x=56 y=0 width=22 height=38 xoffset=0 yoffset=-7 xadvance=26 page=0 chnl=15
char id=402 x=456 y=0 width=15 height=35 xoffset=0 yoffset=3 xadvance=19 page=0 chnl=15
char id=710 x=222 y=235 width=14 height=8 xoffset=0 yoffset=0 xadvance=17 page=0 chnl=15
char id=732 x=478 y=225 width=14 height=4 xoffset=0 yoffset=3 xadvance=17 page=0 chnl=15
char id=8211 x=408 y=225 width=24 height=4 xoffset=0 yoffset=15 xadvance=27 page=0 chnl=15
char id=8212 x=265 y=229 width=34 height=5 xoffset=0 yoffset=15 xadvance=37 page=0 chnl=15
char id=8216 x=200 y=235 width=6 height=9 xoffset=0 yoffset=0 xadvance=9 page=0 chnl=15
char id=8217 x=258 y=232 width=6 height=8 xoffset=0 yoffset=0 xadvance=9 page=0 chnl=15
char id=8218 x=193 y=236 width=6 height=9 xoffset=0 yoffset=23 xadvance=9 page=0 chnl=15
char id=8220 x=155 y=236 width=10 height=9 xoffset=0 yoffset=0 xadvance=14 page=0 chnl=15
char id=8221 x=166 y=236 width=10 height=9 xoffset=0 yoffset=0 xadvance=14 page=0 chnl=15
char id=8222 x=142 y=237 width=12 height=9 xoffset=0 yoffset=23 xadvance=16 page=0 chnl=15
char id=8224 x=79 y=107 width=24 height=29 xoffset=0 yoffset=0 xadvance=27 page=0 chnl=15
char id=8225 x=54 y=107 width=24 height=29 xoffset=0 yoffset=0 xadvance=27 page=0 chnl=15
char id=8226 x=237 y=234 width=10 height=8 xoffset=0 yoffset=10 xadvance=13 page=0 chnl=15
char id=8230 x=300 y=229 width=25 height=5 xoffset=0 yoffset=23 xadvance=28 page=0 chnl=15
char id=8240 x=202 y=134 width=39 height=25 xoffset=0 yoffset=3 xadvance=42 page=0 chnl=15
char id=8249 x=238 y=212 width=13 height=20 xoffset=0 yoffset=7 xadvance=17 page=0 chnl=15
char id=8250 x=209 y=214 width=14 height=20 xoffset=0 yoffset=7 xadvance=17 page=0 chnl=15
char id=8364 x=415 y=131 width=30 height=25 xoffset=0 yoffset=3 xadvance=33 page=0 chnl=15
char id=8482 x=383 y=209 width=30 height=15 xoffset=0 yoffset=3 xadvance=33 page=0 chnl=15
kernings count=235
kerning first=32 second=107 amount=-1
kerning first=34 second=65 amount=-3
kerning first=34 second=97 amount=-3
kerning first=39 second=65 amount=-3
kerning first=39 second=97 amount=-3
kerning first=65 second=58 amount=1
kerning first=65 second=59 amount=1
kerning first=65 second=67 amount=-2
kerning first=65 second=79 amount=-1
kerning first=65 second=81 amount=-1
kerning first=65 second=86 amount=-7
kerning first=65 second=87 amount=-7
kerning first=65 second=89 amount=-5
kerning first=65 second=99 amount=-1
kerning first=65 second=111 amount=-1
kerning first=65 second=113 amount=-1
kerning first=65 second=118 amount=-7
kerning first=65 second=119 amount=-7
kerning first=65 second=121 amount=-5
kerning first=66 second=89 amount=-1
kerning first=66 second=121 amount=-1
kerning first=68 second=65 amount=-1
kerning first=68 second=84 amount=-3
kerning first=68 second=86 amount=-3
kerning first=68 second=87 amount=-1
kerning first=68 second=88 amount=-1
kerning first=68 second=89 amount=-1
kerning first=68 second=97 amount=-1
kerning first=68 second=116 amount=-3
kerning first=68 second=118 amount=-3
kerning first=68 second=119 amount=-1
kerning first=68 second=120 amount=-1
kerning first=68 second=121 amount=-1
kerning first=69 second=86 amount=-1
kerning first=69 second=87 amount=-1
kerning first=69 second=118 amount=-1
kerning first=69 second=119 amount=-1
kerning first=70 second=65 amount=-1
kerning first=70 second=97 amount=-1
kerning first=72 second=65 amount=-1
kerning first=72 second=97 amount=-1
kerning first=73 second=65 amount=-1
kerning first=73 second=84 amount=-1
kerning first=73 second=86 amount=-1
kerning first=73 second=97 amount=-1
kerning first=73 second=116 amount=-1
kerning first=74 second=65 amount=-1
kerning first=74 second=97 amount=-1
kerning first=75 second=65 amount=-1
kerning first=75 second=86 amount=-1
kerning first=75 second=97 amount=-1
kerning first=75 second=118 amount=-1
kerning first=77 second=65 amount=-1
kerning first=77 second=86 amount=-1
kerning first=77 second=87 amount=-1
kerning first=77 second=89 amount=-1
kerning first=77 second=97 amount=-1
kerning first=77 second=118 amount=-1
kerning first=77 second=119 amount=-1
kerning first=78 second=65 amount=-1
kerning first=78 second=86 amount=-1
kerning first=78 second=87 amount=-1
kerning first=78 second=97 amount=-1
kerning first=78 second=118 amount=-1
kerning first=78 second=119 amount=-1
kerning first=79 second=65 amount=-3
kerning first=79 second=86 amount=-1
kerning first=79 second=87 amount=-1
kerning first=79 second=88 amount=-3
kerning first=79 second=97 amount=-3
kerning first=79 second=118 amount=-1
kerning first=79 second=119 amount=-1
kerning first=80 second=65 amount=-3
kerning first=80 second=97 amount=-3
kerning first=8220 second=97 amount=-3
kerning first=82 second=67 amount=-1
kerning first=8220 second=65 amount=-3
kerning first=82 second=71 amount=-1
kerning first=82 second=79 amount=-1
kerning first=82 second=81 amount=-1
kerning first=82 second=84 amount=-1
kerning first=82 second=86 amount=-3
kerning first=82 second=87 amount=-1
kerning first=82 second=99 amount=-1
kerning first=82 second=103 amount=-1
kerning first=82 second=111 amount=-1
kerning first=82 second=113 amount=-1
kerning first=82 second=116 amount=-1
kerning first=82 second=118 amount=-3
kerning first=82 second=119 amount=-1
kerning first=82 second=121 amount=-3
kerning first=8216 second=97 amount=-3
kerning first=8216 second=65 amount=-3
kerning first=84 second=44 amount=-3
kerning first=84 second=46 amount=-3
kerning first=84 second=65 amount=-5
kerning first=84 second=67 amount=-1
kerning first=84 second=71 amount=-1
kerning first=84 second=79 amount=-1
kerning first=84 second=81 amount=-1
kerning first=84 second=97 amount=-5
kerning first=84 second=99 amount=-1
kerning first=84 second=103 amount=-1
kerning first=84 second=111 amount=-1
kerning first=84 second=113 amount=-1
kerning first=85 second=65 amount=-1
kerning first=122 second=113 amount=-1
kerning first=122 second=111 amount=-1
kerning first=85 second=97 amount=-1
kerning first=122 second=103 amount=-1
kerning first=122 second=99 amount=-1
kerning first=86 second=44 amount=-3
kerning first=86 second=46 amount=-3
kerning first=86 second=65 amount=-5
kerning first=86 second=67 amount=-1
kerning first=86 second=71 amount=-1
kerning first=86 second=79 amount=-1
kerning first=86 second=81 amount=-1
kerning first=86 second=97 amount=-5
kerning first=86 second=99 amount=-1
kerning first=86 second=103 amount=-1
kerning first=86 second=111 amount=-1
kerning first=86 second=113 amount=-1
kerning first=87 second=44 amount=-3
kerning first=87 second=46 amount=-3
kerning first=87 second=65 amount=-3
kerning first=87 second=97 amount=-3
kerning first=88 second=65 amount=-1
kerning first=88 second=67 amount=-1
kerning first=88 second=71 amount=-1
kerning first=88 second=79 amount=-1
kerning first=88 second=81 amount=-1
kerning first=88 second=86 amount=-1
kerning first=88 second=87 amount=-1
kerning first=88 second=89 amount=-1
kerning first=88 second=97 amount=-1
kerning first=88 second=99 amount=-1
kerning first=88 second=103 amount=-1
kerning first=88 second=111 amount=-1
kerning first=88 second=113 amount=-1
kerning first=88 second=118 amount=-1
kerning first=88 second=119 amount=-1
kerning first=88 second=121 amount=-1
kerning first=89 second=65 amount=-3
kerning first=89 second=67 amount=-1
kerning first=89 second=71 amount=-1
kerning first=89 second=79 amount=-1
kerning first=89 second=81 amount=-1
kerning first=89 second=97 amount=-3
kerning first=89 second=99 amount=-1
kerning first=89 second=103 amount=-1
kerning first=89 second=111 amount=-1
kerning first=89 second=113 amount=-1
kerning first=90 second=65 amount=-1
kerning first=90 second=67 amount=-1
kerning first=90 second=71 amount=-1
kerning first=90 second=79 amount=-1
kerning first=90 second=81 amount=-1
kerning first=90 second=97 amount=-1
kerning first=90 second=99 amount=-1
kerning first=90 second=103 amount=-1
kerning first=90 second=111 amount=-1
kerning first=90 second=113 amount=-1
kerning first=97 second=58 amount=1
kerning first=97 second=59 amount=1
kerning first=97 second=99 amount=-1
kerning first=97 second=111 amount=-1
kerning first=97 second=113 amount=-1
kerning first=97 second=118 amount=-7
kerning first=97 second=119 amount=-7
kerning first=97 second=121 amount=-5
kerning first=98 second=121 amount=-1
kerning first=100 second=97 amount=-1
kerning first=100 second=116 amount=-3
kerning first=100 second=118 amount=-3
kerning first=100 second=119 amount=-1
kerning first=100 second=120 amount=-1
kerning first=100 second=121 amount=-1
kerning first=101 second=118 amount=-1
kerning first=101 second=119 amount=-1
kerning first=102 second=97 amount=-1
kerning first=104 second=97 amount=-1
kerning first=105 second=97 amount=-1
kerning first=105 second=116 amount=-1
kerning first=105 second=118 amount=-1
kerning first=106 second=97 amount=-1
kerning first=107 second=118 amount=-1
kerning first=109 second=97 amount=-1
kerning first=109 second=118 amount=-1
kerning first=109 second=119 amount=-1
kerning first=109 second=121 amount=-1
kerning first=110 second=97 amount=-1
kerning first=110 second=118 amount=-1
kerning first=110 second=119 amount=-1
kerning first=111 second=97 amount=-3
kerning first=111 second=118 amount=-1
kerning first=111 second=119 amount=-1
kerning first=111 second=120 amount=-3
kerning first=112 second=97 amount=-3
kerning first=122 second=97 amount=-1
kerning first=114 second=99 amount=-1
kerning first=121 second=113 amount=-1
kerning first=114 second=103 amount=-1
kerning first=114 second=111 amount=-1
kerning first=114 second=113 amount=-1
kerning first=114 second=116 amount=-1
kerning first=114 second=118 amount=-3
kerning first=121 second=111 amount=-1
kerning first=116 second=44 amount=-34
kerning first=116 second=46 amount=-3
kerning first=116 second=97 amount=-5
kerning first=116 second=99 amount=-1
kerning first=116 second=103 amount=-1
kerning first=116 second=111 amount=-1
kerning first=116 second=113 amount=-1
kerning first=117 second=97 amount=-1
kerning first=121 second=103 amount=-1
kerning first=121 second=99 amount=-1
kerning first=118 second=44 amount=-3
kerning first=118 second=46 amount=-3
kerning first=118 second=97 amount=-5
kerning first=118 second=99 amount=-1
kerning first=118 second=111 amount=-1
kerning first=118 second=113 amount=-1
kerning first=119 second=44 amount=-3
kerning first=119 second=46 amount=-3
kerning first=119 second=97 amount=-3
kerning first=120 second=97 amount=-1
kerning first=120 second=99 amount=-1
kerning first=120 second=111 amount=-1
kerning first=120 second=113 amount=-1
kerning first=120 second=118 amount=-1
kerning first=120 second=119 amount=-1
kerning first=120 second=121 amount=-1
kerning first=121 second=97 amount=-3

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

View File

@ -5,8 +5,6 @@ import com.badlogic.ashley.core.Entity;
import com.badlogic.ashley.core.EntityListener; import com.badlogic.ashley.core.EntityListener;
import com.badlogic.gdx.ApplicationAdapter; import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.Input.Buttons;
import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.math.Vector2;
import com.saltosion.gladiator.components.CAI; import com.saltosion.gladiator.components.CAI;
@ -42,7 +40,7 @@ public class GladiatorBrawler extends ApplicationAdapter {
@Override @Override
public void create() { public void create() {
Log.info("Starting up the game"); Log.info("Starting up the game");
// Initialize the Engine // Initialize the Engine
engine = new Engine(); engine = new Engine();
AppUtil.engine = engine; AppUtil.engine = engine;
@ -95,13 +93,13 @@ public class GladiatorBrawler extends ApplicationAdapter {
// Initialize input // Initialize input
inputHandler = new InputHandler(); inputHandler = new InputHandler();
Gdx.input.setInputProcessor(inputHandler); Gdx.input.setInputProcessor(inputHandler);
Log.info("Successfully started the game."); Log.info("Successfully started the game.");
} }
@Override @Override
public void render() { public void render() {
engine.update(Gdx.graphics.getDeltaTime()); engine.update(Gdx.graphics.getDeltaTime());
} }
public void initializePlayer() { public void initializePlayer() {
@ -193,13 +191,13 @@ public class GladiatorBrawler extends ApplicationAdapter {
@Override @Override
public void pressed(int x, int y, int mouseButton) { public void pressed(int x, int y, int mouseButton) {
Log.info("I should never be pressed against my will!"); Log.info("I should never be pressed against my will!");
} }
@Override @Override
public void released(int x, int y, int mouseButton) { public void released(int x, int y, int mouseButton) {
Log.info("And now I was even released! Blasphemy!"); Log.info("And now I was even released! Blasphemy!");
} }
}; };
button.setPosition(0.12f, 0.5f); button.setPosition(0.12f, 0.5f);
@ -213,7 +211,7 @@ public class GladiatorBrawler extends ApplicationAdapter {
RenderingSystem.screenWidth = width; RenderingSystem.screenWidth = width;
RenderingSystem rs = engine.getSystem(RenderingSystem.class); RenderingSystem rs = engine.getSystem(RenderingSystem.class);
float aspectratio = ((float) width) / ((float) height); float aspectratio = ((float) width) / ((float) height);
rs.aspectratio = aspectratio; RenderingSystem.aspectratio = aspectratio;
rs.setViewport((int) (AppUtil.VPHEIGHT_CONST * aspectratio), AppUtil.VPHEIGHT_CONST); rs.setViewport((int) (AppUtil.VPHEIGHT_CONST * aspectratio), AppUtil.VPHEIGHT_CONST);
} }
} }

View File

@ -7,6 +7,7 @@ import com.badlogic.ashley.core.EntitySystem;
import com.badlogic.ashley.core.Family; import com.badlogic.ashley.core.Family;
import com.badlogic.ashley.utils.ImmutableArray; import com.badlogic.ashley.utils.ImmutableArray;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.OrthographicCamera;
@ -16,17 +17,15 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType; import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.saltosion.gladiator.components.CPhysics; import com.saltosion.gladiator.components.CPhysics;
import com.saltosion.gladiator.components.CRenderedObject; import com.saltosion.gladiator.components.CRenderedObject;
import com.saltosion.gladiator.gui.GUINode; import com.saltosion.gladiator.gui.GUINode;
import com.saltosion.gladiator.gui.ImageNode; import com.saltosion.gladiator.gui.ImageNode;
import com.saltosion.gladiator.util.AppUtil; import com.saltosion.gladiator.util.AppUtil;
import com.saltosion.gladiator.util.Global; import com.saltosion.gladiator.util.Global;
import com.saltosion.gladiator.util.Log;
import com.saltosion.gladiator.util.Name;
import com.saltosion.gladiator.util.SpriteLoader;
import com.saltosion.gladiator.util.SpriteSequence; import com.saltosion.gladiator.util.SpriteSequence;
import java.util.ArrayList;
import java.util.List;
public class RenderingSystem extends EntitySystem { public class RenderingSystem extends EntitySystem {
@ -37,8 +36,8 @@ public class RenderingSystem extends EntitySystem {
private SpriteBatch batch; private SpriteBatch batch;
private BitmapFont font; private BitmapFont font;
private ShapeRenderer debugRenderer; private ShapeRenderer debugRenderer;
private OrthographicCamera camera; private OrthographicCamera camera, fontCamera;
public static float aspectratio; public static float aspectratio;
public static int screenHeight = 0; public static int screenHeight = 0;
public static int screenWidth = 0; public static int screenWidth = 0;
@ -46,21 +45,31 @@ public class RenderingSystem extends EntitySystem {
private boolean debug = true; private boolean debug = true;
private final Color debugColor = new Color(0, 1, 0, 1); private final Color debugColor = new Color(0, 1, 0, 1);
private List<TextObject> drawableText;
@Override @Override
public void addedToEngine(Engine engine) { public void addedToEngine(Engine engine) {
updateEntities(engine); updateEntities(engine);
batch = new SpriteBatch(); batch = new SpriteBatch();
font = new BitmapFont();
font.setScale(0.3f); font = new BitmapFont(Gdx.files.internal("fonts/roman.fnt"));
font.setUseIntegerPositions(true);
debugRenderer = new ShapeRenderer(); debugRenderer = new ShapeRenderer();
camera = new OrthographicCamera(); camera = new OrthographicCamera();
camera.setToOrtho(false, 1, 1); camera.setToOrtho(false, 1, 1);
fontCamera = new OrthographicCamera();
fontCamera.setToOrtho(false, Global.FONT_SCALE, Global.FONT_SCALE);
drawableText = new ArrayList<TextObject>();
} }
public void setViewport(int width, int height) { public void setViewport(int width, int height) {
camera.setToOrtho(false, width, height); camera.setToOrtho(false, width, height);
fontCamera.setToOrtho(false, width * Global.FONT_SCALE, height * Global.FONT_SCALE);
} }
@Override @Override
@ -68,10 +77,20 @@ public class RenderingSystem extends EntitySystem {
CPhysics phys = pm.get(AppUtil.player); CPhysics phys = pm.get(AppUtil.player);
camera.position.set(phys.getPosition().x, phys.getPosition().y, 0); camera.position.set(phys.getPosition().x, phys.getPosition().y, 0);
camera.update(); camera.update();
fontCamera.position.set(phys.getPosition().x * Global.FONT_SCALE, phys.getPosition().y * Global.FONT_SCALE, 0);
fontCamera.update();
Gdx.gl.glClearColor(0, 0, 0, 0); Gdx.gl.glClearColor(0, 0, 0, 0);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.setProjectionMatrix(camera.combined); batch.setProjectionMatrix(camera.combined);
renderEntities(deltaTime);
renderGUI(Vector2.Zero);
renderDebug(camera);
renderFont(fontCamera);
}
private void renderEntities(float deltaTime) {
batch.begin(); batch.begin();
for (int i = 0; i < entities.size(); i++) { for (int i = 0; i < entities.size(); i++) {
CRenderedObject renderedObject = rom.get(entities.get(i)); CRenderedObject renderedObject = rom.get(entities.get(i));
@ -91,14 +110,32 @@ public class RenderingSystem extends EntitySystem {
float nextFrame = renderedObject.getCurrentFrame() + deltaTime * currSequence.getPlayspeed(); float nextFrame = renderedObject.getCurrentFrame() + deltaTime * currSequence.getPlayspeed();
renderedObject.setCurrentFrame(nextFrame % currSequence.frameCount()); renderedObject.setCurrentFrame(nextFrame % currSequence.frameCount());
} }
renderGUINode(AppUtil.guiManager.getRootNode(), new Vector2(0, 0));
batch.end(); batch.end();
}
private void renderGUI(Vector2 rootPosition) {
batch.begin();
renderGUINode(AppUtil.guiManager.getRootNode(), rootPosition);
batch.end();
}
private void renderGUINode(GUINode node, Vector2 position) {
position.add(node.getPosition());
if (node instanceof ImageNode) {
Sprite s = ((ImageNode) node).getImage();
s.setPosition(position.x * AppUtil.VPHEIGHT_CONST * aspectratio - s.getWidth() / 2 + camera.position.x,
position.y * AppUtil.VPHEIGHT_CONST - s.getHeight() / 2 + camera.position.y);
s.draw(batch);
}
for (GUINode child : node.getChildren()) {
renderGUINode(child, position);
}
}
private void renderDebug(Camera camera) {
if (debug) { if (debug) {
debugRenderer.setProjectionMatrix(camera.combined); debugRenderer.setProjectionMatrix(camera.combined);
debugRenderer.begin(ShapeType.Line); debugRenderer.begin(ShapeType.Line);
debugRenderer.setColor(debugColor);
for (int i = 0; i < entities.size(); i++) { for (int i = 0; i < entities.size(); i++) {
CPhysics physics = pm.get(entities.get(i)); CPhysics physics = pm.get(entities.get(i));
float x0 = physics.getPosition().x - physics.getSize().x / 2; float x0 = physics.getPosition().x - physics.getSize().x / 2;
@ -106,6 +143,7 @@ public class RenderingSystem extends EntitySystem {
float y0 = physics.getPosition().y - physics.getSize().y / 2; float y0 = physics.getPosition().y - physics.getSize().y / 2;
float y1 = physics.getPosition().y + physics.getSize().y / 2; float y1 = physics.getPosition().y + physics.getSize().y / 2;
debugRenderer.setColor(debugColor);
debugRenderer.line(x0, y0, x1, y0); debugRenderer.line(x0, y0, x1, y0);
debugRenderer.line(x1, y0, x1, y1); debugRenderer.line(x1, y0, x1, y1);
debugRenderer.line(x1, y1, x0, y1); debugRenderer.line(x1, y1, x0, y1);
@ -114,18 +152,26 @@ public class RenderingSystem extends EntitySystem {
debugRenderer.end(); debugRenderer.end();
} }
} }
public void renderGUINode(GUINode node, Vector2 position) { /**
position.add(node.getPosition()); * This is the main method that actually _renders_ the text. Use
if (node instanceof ImageNode) { * "drawString(str, pos)" method to add a string to a list that will be
Sprite s = ((ImageNode) node).getImage(); * rendered here.
s.setPosition(position.x*AppUtil.VPHEIGHT_CONST*aspectratio-s.getWidth()/2+camera.position.x, *
position.y*AppUtil.VPHEIGHT_CONST-s.getHeight()/2+camera.position.y); * @param camera
s.draw(batch); */
} private void renderFont(Camera fontCamera) {
for (GUINode child : node.getChildren()) { batch.setProjectionMatrix(fontCamera.combined);
renderGUINode(child, position); batch.begin();
for (TextObject obj : drawableText) {
font.draw(batch, obj.text, obj.position.x / Global.FONT_SCALE, obj.position.y / Global.FONT_SCALE);
} }
drawableText.clear();
batch.end();
}
public void drawString(String text, Vector2 position) {
drawableText.add(new TextObject(text, position));
} }
public void updateEntities(Engine engine) { public void updateEntities(Engine engine) {
@ -139,9 +185,20 @@ public class RenderingSystem extends EntitySystem {
public void setDebug(boolean debug) { public void setDebug(boolean debug) {
this.debug = debug; this.debug = debug;
} }
public Vector2 getCameraLocation() { public Vector2 getCameraLocation() {
return new Vector2(this.camera.position.x, this.camera.position.y); return new Vector2(this.camera.position.x, this.camera.position.y);
} }
private class TextObject {
public String text;
public Vector2 position;
public TextObject(String text, Vector2 position) {
this.text = text;
this.position = position;
}
}
} }

View File

@ -2,11 +2,16 @@ package com.saltosion.gladiator.util;
public class Global { public class Global {
public static final String STATICPLAYER = "STATICPLAYER"; public static final String STATICPLAYER = "STATICPLAYER";
public static final String PLAYERIMG = "PLAYERIMG"; public static final String PLAYERIMG = "PLAYERIMG";
public static final String GAME_NAME = "Gladiator Brawl"; public static final String GAME_NAME = "Gladiator Brawl";
public static final float SPRITE_SCALE = 1 / 16f; public static final float SPRITE_SCALE = 1 / 16f;
/**
* Higher font scale = smaller text
*/
public static final float FONT_SCALE = 30;
} }