Skip to content

Instantly share code, notes, and snippets.

@AllieCarver
Forked from quintopia/main.py
Last active February 13, 2017 02:15
Show Gist options
  • Save AllieCarver/5f70d28a2f205dc36ccd5a18f99402de to your computer and use it in GitHub Desktop.
Save AllieCarver/5f70d28a2f205dc36ccd5a18f99402de 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
from kivy.lang import Builder
Window.clearcolor = (1, 1, 1, 1)
Builder.load_string('''
<TextSquare>:
Label:
markup: True
canvas.before:
Color:
rgb: 0,0,0,1
Rectangle:
pos: self.x - 10, self.y - 10
size: self.texture_size[0]+20, self.texture_size[1]+20
Color:
rgb: 1,1,1,
Rectangle:
pos: 0,0
size: self.texture_size
font_size: 30
size: self.texture_size
text: "[color=000000]TEST[/color]"
''')
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment