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

SUPPORT CLASSES

Array

The RubyMotion class with some support methods to make conversions between the Array and the Core Graphics structures.

More intel!

All of the Joybox's methods are allowed to receive arrays as Points, Sizes or Rects.

To Point

When the array contains exactly two numbers, it will return a CGPoint with the X value as the first number and the Y value as the second number:

position = [10, 10].to_point

p "The position is: #{position.x}, #{position.y}"

To Size

If the array contains exactly two numbers, it can be converted into a Size with the Width value as the first number and the Height Value as the second number:

size = [200, 200].to_point

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

To Rect

The array needs exactly four numbers to do a conversion into a Rect with the first number as X, the second as Y, the third as Width and finally the fourth as Height:

box = [0, 0, 200, 200]

p "The box is: #{box.origin.x}, #{box.origin.y}, #{box.size.width}, #{box.size.height}"