diff tools/preview.py @ 2:3dd5b745fa08

updated art with inked drawings
author ark
date 2026-10-18 15:08 +0200
parents 5492efd60e2c
children 30bd10284fd8
line wrap: on
line diff
--- a/tools/preview.py	Sun Oct 18 14:50:20 2026 +0200
+++ b/tools/preview.py	Sun Oct 18 15:08:34 2026 +0200
@@ -81,10 +81,10 @@
     return sheet
 
 
-def tower_sheet(assets):
+def tower_sheet(assets, pivots):
     """
     tower levels 1-5 per row: at full size on grey, so the white fill shows,
-    and at game scale next to each other.
+    and at game scale next to each other. a cross marks the rotation point.
     """
     rows = []
     for t in range(4):
@@ -104,9 +104,10 @@
         y = 20 + t * cell_h
         for lv, im in enumerate(r):
             x = lv * cell_w + pad // 2
-            # cross at the image centre, the default rotation point
             sheet.alpha_composite(im, (x, y))
-            cx, cy = x + im.width // 2, y + im.height // 2
+            name = f"t{t}" if lv == 0 else f"t{t}_{lv + 1}"
+            px, py = pivots.get(name, (0.5, 0.5))
+            cx, cy = x + round(im.width * px), y + round(im.height * py)
             draw.line((cx - 5, cy, cx + 5, cy), fill=(255, 0, 0))
             draw.line((cx, cy - 5, cx, cy + 5), fill=(255, 0, 0))
             small = im.resize((max(1, im.width // 4), max(1, im.height // 4)), Image.LANCZOS)