kivy/examples/testapp.py

27 lines
690 B
Python
Raw Normal View History

2010-11-04 16:32:10 +00:00
from kivy.app import App
2010-11-06 05:27:41 +00:00
from kivy.clock import Clock
2010-11-06 03:14:23 +00:00
from kivy.uix.widget import Widget
2010-11-05 23:25:13 +00:00
from kivy.uix.button import Button
2010-11-06 03:14:23 +00:00
from kivy.uix.label import Label
from kivy.uix.video import Video
from kivy.core.image import Image
2010-11-06 03:14:23 +00:00
from kivy.graphics import *
from kivy.core.text import Label as CoreLabel
2010-11-06 03:14:23 +00:00
2010-11-06 05:27:41 +00:00
from random import random
2010-11-04 16:32:10 +00:00
tex1 = Image('examples/test-rect.png').texture
tex2 = Image('examples/kivy.jpg').texture
2010-11-04 16:32:10 +00:00
class TestApp(App):
def build(self):
2010-11-16 23:00:57 +00:00
w = Widget()
with w.canvas:
Color(1,1,1,1)
Rectangle(size=(200,200), texture=tex1)
Color(1,1,1,1)
Ellipse(pos=(300,200), texture=tex2)
2010-11-16 23:00:57 +00:00
return w
2010-11-04 16:32:10 +00:00
TestApp().run()