Class: MG::Menu

Inherits:
Object
  • Object
show all
Defined in:
doc/API_reference.rb

Overview

This is usually in the form of buttons that are pressed.

Instance Method Summary collapse

Instance Method Details

#align_items_horizontally(padding = null) ⇒ self

aligns menu items horizontally with padding (call after adding items via image_item)

Parameters:

  • padding (Float) (defaults to: null)

    the amount of padding between the items.

Returns:

  • (self)

    the receiver.



671
# File 'doc/API_reference.rb', line 671

def align_items_horizontally(padding=null); end

#align_items_vertically(padding = null) ⇒ self

aligns menu items vertically with padding (call after adding items via image_item)

Parameters:

  • padding (Float) (defaults to: null)

    the amount of padding between the items.

Returns:

  • (self)

    the receiver.



665
# File 'doc/API_reference.rb', line 665

def align_items_vertically(padding=null); end

#enabled=(value) ⇒ Object

Enable or disable a menu item.

Parameters:

  • value (Boolean)

    true if enable an item.



680
# File 'doc/API_reference.rb', line 680

def enabled=(value); end

#enabled?Boolean

Whether the menu is enabled. When enabled, a menu can be touched or clicked. By default, a menu is enabled.

Returns:

  • (Boolean)

    whether the menu is enabled.



676
# File 'doc/API_reference.rb', line 676

def enabled?; end

#image_item(normal_image, selected_image) { ... } ⇒ self

Create a menu item with a normal and selected images.

Parameters:

  • normal_image (String)

    normal image name.

  • selected_image (String)

    selected image name.

Yields:

  • The methods to call when tapped menu.

Returns:

  • (self)

    the receiver.



687
# File 'doc/API_reference.rb', line 687

def image_item(normal_image, selected_image); end