-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.kv
79 lines (68 loc) · 2.07 KB
/
main.kv
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
75
76
77
78
#:kivy 1.0.9
#:include force other.kv
<TitleButton@Button>: # タイトル画面遷移ボタン
text: 'title'
size_hint: None, None
size: 300, 80
pos_hint: {'x': 0.3, 'y': 0.4}
<TitleScreen>:
BoxLayout:
size: root.size
orientation:'vertical'
Label:
text:'Awesome Game'
Button: # ゲーム画面遷移ボタン
id: startButton
text:'Game Start'
on_press: root.pressStartButton()
<MainGame>:
objectLayer: l01 # オブジェクト等を格納するレイヤー(最背面想定)
workingLayer: l02 # 文字等を配置するレイヤー
txtGameOver: txtGameOver # ゲームオーバー時テキスト
txtPlayerLife: txtPlayerLife # プレイヤーライフテキスト
txtScore: txtScore # プレイヤーライフテキスト
FloatLayout:
size: root.size
id: l01
canvas.before:
Color:
rgba: 0, 0.5, 0.8, 1
Rectangle:
# self here refers to the widget i.e FloatLayout
pos: self.pos
size: self.size
FloatLayout:
size: root.size
id: l02
canvas.before:
Color:
rgba: 0, 0, 0, 0
Rectangle:
# self here refers to the widget i.e FloatLayout
pos: self.pos
size: self.size
Label:
text: ''
id: txtPlayerLife
halign: 'left'
font_size: 45
size_hint: None, None
color: 1, 0, 1, 1
pos_hint: {'x': 0.15, 'y': 0.8}
Label:
text: ''
id: txtGameOver
font_size: 35
size_hint: None, None
pos_hint: {'x': 0.4, 'y': 0.5}
Label:
text: ''
id: txtScore
halign: 'right'
font_size: 35
size_hint: None, None
color: 1, 1, 1, 1
pos_hint: {'x': 0.55, 'y': 0.8}
<MyImages>:
source: 'imgs/images001.png'
size: self.texture_size