You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- func has the same behavior as the first example.
-- The player has two buttons for adjusting the value of a menu item.
-- adjust_up and adjust_down are used for these buttons.
-- adjust_* must return the new value to display.
on_return= function() end, -- Optional.
-- When a submenu is closed and the menu returns to this level,
-- on_return is called. Its return values are handled the same way as
-- the func function of a menu item.
-- A submenu that passes by this menu level when closing (by returning
-- "'close', 2" or similar) also calls the on_return functions of each
-- menu level that is closed.
...
}
Input options:
* 3 key mode (L, R, Start)
L and R go up and down the menu items. Start toggles adjust mode for an item. When adjust mode is on, L and R adjust the item instead. Pressing Start on an item with an action function instead of adjust functions activates that item instead of toggling adjust mode.
* 4 key mode (L, R, Select, Start)
Select and Start go up and down items. L and R adjust values. If an item has an action function instead of adjust functions, L does nothing, and R activates the item.
* 5+ key mode (L, R, U, D, Start)
U and D go up and down. L and R adjust values. Start activates items. Select jumps to the top item in the menu.
* Touch screen
Pop up a numpad for changing numeric values, use submenus for setting choice values.
Screenshot:
http://i.imgur.com/DSxU8sh.png
This is the most primitive menu structure. Menus for changing preferences or whatever are built on top of it by writing a function that fills in the common parts (i.e. accessing preferences structure) and allows the rest to be set by parameters.
Options that set a number or pick one choice from a set use the adjust_up and adjust_down functions.
Submenus and toggle options use the func function.
Also, each player has their own separate menu. Which allows one player to set speed mod while the other sets turn or insert mods (which Simply Love puts on different screens).