Created
July 13, 2013 06:45
-
-
Save amirkheirabadi73/5989691 to your computer and use it in GitHub Desktop.
Animation The Scatter
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.interactive import InteractiveLauncher | |
from kivy.uix.widget import Widget | |
from kivy.uix.label import Label | |
from kivy.uix.scatter import Scatter | |
from kivy.graphics import Color, Rectangle ,Ellipse ,Bezier ,BorderImage | |
from kivy.animation import Animation as A | |
class myApp(App): | |
def build(self): | |
mywid = Widget() | |
s=Scatter() | |
with s.canvas: | |
Color (0,0,1,.5) | |
Rectangle(pos= (0,0) , size=s.size) | |
Color (1,0,0,0.5) | |
b = Bezier(points= (0,0,s.width , s.height)) | |
po = b.points | |
po.extend((s.width, 0)) | |
b.points = po | |
b.segments = 300 | |
b.points = b.points[0:2] + [s.width/2, s.height*4]+b.points[2:] | |
b.points=[100,0,0,100,0,100] | |
mywid.add_widget(s) | |
anim = A(x= 400 , y =400) | |
anim &= A(scale = 3,d= 4) | |
anim.start(s) | |
return mywid | |
if __name__ == '__main__': | |
myApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment