Menu

object Menu

Menu

An interface of the menu which appears when right-clicking in the game. An example f this menu is:

  • Walk here

  • Examine Tree

  • Drop Coins

Types

TextFilter
Link copied to clipboard
class TextFilter(action: String?, option: String?) : Filter<MenuCommand>

Functions

bounds
Link copied to clipboard
fun bounds(): Rectangle

The dimensions of the menu bounds.

click
Link copied to clipboard
fun click(filter: (MenuCommand) -> Boolean): Boolean
fun click(filter: Filter<MenuCommand>): Boolean

Attempts to click the menu command provided by the filter.

close
Link copied to clipboard
fun close(): Boolean

Attempts to close the menu.

commands
Link copied to clipboard
fun commands(): Array<MenuCommand>

Returns an array of the current menu commands available.

contains
Link copied to clipboard
fun contains(filter: (MenuCommand) -> Boolean): Boolean
fun contains(filter: Filter<MenuCommand>): Boolean

Checks if the menu contains any MenuCommand matching the filter.

containsAction
Link copied to clipboard
fun containsAction(action: String): Boolean

Checks if the menu contains the specified action.

count
Link copied to clipboard
fun count(): Int
filter
Link copied to clipboard
fun filter(action: String?): Menu.TextFilter
fun filter(action: String?, option: String?): Menu.TextFilter
indexOf
Link copied to clipboard
fun indexOf(filter: Filter<MenuCommand>): Int

Provides the index of the menu command given the specified filter.

items
Link copied to clipboard
fun items(): Array<String>

Returns an array of all the current menu items (action_1 option_1, action_2 option_2, ...).

opened
Link copied to clipboard
fun opened(): Boolean

Whether or not the menu is opened.