base documentation of konstructor

This commit is contained in:
2023-07-08 16:34:53 +02:00
parent e5c2294f6c
commit 638fb415ec
17 changed files with 80 additions and 1 deletions

View File

@@ -4,24 +4,29 @@ import "image/color"
type MenuMapKey string
// Map of menus
type MenuMap map[MenuMapKey]Menu
// Layout of menu
type MenuLayout struct {
MenuItemFont FontLayout
}
// Menu item
type MenuItem struct {
ID string
Label string
Handler func()
}
// Game menu
type Menu struct {
CurrentSelected int
Layout MenuLayout
MenuItems []MenuItem
}
// Return with the color of menu item
func (menu *Menu) GetMenuItemColor(i int) color.Color {
if menu.CurrentSelected == i {
return menu.Layout.MenuItemFont.SelectedColor