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,16 +25,23 @@ ScreenManager:
size: self.size
Label:
size_hint_y: 0.1
BoxLayout:
orientation: "vertical"
MainMenuButtonGroup:
size_hint_x: 0.9
pos_hint: {'center_x': 0.5}
Label:
text: "Version {}".format(justcheckers.__version__)
size_hint_y: 0.1
pos_hint: {'center_x': 0.9}
<MainMenuButtonGroup@BoxLayout>:
orientation: "vertical"
Button:
text: "New Game"
size_hint_y: 0.1
on_press:
root.manager.transition.direction = 'left'
root.manager.current = 'game'
root.parent.parent.manager.transition.direction = 'left'
root.parent.parent.manager.current = 'game'
Button:
text: "Open Game"
disabled: True
@ -47,8 +54,8 @@ ScreenManager:
text: "About Game"
size_hint_y: 0.1
on_press:
root.manager.transition.direction = 'left'
root.manager.current = 'info'
root.parent.parent.manager.transition.direction = 'left'
root.parent.parent.manager.current = 'info'
Button:
text: "Settings"
size_hint_y: 0.1
@ -59,11 +66,6 @@ ScreenManager:
size_hint_y: 0.1
on_press:
app.stop()
Label:
text: "Version {}".format(justcheckers.__version__)
size_hint_y: 0.1
pos_hint: {'center_x': 0.9}
<GameScreen@Screen>:
name: 'game'