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

Tile Set

This class represents the tile set using on the TileLayer class, exposing access to important information such as tile types, rect of a particular tile type, which image file is being used or the image size, among others.

For more information, see: TileLayer documentation page.

Watch out!

The TileSet class cannot be instantiated by itself, it is required to be retrieved using the TileLayer class.

Watch out!

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

New

Using the TileLayer's tile set method we can access instance of this class:

tile_layer.tile_set
More intel!

Each TileLayer instance can have a different tile set.

First Tile Type

Gets or sets the first tile type in the TileSet:

tile_set.first_tile_type = 12

# The following is 12
tile_set.first_tile_type

Image File Name

Retrieves or updates the TileSet's image name:

tile_set.image_file_name = 'space_tile_set.png'

p "The image file name is: #{tile_set.image_file_name}"

Image Size

Gets or sets the TileSet's image size:

tile_set.image_size = [1024, 768]

# The following is [1024, 768]
tile_set.image_size

Tile Offset

Retrieves or updates the tile offset:

tile_set.tile_offset = [1, 1]

# The following is [1, 1]
tile_set.tile_offset

Spacing

Gets or sets the spacing between tiles:

tile_set.spacing = 2

p "The spacing is: #{tile_set.spacing}"

Margin

Retrieves or updates the margin of the TileSet's tiles:

tile_set.margin = 1

p "The margin is: #{tile_set.margin}"

Anchor Point

Returns the anchor point of the TileSet:

p "The anchor point is: #{tile_set.anchor_point}"

Rect for Tile Type

Retrieves the rect for a particular tile type in the TileSet:

tile_type = 12

tile_set.rect_for_tile_type(tile_type)

Tile Size

Returns the size of a Tile:

p "The size of a tile is: #{tile_set.tile_size.width}, #{tile_set.tile_size.height}"
Level Up!

This method is optimized for Retina Display.