Advertisement
jevixlugya

repeat the function

May 8th, 2024
1,140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.94 KB | None | 0 0
  1. class Content(Screen):
  2.     def on_enter(self):
  3.         self.set_animation()
  4.  
  5.     def set_animation(self,*args):
  6.         anim=Animation(opacity=1,duration=1)    
  7.         anim+=Animation(opacity=1,duration=7)
  8.         anim+=Animation(opacity=0,duration=7)
  9.         #self.anim.repeat = True
  10.         anim.start(self.ids.bg)
  11.         anim.bind(on_complete=self.comp)
  12.  
  13.     def comp(self,*args):
  14.         self.ids.bg.source='images/1.jpg'
  15.         anim=Animation(opacity=1,duration=1)    
  16.         anim+=Animation(opacity=1,duration=7)
  17.         anim+=Animation(opacity=0,duration=7)      
  18.         anim.start(self.ids.bg)    
  19.         anim.bind(on_complete=self.compl)
  20.  
  21.     def compl(self,*args):
  22.         self.ids.bg.source='images/2b.jpg'
  23.         anim=Animation(opacity=1,duration=1)    
  24.         anim+=Animation(opacity=1,duration=7)
  25.         anim+=Animation(opacity=0,duration=7)      
  26.         anim.start(self.ids.bg)    
  27.         anim.repeat = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement