diff options
author | Florian Jung <flo@windfisch.org> | 2015-08-28 16:26:52 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2015-08-28 16:26:52 +0200 |
commit | 024a2e35638436dd36379d86f1619b617c2ecea9 (patch) | |
tree | eb309126e5f498e170196c9ad78f0d7628c00cfd /gui.py | |
parent | 403058ba1e31330689f9b36a10384ee0b2e8ebde (diff) |
user-settable vignette
Diffstat (limited to 'gui.py')
-rw-r--r-- | gui.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -33,6 +33,15 @@ marker_updated = [True, True, True] screensize=(1280, 800) screen=pygame.display.set_mode(screensize,HWSURFACE|DOUBLEBUF|RESIZABLE) +vignette = 1. + +def enable_vignette(factor=0.15): + global vignette + if factor: + vignette = 1+factor + else: + vignette = 1 + def draw_bar(rect, val, thresh=None, min=0, max=1, color=(0,0,0), barcolor=None, exceedcolor=(255,0,0), threshcolor=None): v = (val-min)/(max-min) t = (thresh-min)/(max-min) @@ -160,7 +169,7 @@ def update_zoom(): zoom1 = screensize[0] / calculated_visible_width zoom2 = screensize[1] / calculated_visible_height - zoom = min(zoom1,zoom2) / 2 + zoom = min(zoom1,zoom2) / vignette def world_to_win_length(l): |