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
|
2010-11-07 00:58:04 +00:00
|
|
|
from kivy.uix.video import Video
|
2010-11-18 04:38:40 +00:00
|
|
|
from kivy.core.image import Image
|
2010-11-06 03:14:23 +00:00
|
|
|
from kivy.graphics import *
|
2010-11-30 20:38:22 +00:00
|
|
|
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
|
|
|
|
2010-11-30 20:38:22 +00:00
|
|
|
tex1 = Image('examples/test-rect.png').texture
|
|
|
|
tex2 = Image('examples/kivy.jpg').texture
|
2010-11-18 04:38:40 +00:00
|
|
|
|
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:
|
2010-11-30 20:38:22 +00:00
|
|
|
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()
|