Created
July 21, 2014 17:15
-
-
Save spillz/cb68aca4f4595d13a9fc to your computer and use it in GitHub Desktop.
kivy properties example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.lang import Builder | |
from kivy.uix.floatlayout import FloatLayout | |
Builder.load_string(''' | |
#:kivy 1.6 | |
<MyLayout>: | |
my_rect_size: self.size[0]/2, self.size[1]/2 | |
canvas: | |
Color: | |
rgba: [0,1,0,1] | |
Rectangle: | |
pos: self.pos | |
size: self.my_rect_size | |
''') | |
class MyLayout(FloatLayout): | |
pass | |
class MyApp(App): | |
def build(self): | |
return MyLayout() | |
if __name__ == '__main__': | |
MyApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment