-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlettertrek.kv
233 lines (221 loc) · 7.45 KB
/
lettertrek.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
#:kivy 1.11.1
#: import StartButtonWidget ui
#: import ImageButton ui
#: import Window kivy.core.window
#: import utils kivy.utils
#: set main_color "#2dcdcb"
#: set accent_color "#9c8578"
#: set background_color "#1c2130"
#: set accent_2_color "#FF0000"
#: set accent_3_color "#f87629"
#: set button_pressed_color "#FFFFFF"
<MyLabel@Label>:
font_name: "fonts/zekton.ttf"
<HomeScreen>:
gly_levels: gly_levels
scv_levels: scv_levels
canvas.before:
Color:
rgba: utils.get_color_from_hex(background_color)
Rectangle:
pos: self.pos
size: self.size
BoxLayout:
orientation: 'vertical'
FloatLayout:
MyLabel:
text: "Letter\nTrek"
halign: 'center'
markup: True
size_hint: .5, .1
pos_hint: {"x":.25,"top":.80}
font_size: dp(60)
ScrollView:
id: scv_levels
pos_hint: {"x":.05,"top":.45}
size_hint: 0.9, .15
do_scroll_y: False
do_scroll_x: True
bar_width: 0
GridLayout:
id: gly_levels
rows: 1
size_hint_x: None
col_default_width: root.width * .2
width: self.minimum_width
spacing: dp(5),dp(5)
padding: dp(10)
MyLabel:
text: "move tiles to build the word\nany direction matters"
halign: 'center'
markup: True
size_hint: .5, .1
pos_hint: {"x":.25,"top":.60}
font_size: dp(15)
<ChallengeCompletedScreen>:
btn_continue: btn_continue
lbl_challenge_completed: lbl_challenge_completed
lbl_level: lbl_level
lbl_challenge: lbl_challenge
canvas.before:
Color:
rgba: utils.get_color_from_hex(background_color)
Rectangle:
pos: self.pos
size: self.size
FloatLayout:
MyLabel:
id: lbl_challenge_completed
text: "Challenge \ncompleted!"
halign: "left"
size_hint: .5, .1
pos_hint: {"x":.15,"top":.84}
font_size: dp(35)
MyLabel:
id: lbl_level
text_size: self.size
text: "Level: 1"
halign: "left"
size_hint: .5, .1
pos_hint: {"x":.15,"top":.75}
font_size: dp(20)
MyLabel:
id: lbl_challenge
text: "Challenge: 1"
text_size: self.size
halign: "left"
size_hint: .5, .1
pos_hint: {"x":.15,"top":.70}
font_size: dp(20)
StartButtonWidget:
id: btn_continue
font_name: "fonts/zekton.ttf"
font_size: dp(20)
text: "Continue"
size_hint: .5, .1
pos_hint: {"x":.15,"center_y":.5}
progress: 1
disabled: False
on_touch_up: root.btn_continue_on_touch_up(*args)
<BoardScreen>:
gly_tiles: gly_tiles
#pro_challenge: pro_challenge
#pro_timer: pro_timer
#pro_level: pro_level
pro_moves: pro_moves
btn_back: btn_back
btn_restart: btn_restart
canvas.before:
Color:
rgba: utils.get_color_from_hex(background_color)
Rectangle:
pos: self.pos
size: self.size
BoxLayout:
orientation:'vertical'
size: root.size
pos: root.pos
padding: dp(10)
spacing: dp(5)
BoxLayout:
orientation:'horizontal'
size_hint: 1, 0.15
#ProgressWidget:
# id: pro_timer
ProgressWidget:
id: pro_moves
ImageButton:
id: btn_restart
text: ''
disabled: False
source: "assets/restart.png"
on_release: root.btn_restart_on_press(*args)
MyLabel:
color: utils.get_color_from_hex(main_color)
size_hint: 1, 0.10
text: str(root.word)
font_size: dp(35)
GridLayout:
size_hint: 1, 0.60
#canvas.before:
# Color:
# rgba: 0.1, 0.1, 0.1, 1
# Rectangle:
# pos: self.pos
# size: self.size
id: gly_tiles
spacing: dp(5),dp(5)
BoxLayout:
size_hint: 1, 0.15
MyLabel:
color: utils.get_color_from_hex(main_color)
text: "Level\n" + str(root.level)
halign: 'center'
font_size: dp(20)
ImageButton:
id: btn_back
text: ''
disabled: False
source: "assets/back.png"
on_press: root.btn_back_on_press(*args)
MyLabel:
color: utils.get_color_from_hex(main_color)
text: "Challenge\n" + str(root.challenge) + " / " + str(root.level_challenges)
halign: 'center'
font_size: dp(20)
<ImageButton>:
allow_stretch: True
<StartButtonWidget>:
scale_x: 1
scale_y: 1
canvas.before:
PushMatrix
Scale:
origin: self.center
x: self.scale_x or 1
y: self.scale_y or 1
Color:
rgba: utils.get_color_from_hex(button_pressed_color) if self.pressed else utils.get_color_from_hex(main_color)
Line:
width: dp(1)
rounded_rectangle: (self.x, self.y, self.width * root.progress, self.height, dp(10))
Line:
width: dp(2)
rounded_rectangle: (self.x, self.y, self.width, self.height, dp(10))
canvas.after:
PopMatrix
font_name: "fonts/zekton.ttf"
text: root.text
size: root.size
pos: root.pos
color: utils.get_color_from_hex(button_pressed_color) if self.pressed else utils.get_color_from_hex(main_color)
font_size: root.font_size
opacity: .1 if root.disabled else 1
<ProgressWidget>:
canvas.before:
Color:
rgba: utils.get_color_from_hex(accent_2_color) if self.accent else utils.get_color_from_hex(main_color)
Line:
width: dp(1)
circle: (self.center_x, self.center_y, (self.height-10)/2)
Line:
width: dp(3)
cap: 'round'
circle: (self.center_x, self.center_y, (self.height-10)/2, 360 * root.progress_start, 360 * root.progress)
font_name: "fonts/zekton.ttf"
color: utils.get_color_from_hex(accent_2_color) if self.accent else utils.get_color_from_hex(main_color)
text: str(root.text)
font_size: dp(30)
<TileWidget>:
canvas:
Color:
rgba: utils.get_color_from_hex(button_pressed_color) if root.is_pressed else utils.get_color_from_hex(accent_3_color) if root.is_in_word else utils.get_color_from_hex(accent_3_color)
Line:
width: dp(1)
rounded_rectangle: (self.x, self.y, self.width, self.height, 20)
joint: 'round'
font_name: "fonts/zekton.ttf"
color: utils.get_color_from_hex(button_pressed_color) if root.is_pressed else utils.get_color_from_hex(accent_3_color) if root.is_in_word else utils.get_color_from_hex(accent_3_color)
center: root.center
text: root.letter
font_size: dp(35)