From 024a2e35638436dd36379d86f1619b617c2ecea9 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Fri, 28 Aug 2015 16:26:52 +0200 Subject: user-settable vignette --- gui.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gui.py b/gui.py index f4654ef..83730bf 100644 --- a/gui.py +++ b/gui.py @@ -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): -- cgit v1.2.3