-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathd2.py
63 lines (49 loc) · 1.11 KB
/
d2.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
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import Screen
from kivy.uix.widget import Widget
from kivy.core.window import Window
ratio = 3
Window.size = 1440 // ratio, 2911 // ratio
mw, mh = map_size = 480, 480
Builder.load_string('''
#:import utils kivy.utils
<RootWidget>:
canvas:
Color:
rgba: utils.get_color_from_hex('#6B6863')
#rgba: 0, 0, 1, 1
Rectangle:
pos: 0, 0
size: root.ww, root.wh/15
Color:
rgba: utils.get_color_from_hex('#73B5D3')
Rectangle:
pos: 0, root.wh // 15
size: root.ww, root.mh
#source: 'worldmap_480_480.png'
source: 'worldmap-resized-1.png'
Color:
rgba: utils.get_color_from_hex('#73B5D3')
Rectangle:
pos: 0, (root.wh // 15 + root.mh)
size: root.ww, root.wh - root.wh // 15 - root.mh
FloatLayout:
Label:
text: 'Hello'
pos:
''')
class SubWidget(Widget):
ww, wh = Window.size
mw, mh = 480, 480
pass
class RootWidget(Screen):
ww, wh = Window.size
mw, mh = 480, 480
pass
class TestApp(App):
ww, wh = Window.size
def build(self):
return RootWidget()
if __name__ == '__main__':
TestApp().run()