From bb449ea7ce9224284c2b60698cf0b0c7d70f9c71 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 23 Apr 2023 01:44:54 +0200 Subject: Asset scripts and start of client. --- tools/genboxes.py | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 tools/genboxes.py (limited to 'tools/genboxes.py') diff --git a/tools/genboxes.py b/tools/genboxes.py new file mode 100644 index 0000000..650f625 --- /dev/null +++ b/tools/genboxes.py @@ -0,0 +1,73 @@ +mode = None + +list = [] + +x = y = w = h = 0 +name = None + +def flush(): + global x, y, w, h, name + if mode == 'rect': + list.append((x,y,w,h,'box',name)) + if mode == 'circle': + x = cx - rx + y = cy - ry + w = rx * 2 + h = ry * 2 + list.append((x,y,w,h,'circle',name)) + x = y = w = h = 0 + name = None + +for line in open("tools/boxes.svg").readlines(): + line = line.strip() + if line == "') + # print('
') + # print('') + for (x,y,w,h,c,name) in list: + x = round(x) + y = round(y) + w = round(w) + h = round(h) + print(f'
{name}
') + # print('
') + +#print_html() +print_list() -- cgit v1.2.3