From e71f8381fc26b2819e671bda033a46899b000944 Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Sat, 7 Jun 2014 17:34:44 +0100 Subject: [PATCH] Change effectwidget to work with bg alpha --- kivy/uix/effectwidget.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/kivy/uix/effectwidget.py b/kivy/uix/effectwidget.py index 879e2383f..0a82eb080 100644 --- a/kivy/uix/effectwidget.py +++ b/kivy/uix/effectwidget.py @@ -647,7 +647,7 @@ class EffectWidget(RelativeLayout): with self.fbo: ClearColor(0, 0, 0, 0) ClearBuffers() - Color(*self.background_color) + self._background_color = Color(*self.background_color) self.fbo_rectangle = Rectangle(size=self.size) with self.fbo.after: PopMatrix() @@ -657,10 +657,14 @@ class EffectWidget(RelativeLayout): Clock.schedule_interval(self._update_glsl, 0) self.bind(size=self.refresh_fbo_setup, - effects=self.refresh_fbo_setup) + effects=self.refresh_fbo_setup, + background_color=self._refresh_background_color) self.refresh_fbo_setup() + def _refresh_background_color(self, *args): + self._background_color.rgba = self.background_color + def _update_glsl(self, *largs): '''(internal) Passes new time and resolution uniform variables to the shader. @@ -683,8 +687,9 @@ class EffectWidget(RelativeLayout): with self.canvas: new_fbo = EffectFbo(size=self.size) with new_fbo: - ClearColor(1, 1, 1, 1) + ClearColor(0, 0, 0, 0) ClearBuffers() + Color(1, 1, 1, 1) new_fbo.texture_rectangle = Rectangle(size=self.size) new_fbo.texture_rectangle.size = self.size