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

The Menu class is responsible for building grids of MenuLabel and MenuImage items.

For more information about MenuLabel, see: Menu Label Documentation page.

For more information about MenuImage, see: Menu Image Documentation page.

New

Creates a new instance of the Menu class:

items = Array.new
items << MenuLabel.new text: 'Space Ship'
items << MenuLabel.new text: 'Asteroid'

menu = Menu.new position: [100, 100], items: items

Align Items Vertically

Adjusts the menu items vertically:

menu.align_items_vertically

Align Items Vertically with Padding

Aligns the menu items vertically with padding:

menu.align_items_vertically_with_padding 100

Align Items Horizontally

Adjusts the menu items horizontally:

menu.align_items_horizontally

Align Items Horizontally with Padding

Arranges the menu items horizontally with padding:

menu.align_items_horizontally_with_padding 100

Align Items in Columns

Aligns the menu items in columns:

menu.align_items_in_columns [2, 1]

The previous example arranges two items in the first column and one in the second column.

Align Items in Rows

Arranges the menu items in rows:

menu.align_items_in_rows [1, 2]

The previous example aligns one item in the first row and two in the second.