a56de62077b5fc8431c082c399db4bb11fcaabae
1 # -*- coding: utf-8 -*-
8 from pgu
.gui
import Table
, Spacer
, Label
, Button
, Switch
, Select
10 from gui
.constants
import reversedReadabilityDict
, modeDict
14 Écran de démarrage de minwii
17 def __init__(self
,**params
):
18 Table
.__init
__(self
,**params
)
19 self
.spaceSize
= (100,100)
20 self
.font
= pygame
.font
.Font(None,70)
26 self
.td(Spacer(*self
.spaceSize
))
29 # bouton pour browser de fichiers
31 self
.td(self
.createLabel("Chanson :"))
32 self
.browseButton
= Button(self
.createLabel("Choisir..."))
33 self
.td(self
.browseButton
,colspan
=2)
34 self
.songSwitch
= Switch(False)
35 self
.td(self
.songSwitch
)
38 self
.td(Spacer(*self
.spaceSize
))
42 self
.td(self
.createLabel("Niveau :"))
43 self
.modeSelect
= Select('easy')
44 for key
in modeDict
.keys() :
45 self
.modeSelect
.add(self
.createLabel(reversedReadabilityDict
[key
]),key
)
46 self
.td(self
.modeSelect
,colspan
=3)
49 self
.td(Spacer(*self
.spaceSize
))
53 self
.td(self
.createLabel("Joueurs :", self
.font
))
55 self
.activeWiimoteSwitches
= []
59 playerTable
.td(self
.createLabel(" %d " % (i
+1)))
60 self
.activeWiimoteSwitches
.append(s
)
61 self
.td(playerTable
,colspan
= 3)
64 self
.td(Spacer(*self
.spaceSize
))
66 # boutons jouer / quitter
68 self
.quitButton
= Button(self
.createLabel("Quitter"))
69 self
.td(self
.quitButton
)
70 self
.playButton
= Button(self
.createLabel("Jouer"))
71 self
.td(self
.playButton
,colspan
=3)
74 self
.td(Spacer(500,500))
76 def createLabel(self
,text
,font
= None):
79 w
,h
= self
.font
.size(text
)
80 label
= Label(text
,width
=w
,height
=h
,font
= font
)