-
Notifications
You must be signed in to change notification settings - Fork 0
/
prog.py
73 lines (56 loc) · 1.93 KB
/
prog.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
##########################################
# Created by Rentouch #
# Copyright By Rentouch 2011 #
# #
##########################################
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.core.window import Window
from kivy.uix.label import Label
from kivy.uix.image import Image
from kivy.uix.button import Button
from kivy.animation import Animation
import os
import playboard
import menu
class TicTacTouch(Widget):
def __init__(self, **kwargs):
super(TicTacTouch, self).__init__(**kwargs)
#Preload
self.playboard=playboard.PlayBoard(pos=(100,100))
self.menu=menu.Menu(pos=(1200,800))
self.settings=playboard.Settings_1(pos=(1200,400))
self.add_widget(self.settings)
self.load()
def load(self):
self.add_widget(self.menu)
pass
def new_game(self, var=1):
self.settings.unload()
self.add_widget(self.playboard)
self.playboard.load()
def stop_game(self):
self.settings.unload()
self.playboard.unload()
self.remove_widget(self.playboard)
def load_settings(self, *kwargs):
self.settings.load()
def unload_settings(self, *kwargs):
self.settings.unload()
class RunProg(Widget):
def __init__(self, **kwargs):
super(RunProg, self).__init__(**kwargs)
#make layers
self.root = Widget()
self.background=Image(source=os.path.join("images/background.png"), size=Window.size)
self.add_widget(self.background)
self.tictac=TicTacTouch()
self.add_widget(self.tictac)
self.add_widget(self.root)
class TicTacTouch_app(App):
def build(self):
return RunProg()
if __name__ == '__main__':
TicTacTouch_app().run()