Refactor main menu button group in kv file.

This commit is contained in:
Dorian 2017-02-23 09:15:38 -05:00
parent 053430b77c
commit 0505a10045
1 changed files with 34 additions and 32 deletions

View File

@ -25,46 +25,48 @@ ScreenManager:
size: self.size size: self.size
Label: Label:
size_hint_y: 0.1 size_hint_y: 0.1
BoxLayout: MainMenuButtonGroup:
orientation: "vertical"
size_hint_x: 0.9 size_hint_x: 0.9
pos_hint: {'center_x': 0.5} pos_hint: {'center_x': 0.5}
Button:
text: "New Game"
size_hint_y: 0.1
on_press:
root.manager.transition.direction = 'left'
root.manager.current = 'game'
Button:
text: "Open Game"
disabled: True
size_hint_y: 0.1
Button:
text: "Save Game"
disabled: True
size_hint_y: 0.1
Button:
text: "About Game"
size_hint_y: 0.1
on_press:
root.manager.transition.direction = 'left'
root.manager.current = 'info'
Button:
text: "Settings"
size_hint_y: 0.1
on_press:
app.open_settings()
Button:
text: "Exit"
size_hint_y: 0.1
on_press:
app.stop()
Label: Label:
text: "Version {}".format(justcheckers.__version__) text: "Version {}".format(justcheckers.__version__)
size_hint_y: 0.1 size_hint_y: 0.1
pos_hint: {'center_x': 0.9} pos_hint: {'center_x': 0.9}
<MainMenuButtonGroup@BoxLayout>:
orientation: "vertical"
Button:
text: "New Game"
size_hint_y: 0.1
on_press:
root.parent.parent.manager.transition.direction = 'left'
root.parent.parent.manager.current = 'game'
Button:
text: "Open Game"
disabled: True
size_hint_y: 0.1
Button:
text: "Save Game"
disabled: True
size_hint_y: 0.1
Button:
text: "About Game"
size_hint_y: 0.1
on_press:
root.parent.parent.manager.transition.direction = 'left'
root.parent.parent.manager.current = 'info'
Button:
text: "Settings"
size_hint_y: 0.1
on_press:
app.open_settings()
Button:
text: "Exit"
size_hint_y: 0.1
on_press:
app.stop()
<GameScreen@Screen>: <GameScreen@Screen>:
name: 'game' name: 'game'
Image: Image: