Static methods

@:value({ start_index : 1, offset_y : 0, offset_x : 0 })staticgenerate(data:Array<Int>, tile_width:Int, tile_height:Int, width_in_tiles:Int, height_in_tiles:Int, offset_x:Float = 0, offset_y:Float = 0, start_index:Int = 1, ?shapes:Array<TileShape>, ?ignore:Array<Int>, ?material:Material):Array<Body>

Generates an optimized Array of Bodies from an Array of Ints representing a TileMap.

Parameters:

data

The Array of Ints that make up the TileMap

tile_width

The Width of each Tile in the TileMap

tile_height

The Height of each Tile in the TileMap

width_in_tiles

The Width of the TileMap (Measured in Tiles)

height_in_tiles

The Height of the TileMap (Measured in Tiles)

offset_x

The Offset applied to the X Position of each generated Body

offset_y

The Offset applied to the Y Position of each generated Body

start_index

The Index that designates which tiles are collidable. Must be larger than -1.

Returns:

Array

@:value({ start_index : 1, offset_y : 0, offset_x : 0 })staticgenerate_grid(data:Array<Int>, tile_width:Int, tile_height:Int, width_in_tiles:Int, height_in_tiles:Int, offset_x:Float = 0, offset_y:Float = 0, start_index:Int = 1, ?material:Material):Array<Body>

Generates an Array of Bodies from an Array of Ints representing a TileMap.

Parameters:

data

The Array of Ints that make up the TileMap

tile_width

The Width of each Tile in the TileMap

tile_height

The Height of each Tile in the TileMap

width_in_tiles

The Width of the TileMap (Measured in Tiles)

height_in_tiles

The Height of the TileMap (Measured in Tiles)

offset_x

The Offset applied to the X Position of each generated Body

offset_y

The Offset applied to the Y Position of each generated Body

start_index

The Index that designates which tiles are collidable

Returns:

Array