added game font rendering using etxt to player hud, fixed current level
This commit is contained in:
@@ -29,6 +29,7 @@ func NewLevelScene(game *Game, startlevel int) Scene {
|
||||
func (scene *LevelScene) GenerateLevels(game *Game) {
|
||||
min := []int{}
|
||||
for _, level := range assets.Levels {
|
||||
level := level
|
||||
scene.Levels = append(scene.Levels, NewLevel(game, 32, &level))
|
||||
min = append(min, level.MinMoves)
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ func (scene *NextlevelScene) SetupUILast() {
|
||||
|
||||
rowContainer := gameui.NewRowContainer(false)
|
||||
label1text := "Last level, congratulations!"
|
||||
label2text := fmt.Sprintf("Your final score: %d", observer.GetLevelScore())
|
||||
label2text := fmt.Sprintf("Your final score: %d", observer.GetScore())
|
||||
|
||||
buttonMenu := gameui.NewMenuButton("Menu", *assets.FontRenderer.FontNormal,
|
||||
func(args *widget.ButtonClickedEventArgs) {
|
||||
|
||||
@@ -134,7 +134,7 @@ func (scene *SelectScene) SetupUI() {
|
||||
}),
|
||||
// This required function returns the string displayed in the list
|
||||
widget.ListOpts.EntryLabelFunc(func(e interface{}) string {
|
||||
return e.(LevelEntry).Name
|
||||
return fmt.Sprintf("%02d %s", e.(LevelEntry).Id, e.(LevelEntry).Name)
|
||||
}),
|
||||
// Padding for each entry
|
||||
widget.ListOpts.EntryTextPadding(widget.NewInsetsSimple(5)),
|
||||
|
||||
Reference in New Issue
Block a user