added back button
This commit is contained in:
parent
449a75aa7d
commit
35057ec8a6
@ -95,7 +95,7 @@ func (scene *SelectScene) SetupUI() {
|
||||
widget.WidgetOpts.LayoutData(widget.RowLayoutData{
|
||||
Position: widget.RowLayoutPositionCenter,
|
||||
Stretch: true,
|
||||
MaxHeight: 300,
|
||||
MaxHeight: 200,
|
||||
}),
|
||||
)),
|
||||
// Set the entries in the list
|
||||
@ -148,14 +148,31 @@ func (scene *SelectScene) SetupUI() {
|
||||
}),
|
||||
)
|
||||
|
||||
buttonContainer := widget.NewContainer(
|
||||
widget.ContainerOpts.Layout(widget.NewGridLayout(
|
||||
widget.GridLayoutOpts.Columns(2),
|
||||
widget.GridLayoutOpts.Padding(widget.NewInsetsSimple(30)),
|
||||
widget.GridLayoutOpts.Spacing(20, 10),
|
||||
widget.GridLayoutOpts.Stretch([]bool{true, false}, []bool{false, true}),
|
||||
)),
|
||||
)
|
||||
|
||||
buttonPlay := gameui.NewMenuButton("Play selected level", *assets.FontRenderer.FontNormal,
|
||||
func(args *widget.ButtonClickedEventArgs) {
|
||||
scene.SetNext(Play)
|
||||
})
|
||||
|
||||
buttonAbort := gameui.NewMenuButton("Back", *assets.FontRenderer.FontNormal,
|
||||
func(args *widget.ButtonClickedEventArgs) {
|
||||
scene.SetNext(Menu)
|
||||
})
|
||||
|
||||
buttonContainer.AddChild(buttonPlay)
|
||||
buttonContainer.AddChild(buttonAbort)
|
||||
|
||||
rowContainer.AddChild(label)
|
||||
rowContainer.AddChild(list)
|
||||
rowContainer.AddChild(buttonPlay)
|
||||
rowContainer.AddChild(buttonContainer)
|
||||
|
||||
scene.Ui = &ebitenui.UI{
|
||||
Container: rowContainer.Container(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user