summaryrefslogtreecommitdiff
path: root/gui.py
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-09-23 23:42:24 +0200
committerFlorian Jung <flo@windfisch.org>2015-09-23 23:51:09 +0200
commit40e1693809b788470cd3daf62d13d21b1353667e (patch)
treecfcbc4294c5fd36b658056767aca581edff1177f /gui.py
parent6b01cbf241173e9047654eef02786669216e2e9d (diff)
gui fixes
Diffstat (limited to 'gui.py')
-rw-r--r--gui.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/gui.py b/gui.py
index 2a8460c..33f0a08 100644
--- a/gui.py
+++ b/gui.py
@@ -80,13 +80,21 @@ def draw_box(rect, color, filled=False, global_coords=True):
world_to_win_pt(rect[0][0], c.player.center),
world_to_win_pt(rect[0][1], c.player.center)
)
- rect = (t, rect[1])
+ w = (
+ world_to_win_length(rect[1][0]),
+ world_to_win_length(rect[1][1])
+ )
+ rect = (t, w)
if filled:
screen.fill(color, rect)
else:
gfxdraw.rectangle(screen, rect, color)
+
+def draw_square(pos, r, color, filled=False, global_coords=True):
+ draw_box(((pos[0]-r, pos[1]-r),(pos[0]+r,pos[1]+r)), color, filled, global_coords)
+
def draw_circle(pos, r, color, filled=False, global_coords=True):
if global_coords:
pos = world_to_win_pt(pos, c.player.center)