Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ApqNBvNbNCwXqR2RLo8QJh
18 lines
816 B
Python
18 lines
816 B
Python
"""Uno sfondo del gioco ingrandito due volte con sopra la griglia delle coordinate di scena (640x360): serve per
|
|
piazzare hotspot, candele ed effetti nel punto giusto.
|
|
python3 tools/griglia.py assets/scenes/scuola.png /tmp/griglia-scuola.png"""
|
|
import sys
|
|
from PIL import Image, ImageDraw
|
|
|
|
src, out = sys.argv[1], sys.argv[2]
|
|
im = Image.open(src).convert('RGB').resize((1280, 720), Image.NEAREST)
|
|
d = ImageDraw.Draw(im, 'RGBA')
|
|
for x in range(0, 640, 20):
|
|
d.line([(x * 2, 0), (x * 2, 720)], fill=(255, 0, 255, 140 if x % 100 == 0 else 50))
|
|
for y in range(0, 360, 20):
|
|
d.line([(0, y * 2), (1280, y * 2)], fill=(255, 0, 255, 140 if y % 100 == 0 else 50))
|
|
for x in range(0, 640, 100):
|
|
for y in range(0, 360, 100):
|
|
d.text((x * 2 + 3, y * 2 + 2), f'{x},{y}', fill=(255, 255, 0, 255))
|
|
im.save(out)
|