Documentation

WHAT WE GOT

AABB
Physics Environment

Animation
Actions & Animations

Array
Support Classes

Audio
Sounds & Music

Audio Effect
Sounds & Music

Background Audio
Sounds & Music

Bezier
Actions & Animations

Blink
Actions & Animations

Body
Physics Environment

Callback
Actions & Animations

Chain Shape
Physics Environment

Circle Shape
Physics Environment

Color
Support Classes

Delay
Actions & Animations

Device
Support Classes

Director
Essentials

Ease
Actions & Animations

Edge Shape
Physics Environment

Event
Support Classes

Fade
Actions & Animations

Filter
Physics Environment

Fixture
Physics Environment

Jump
Actions & Animations

Label
User Interface

Layer
Essentials

Layer Color
Essentials

Liquid
Actions & Animations

Mass Data
Physics Environment

Menu
User Interface

Menu Image
User Interface

Menu Label
User Interface

Move
Actions & Animations

Numeric
Support Clases

Object Layer
Tiled Maps

Physics Sprite
Physics Environment

Place
Actions & Animations

Point
Support Classes

Polygon Shape
Physics Environment

Repeat
Actions & Animations

Rotate
Actions & Animations

Scale
Actions & Animations

Scene
Essentials

Screen
Support Classes

Sequence
Actions & Animations

Shape
Physics Environment

Shuffle
Actions & Animations

Size
Support Classes

Skew
Actions & Animations

Spawn
Actions & Animations

Split
Actions & Animations

Sprite
Essentials

Sprite Batch
Essentials

Sprite Frame Cache
Essentials

Tile Layer
Tiled Maps

Tile Map
Tiled Maps

Tile Set
Tiled Maps

Tint
Actions & Animations

Touch
Support Classes

Turn
Actions & Animations

Twirl
Actions & Animations

Visibility
Actions & Animations

Wave
Actions & Animations

Wiggle
Actions & Animations

World
Physics Environment

USER INTERFACE

Menu Label

The Menu Label class represents a menu item with a label. To present an instance of this class on the Screen it is recommended to use the Menu class.

For more information, see: Menu documentation page.

New

Creates a new instance of the MenuLabel class:

menu = MenuLabel.new text: 'Start the Game!' do |menu_item|
    # This block is called when the Menu Label is selected  
end

Options

color: - Color - Default: White
Sets the ManuLabel's text color.

position: - Point - Default: None
The position of the menu label on the screen, if not provided it will be determined by the Menu.

font_name: - String - Default: 'Marker Felt'
Sets the name of the font to be used to render the text.

More intel!

All the device's fonts are supported, either OSX or iOS.

font_size: - Integer - Default: 12
The size of the font to be render.

Default Font Name

Retrieves or updates the default font name for all the Menu Label instances:

MenuLabel.default_font_name = 'Helvetica'

# The following is Helvetica
MenuLabel.default_font_name

Default Font Size

Gets or sets the default font size for all the MenuLabel instances:

MenuLabel.default_font_size = 24

# The following is 24
MenuLabel.default_font_size

Font Name

Gets or sets the font name of the MenuLabel instance:

menu_label.font_name = 'Marker Felt'

# The following is Marker Felt
menu_label.font_name

Font Size

Retrieves or updates the font size of the MenuLabel instance:

menu_label.font_size = 14

# The following is 14
menu_label.font_size

Text

Gets or sets the MenuLabel's text:

menu_label.text = 'Mothership Scores'

p "The menu label text is: #{menu_label.text}"