Player list pictures: logo with a brass divider, sun and moon (font createrp:tab)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3cabdf6174
commit
441d7d3b04
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"providers": [
|
||||||
|
{
|
||||||
|
"type": "bitmap",
|
||||||
|
"file": "createrp:font/tab_header.png",
|
||||||
|
"height": 48,
|
||||||
|
"ascent": 46,
|
||||||
|
"chars": [
|
||||||
|
"\ue000"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bitmap",
|
||||||
|
"file": "createrp:font/tab_sun.png",
|
||||||
|
"height": 8,
|
||||||
|
"ascent": 7,
|
||||||
|
"chars": [
|
||||||
|
"\ue001"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bitmap",
|
||||||
|
"file": "createrp:font/tab_moon.png",
|
||||||
|
"height": 8,
|
||||||
|
"ascent": 7,
|
||||||
|
"chars": [
|
||||||
|
"\ue002"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 132 B |
Binary file not shown.
|
After Width: | Height: | Size: 159 B |
@@ -7,6 +7,7 @@ stored here), the key art illustration (branding/art/keyart.png) and, if given,
|
|||||||
snapped to a coarse pixel grid. Output goes to branding/ next to this repo's images.
|
snapped to a coarse pixel grid. Output goes to branding/ next to this repo's images.
|
||||||
"""
|
"""
|
||||||
import io
|
import io
|
||||||
|
import json
|
||||||
import math
|
import math
|
||||||
import sys
|
import sys
|
||||||
import zipfile
|
import zipfile
|
||||||
@@ -195,8 +196,29 @@ ICON_COLOURS = {
|
|||||||
'G': (58, 200, 18), 'g': (0, 150, 0), # server is online
|
'G': (58, 200, 18), 'g': (0, 150, 0), # server is online
|
||||||
'R': (224, 64, 58), 'r': (160, 38, 32), # server is offline
|
'R': (224, 64, 58), 'r': (160, 38, 32), # server is offline
|
||||||
'A': (249, 168, 37), 'a': (190, 110, 20), # maintenance
|
'A': (249, 168, 37), 'a': (190, 110, 20), # maintenance
|
||||||
|
'Y': (255, 216, 61), 'M': (214, 222, 240), # sun and moon in the player list
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SUN_ICON = '''
|
||||||
|
Y..Y..Y
|
||||||
|
.Y.Y.Y.
|
||||||
|
..YYY..
|
||||||
|
YYYYYYY
|
||||||
|
..YYY..
|
||||||
|
.Y.Y.Y.
|
||||||
|
Y..Y..Y
|
||||||
|
'''
|
||||||
|
|
||||||
|
MOON_ICON = '''
|
||||||
|
..MMM..
|
||||||
|
.MM....
|
||||||
|
MM.....
|
||||||
|
MM.....
|
||||||
|
MM.....
|
||||||
|
.MM....
|
||||||
|
..MMM..
|
||||||
|
'''
|
||||||
|
|
||||||
QUIT_ICON = '''
|
QUIT_ICON = '''
|
||||||
#######.......
|
#######.......
|
||||||
#.............
|
#.............
|
||||||
@@ -609,6 +631,32 @@ def main() -> None:
|
|||||||
if path in meta:
|
if path in meta:
|
||||||
target.with_name(target.name + '.mcmeta').write_text(meta[path], encoding='utf-8', newline='\n')
|
target.with_name(target.name + '.mcmeta').write_text(meta[path], encoding='utf-8', newline='\n')
|
||||||
|
|
||||||
|
# --- the player list (Tab): pictures shown as characters of a font of ours, createrp:tab -------------------------
|
||||||
|
# Drawn three texels per GUI pixel, so they are pixel for pixel at GUI scale 3. The bridge mod sends the characters.
|
||||||
|
tab_logo = stack([wordmark(6), motto(3)], gap=9)
|
||||||
|
line = Image.new('RGBA', (tab_logo.width, 21))
|
||||||
|
for x in range(tab_logo.width // 10, tab_logo.width - tab_logo.width // 10):
|
||||||
|
for y in range(9, 12):
|
||||||
|
line.putpixel((x, y), BRASS[2] + (255,))
|
||||||
|
for y in range(12, 15):
|
||||||
|
line.putpixel((x, y), BRASS[0] + (255,))
|
||||||
|
cog = gear(7).resize((21, 21), Image.NEAREST)
|
||||||
|
line.alpha_composite(cog, ((line.width - 21) // 2, 0))
|
||||||
|
header = stack([tab_logo, line], gap=9)
|
||||||
|
header = stack([header, Image.new('RGBA', (1, -header.height % 3))], gap=0)
|
||||||
|
font_dir = OUT / 'resources' / 'createrp'
|
||||||
|
(font_dir / 'textures' / 'font').mkdir(parents=True, exist_ok=True)
|
||||||
|
(font_dir / 'font').mkdir(parents=True, exist_ok=True)
|
||||||
|
header.save(font_dir / 'textures' / 'font' / 'tab_header.png')
|
||||||
|
providers = [{'type': 'bitmap', 'file': 'createrp:font/tab_header.png', 'height': header.height // 3,
|
||||||
|
'ascent': header.height // 3 - 2, 'chars': ['\ue000']}]
|
||||||
|
for char, name, rows in (('\ue001', 'sun', SUN_ICON), ('\ue002', 'moon', MOON_ICON)):
|
||||||
|
icon = button_icon(rows, canvas=8, at=0).resize((24, 24), Image.NEAREST)
|
||||||
|
icon.save(font_dir / 'textures' / 'font' / f'tab_{name}.png')
|
||||||
|
providers.append({'type': 'bitmap', 'file': f'createrp:font/tab_{name}.png', 'height': 8, 'ascent': 7, 'chars': [char]})
|
||||||
|
(font_dir / 'font' / 'tab.json').write_text(json.dumps({'providers': providers}, indent=2), encoding='utf-8', newline='\n')
|
||||||
|
print('player list header:', header.size, '-> GUI', header.width // 3, 'x', header.height // 3)
|
||||||
|
|
||||||
button_icon(QUIT_ICON, canvas=24).save(OUT / 'menu' / 'quit.png') # the corner buttons are 24 x 24
|
button_icon(QUIT_ICON, canvas=24).save(OUT / 'menu' / 'quit.png') # the corner buttons are 24 x 24
|
||||||
on_canvas(gear_icon(14), 24).save(OUT / 'menu' / 'settings.png')
|
on_canvas(gear_icon(14), 24).save(OUT / 'menu' / 'settings.png')
|
||||||
for name, rows in (('online', ONLINE_ICON), ('offline', OFFLINE_ICON), ('maintenance', MAINTENANCE_ICON)):
|
for name, rows in (('online', ONLINE_ICON), ('offline', OFFLINE_ICON), ('maintenance', MAINTENANCE_ICON)):
|
||||||
|
|||||||
Reference in New Issue
Block a user