Module horchata.menu

Creates beautiful menus for your Love2D games

Info:

  • Copyright: 2020
  • License: MIT
  • Author: Juanjo Salvador

Functions

Menu:addEntry (x, y, enabled, label, func) Add a new Entry to the Menu
Menu:draw () Draw the Menu
Menu:new (gamestate, color, sound, font) Creates a new Menu
Menu:refresh () Refresh screen size values (if screen resizing)
Menu:refresh () Refresh screen size values (if screen resizing)
Menu:update () Updates the Menu object
Menu:updateLabel (x, y, w, h, enabled, label) Updates the Menu object's label


Functions

Menu:addEntry (x, y, enabled, label, func)
Add a new Entry to the Menu

Parameters:

  • x The column (X coord) of the entry (0-16), mandatory
  • y The row (Y coord) of the entry (0-9), mandatory
  • enabled An Entry object can be enabled or not
  • label The Entry label, mandatory
  • func The Entry function (whatever the function does)
Menu:draw ()
Draw the Menu
Menu:new (gamestate, color, sound, font)
Creates a new Menu

Parameters:

  • gamestate The Menu GAMESTATE (example: "main_menu")
  • color The default color for the menu entries (optional)
  • sound A Source object for the menu sound
  • font Font for the menu labels (recommended size, 25)
Menu:refresh ()
Refresh screen size values (if screen resizing)
Menu:refresh ()
Refresh screen size values (if screen resizing)
Menu:update ()
Updates the Menu object
Menu:updateLabel (x, y, w, h, enabled, label)
Updates the Menu object's label

Parameters:

  • x
  • y
  • w
  • h
  • enabled
  • label
generated by LDoc 1.4.6 Last updated 2020-04-25 09:21:13