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

TILED MAPS

Object Layer

The ObjectLayer class represents a single object layer of the Tiled Map (TMX). The appropriate instances of this class will be created in the TileMap class when the map file is loaded. In order to access a particular instance, see: TileMap documentation page.

Watch out!

The ObjectLayer class cannot be instantiated by itself, it is required to be created using the TileMap class.

Watch out!

In order to use this class is required to include Joybox::TMX.

New

Using the TileMap's Object Layers method we can access instance of this class using its name:

object_layer = tile_map.object_layers[:collisions]
More intel!

The object layer name is set on the TMX Map Editor.

Name

Gets the ObjectLayer's name:

p "The object layer name is: #{object_layer.name}"

Offset

Returns the offset of the ObjectLayer instance:

p "The object layer offset is: #{object_layer.offset.x}, #{object_layer.offset.y}"

Properties

Access the ObjectLayer's properties:

object_layer.properties.keys do |key|
    p "The property #{key} has the value: #{object_layer[key]}"
end
More intel!

The object layer properties are set on the TMX Map Editor.

[]

Retrieves a particular object of the ObjectLayer instance:

object = object_layer[:spawn_point]

object.keys do |key|
    p "The object's key #{key} has a value of #{object[key]}"
end
More intel!

The object's and their names are set on the TMX Map Editor.