-
Notifications
You must be signed in to change notification settings - Fork 0
/
Window.kv
362 lines (312 loc) · 10.1 KB
/
Window.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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
#: import Factory kivy.factory.Factory
WindowManager:
MainWindow:
CroWindow:
CrocWindow:
LottoWindow:
RouletteWindow:
<Button>
font_size: 30
pos_hint: {'center_x': .5}
size_hint: (1, .5)
<MainWindow>:
name : "main"
BoxLayout:
orientation: "vertical"
size: root.width, root.height
padding: 40
spacing: 15
Label:
id: choose_label
text: "Choose a game!"
font_size: 40
color: (13/255, 133/255, 0, 1)
bold: True
italic: True
RoundedButton:
text: "Lotto number"
on_release:
app.root.current = "lotto"
root.manager.transition.direction = "left"
RoundedButton:
text: "Roulette"
on_release:
app.root.current = "rou"
root.manager.transition.direction = "left"
RoundedButton:
text: "Crocodile"
on_release:
app.root.current = "cro"
root.manager.transition.direction = "left"
<CroWindow>:
name : "cro"
recolorName: resetColor1, resetColor2, resetColor3, resetColor4, resetColor5, resetColor6, resetColor7, resetColor8, resetColor9, resetColor10
on_pre_enter: self._update_pos()
randomButton_pos: self._random_pos()
BoxLayout:
orientation: "vertical"
size: root.width, root.height
Button:
text: "<"
size_hint: (None, None)
size: (40,40)
pos_hint: {"x":0}
on_release:
app.root.current = "main"
root.manager.transition.direction = "right"
BackgroundBoxLayout:
RelativeLayout:
Button:
id: resetColor1
background_color: (1,1,1,0)
size_hint: (0.14, 0.08)
pos_hint: {"x":0.07, "y":0.35}
on_press: self.background_color= (1,0,0,1)
Button:
id: resetColor2
background_color: (1,1,1,0)
size_hint: (0.14, 0.08)
pos_hint: {"x":0.05, "y":0.25}
on_press: self.background_color= (1,0,0,1)
Button:
id: resetColor3
background_color: (1,1,1,0)
size_hint: (0.14, 0.08)
pos_hint: {"x":0.05, "y":0.155}
on_press: self.background_color= (1,0,0,1)
Button:
id: resetColor4
background_color: (1,1,1,0)
size_hint: (0.14, 0.08)
pos_hint: {"x":0.13, "y":0.07}
on_press: self.background_color= (1,0,0,1)
Button:
id: resetColor5
background_color: (1,1,1,0)
size_hint: (0.14, 0.08)
pos_hint: {"x":0.33, "y":0.05}
on_press: self.background_color= (1,0,0,1)
Button:
id: resetColor6
background_color: (1,1,1,0)
size_hint: (0.14, 0.08)
pos_hint: {"x":0.55, "y":0.05}
on_press: self.background_color= (1,0,0,1)
Button:
id: resetColor7
background_color: (1,1,1,0)
size_hint: (0.14, 0.08)
pos_hint: {"x":0.74, "y":0.07}
on_press: self.background_color= (1,0,0,1)
Button:
id: resetColor8
background_color: (1,1,1,0)
size_hint: (0.14, 0.08)
pos_hint: {"x":0.82, "y":0.155}
on_press: self.background_color= (1,0,0,1)
Button:
id: resetColor9
background_color: (1,1,1,0)
size_hint: (0.14, 0.08)
pos_hint: {"x":0.81, "y":0.25}
on_press: self.background_color= (1,0,0,1)
Button:
id: resetColor10
background_color: (1,1,1,0)
size_hint: (0.14, 0.08)
pos_hint: {"x":0.8, "y":0.35}
on_press: self.background_color= (1,0,0,1)
RandomButton:
id: random-button
background_color: (1,1,1,0)
size_hint: (0.14, 0.08)
pos_hint: root.randomButton_pos
on_press:
app.root.current = "croc"
root.manager.transition.direction = "left"
<CrocWindow>:
name : "croc"
BoxLayout:
orientation: "vertical"
size: root.width, root.height
Button:
text: "<"
size_hint: (None, None)
size: (40,40)
pos_hint: {"x":0}
on_release:
app.root.current = "main"
root.manager.transition.direction = "right"
BackgroundBoxLayout:
background_image: 'images/cro_close.jpg'
RelativeLayout:
Button:
background_color: (1,1,1,0)
size_hint: (0.25, 0.14)
pos_hint: {"x":0.38, "y":0.14}
on_release:
app.root.current = "cro"
root.manager.transition.direction = "right"
<RoundedButton@Button>
background_color: (0,0,0,0)
background_normal: ''
canvas.before:
Color:
rgba: (0, 194/255, 142/255, 1)
RoundedRectangle:
size: self.size
pos: self.pos
radius: [50]
<BackgroundBoxLayout@BoxLayout>:
background_image: 'images/cro_open.jpg'
canvas.before:
Rectangle:
pos: self.pos
size: self.size
source: self.background_image
<LottoWindow>:
name: "lotto"
random_label: random_label
lotto_number: lotto_number
BoxLayout:
orientation: "vertical"
size: root.width, root.height
spacing: 15
Button:
text: "<"
size_hint: (None, None)
size: (40,40)
pos_hint: {"x":0}
on_release:
app.root.current = "main"
root.manager.transition.direction = "right"
Label:
text: "The number is..."
font_size: 25
color: (13/255, 133/255, 0, 1)
size_hint: 0.6, 0.1
RoundedButton:
id: random_label
text: "_"
size_hint: (.23, .25)
Button:
text: "Reset"
font_size: 25
size_hint: (None, None)
size: (200,40)
pos_hint: {'center_x': .5, 'center_y': .9}
on_release:
random_label.text = '_'
lotto_number.text = '_'
Label:
id: lotto_number
text: "_"
text_size: self.size
halign: "center"
valign: "top"
size_hint: 1, 1
font_size: 30
color: (13/255, 133/255, 0, 1)
Button:
text: "Get more"
font_size: 25
size_hint: (None, None)
size: (300,50)
on_release:
root.generate_more_number()
Button:
text: "Get!"
font_size: 25
size_hint: (None, None)
size: (300,55)
on_press: root.generate_number()
<RouletteWindow>:
name: "rou"
on_pre_enter: self.reset_page()
BoxLayout:
orientation: "vertical"
size: root.width, root.height
spacing: 15
Button:
text: "<"
size_hint: (None, None)
size: (40,40)
pos_hint: {"x":0}
on_release:
app.root.current = "main"
root.manager.transition.direction = "right"
Label:
text: "Write Options"
font_size: 35
color: (13/255, 133/255, 0, 1)
size_hint: (1, 0.3)
Label:
id: number_option
text: "# of Options: 1"
font_size: 20
color: (13/255, 133/255, 0, 1)
size_hint: (1, 0.2)
TextInput:
id: option1
multiline: False
halign: "left"
font_size: 20
size_hint: (0.8, 0.2)
pos_hint: {"x":0.1}
TextInput:
id: option2
multiline: False
halign: "left"
font_size: 20
size_hint: (0.8, 0.2)
pos_hint: {"x":0.1}
background_color: (1,1,1,0)
TextInput:
id: option3
multiline: False
halign: "left"
font_size: 20
size_hint: (0.8, 0.2)
pos_hint: {"x":0.1}
background_color: (1,1,1,0)
TextInput:
id: option4
multiline: False
halign: "left"
font_size: 20
size_hint: (0.8, 0.2)
pos_hint: {"x":0.1}
background_color: (1,1,1,0)
TextInput:
id: option5
multiline: False
halign: "left"
font_size: 20
size_hint: (0.8, 0.2)
pos_hint: {"x":0.1}
background_color: (1,1,1,0)
TextInput:
id: option6
multiline: False
halign: "left"
font_size: 20
size_hint: (0.8, 0.2)
pos_hint: {"x":0.1}
background_color: (1,1,1,0)
Button:
id: plus_button
text: "+"
font_size: 35
size_hint: (0.15,0.3)
on_press: root.add_option()
Button:
text: "Answer Me!"
font_size: 30
size_hint: (0.8,0.3)
on_press: root.select_option()
Label:
id: answer
text: "Answer is..."
font_size: 35
color: (13/255, 133/255, 0, 1)
size_hint: (1, 0.5)