-
Notifications
You must be signed in to change notification settings - Fork 1
/
ttest.py
74 lines (63 loc) · 1.98 KB
/
ttest.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
74
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen, SlideTransition
Builder.load_string("""
<MenuScreen>:
BoxLayout:
padding:200
canvas.before:
Rectangle:
pos: self.pos
size: self.size
source:'Brushed background.png'
BoxLayout:
spacing: dp(7)
BoxLayout:
padding: 20
# CHANGE to canvas for proper trasition
canvas.after:
Color:
rgba:[0,0,0,1]
Line:
width:dp(8)
rounded_rectangle: (*self.pos,self.width,self.height, 2)
Button:
text: 'Go To Editor'
on_press: root.manager.current = 'editor'
<EditorScreen>:
BoxLayout:
padding:200
canvas.before:
Rectangle:
pos: self.pos
size: self.size
source:'Brushed background.png'
BoxLayout:
spacing: dp(7)
BoxLayout:
padding: 20
# CHANGE TO canvas for proper transition
canvas.after:
Color:
rgba:[0,0,0,1]
Line:
width:dp(8)
rounded_rectangle: (*self.pos,self.width,self.height, 2)
Button:
text: 'Go to Menu'
on_press:root.manager.current = 'menu'
""")
# Declare both screens
class MenuScreen(Screen):
pass
class EditorScreen(Screen):
pass
# Create the screen manager
sm = ScreenManager()
sm.transition = SlideTransition(duration=2)
sm.add_widget(MenuScreen(name='menu'))
sm.add_widget(EditorScreen(name='editor'))
class TestApp(App):
def build(self):
return sm
TestApp().run()