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 Image

The Menu Image class represents a menu item with an image as background. To present an instance of this class on the Screen is recommended to use the Menu class.

For more information, see: Menu documentation page.

More intel!

Internally the Menu Image class renders its image as a Sprite.

New

Returns a new instance of the MenuImage class:

menu_image = MenuImage.new image_file_name: 'start_game.png',
                                                     selected_image_file_name: 'start_game_selected.png',
                                                     disabled_image_file_name: 'start_game_disabled.png' do |menu_item|
    # This block is called when the Menu Item is selected
end

Options

position: - Point
Sets the position of the MenuImage, if not provided it will be determined by the Menu.

Sprite

Gets the Sprite assigned to the MenuImage normal state:

menu_item.sprite

Selected Sprite

Retrieves the Sprite assigned to the MenuImage selected state:

menu_item.selected_sprite

Disabled Sprite

Gets the MenuImage's disable sprite:

menu_item.disabled_sprite

Content Size

Retrieves the content size of the MenuImage instance:

p "The content size is: #{menu_item.content_size.width}, #{menu_item.content_size.height}"