Skip to content

Instantly share code, notes, and snippets.

@quintopia
Created February 13, 2017 02:01
Show Gist options
  • Save quintopia/68647804904622032a1600c76e695ebb to your computer and use it in GitHub Desktop.
Save quintopia/68647804904622032a1600c76e695ebb to your computer and use it in GitHub Desktop.
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.scatter import Scatter
from kivy.core.window import Window
from kivy.uix.floatlayout import FloatLayout
Window.clearcolor = (1, 1, 1, 1)
class TextSquare(Widget):
pass
class ScatterTestApp(App):
def build(self):
f = FloatLayout()
scatter = Scatter(do_rotation=False,do_scale=False)
scatter.add_widget(TextSquare())
f.add_widget(scatter)
return f
if __name__ == '__main__':
ScatterTestApp().run()
#:kivy 1.0.9
<TextSquare>:
canvas:
Color:
rgb: 0,0,0
Rectangle:
pos: 20,20
size: 100,50
Rectangle:
pos: 30,30
size: 80,30
Label:
font_size: 30
center_x: self.width / 2
center_y: self.height / 2
text: "Test"
@quintopia
Copy link
Author

2017-02-12 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment