diff options
author | Florian Jung <flo@windfisch.org> | 2015-09-23 23:42:24 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2015-09-23 23:42:24 +0200 |
commit | 1bb5b4ebf357fb80bab9414f5c482f6460b4e3db (patch) | |
tree | 8573ae14493e539b35d3a2e96a9483750cb7080f /gui.py | |
parent | 8184e7c9a463867e9be420558503b7a52c3e9e75 (diff) |
gui fixes
Diffstat (limited to 'gui.py')
-rw-r--r-- | gui.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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) |