base documentation of konstructor
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user