Minor examples/canvas/clearbuffers.py code readability

This commit is contained in:
Charles Merriam 2015-02-01 00:13:07 -08:00
parent 6e0a1d9df1
commit 79a0f65c8b
1 changed files with 3 additions and 3 deletions

View File

@ -14,6 +14,7 @@ from kivy.graphics import Color, Rectangle, Canvas, ClearBuffers, ClearColor
from kivy.graphics.fbo import Fbo
from kivy.uix.floatlayout import FloatLayout
from kivy.properties import ObjectProperty, NumericProperty
from kivy.factory import Factory
class FboFloatLayout(FloatLayout):
@ -37,7 +38,7 @@ class FboFloatLayout(FloatLayout):
super(FboFloatLayout, self).__init__(**kwargs)
def add_widget(self, *largs):
# trick to attach graphics instructino to fbo instead of canvas
# trick to attach graphics instruction to fbo instead of canvas
canvas = self.canvas
self.canvas = self.fbo
ret = super(FboFloatLayout, self).add_widget(*largs)
@ -69,13 +70,12 @@ class FboFloatLayout(FloatLayout):
from kivy.app import App
from kivy.core.window import Window
from kivy.animation import Animation
from kivy.factory import Factory as F
class ScreenLayerApp(App):
def build(self):
f = FboFloatLayout()
b = F.Button(text="FBO", size_hint=(None, None))
b = Factory.Button(text="FBO", size_hint=(None, None))
f.add_widget(b)
def anim_btn(*args):