initial commit: llamamod 0.2.0 – reverse-engineered level formats (wad, map, trak, text, stpc), python tools and notes, java mod manager (iso install, mod pipeline with exe patching, save editor, wine/windows launcher) with mods (test world, debug wireframe, mirror, randomizer, fog, cheats, intro skip, practice, free camera, boot to level, level projects) and the 3d level editor (geometry, objects, cross-world import, environment, textures, play-test, manual)

This commit is contained in:
MineTec committed 2026-11-07 08:15:40 +01:00
commit b36a366240
826 files changed
+105304

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
# label.py IN.png LABELS.json OUT.jpg "Titel" [breite] -> beschriftete JPG-Vorschau
import sys, json
from PIL import Image, ImageDraw, ImageFont
src, lj, out, title = sys.argv[1:5]
W = int(sys.argv[5]) if len(sys.argv) > 5 else 1280
im = Image.open(src).convert('RGB')
im = im.resize((W, round(im.height * W / im.width)), Image.LANCZOS)
d = ImageDraw.Draw(im, 'RGBA')
F = '/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf'
f = ImageFont.truetype(F, 30); ft = ImageFont.truetype(F, 26)
COL = {'Start': (255, 120, 40), 'Galerie': (255, 205, 40), 'Gehege': (120, 220, 90),
'Parkour': (80, 170, 255), 'Ziel': (200, 110, 255)}
OFF = {'Galerie': (0, 0), 'Parkour': (0, -40), 'Ziel': (0, -30), 'Start': (0, -40), 'Gehege': (0, 0)}
lab = json.load(open(lj))
for k, (u, v) in lab.items():
if not (0 <= u <= 1 and 0 <= v <= 1):
continue
x, y = u * im.width + OFF[k][0], v * im.height + OFF[k][1]
tw, th = d.textbbox((0, 0), k, font=f)[2:]
bx = (x - tw / 2 - 12, y - th / 2 - 8, x + tw / 2 + 12, y + th / 2 + 10)
d.rounded_rectangle(bx, 10, fill=(20, 20, 30, 190), outline=COL[k] + (255,), width=3)
d.text((x - tw / 2, y - th / 2), k, font=f, fill=COL[k])
if title:
tw, th = d.textbbox((0, 0), title, font=ft)[2:]
d.rectangle((0, 0, tw + 30, th + 20), fill=(20, 20, 30, 170))
d.text((15, 8), title, font=ft, fill=(255, 255, 255))
im.save(out, quality=85, optimize=True)
print(out, im.size)