from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.clock import Clock
class main_page(GridLayout):
def __init__(self, **kwargs):
self.line = 0
self.ballx= 2
self.bally= 2
self.width = 10
self.aaa=10
super(main_page, self).__init__(**kwargs)
self.cols = 1
self.add_widget(Label(text="hello"))
Clock.schedule_once(self.my_callback, 1)
def my_callback(self, dt):
self.clear_widgets()
Clock.schedule_once(self.aparitie, .5)
def aparitie(self, dt):
for x in range(self.aaa):
self.line+=1
if self.line==self.ballx:
self.add_widget(Label(text="."*(self.bally-1)+"X"+"."*(20-self.bally)))
else:
self.add_widget(Label(text="."*20 ))
class MyApp(App):
def build(self):
return main_page()
if __name__ == '__main__':
MyApp().run()