Tilemap

A fixed-size grid of tiles that can be queried

Constructors

this
this(in int mapWidth, in int mapHeight, in int size)

Create a tilemap with a given unit width and height and the units for the size of each tile square

Members

Functions

destroy
void destroy()

Free the underlying tilemap memory

empty
bool empty(in float x, in float y)

Checks if a point is both valid and empty

empty
bool empty(in Vector vec)

Checks if a point is both valid and empty

empty
bool empty(in float x, in float y, in float width, in float height)

Checks if a region is both valid and empty

empty
bool empty(in Rectangle rect)

Checks if a region is both valid and empty

opIndex
Tile!T opIndex(in float x, in float y)

Get a tile from a location

opIndex
Tile!T opIndex(in Vector vec)

Get a tile from a location

opIndexAssign
Tile!T opIndexAssign(in Tile!T tile, in float x, in float y)

Set a tile from a location

opIndexAssign
Tile!T opIndexAssign(in Tile!T tile, in Vector vec)

Set a tile from a location

slideContact
Vector slideContact(in float x, in float y, in float width, in float height, in Vector v)

Determine the furthest a region can move without hitting a wall

slideContact
Vector slideContact(in Rectangle rect, in Vector vec)

Determine the furthest a region can move without hitting a wall

valid
bool valid(in float x, in float y)

Checks if a point falls within a tilemap

valid
bool valid(in Vector vec)

Checks if a point falls within a tilemap

Properties

height
int height [@property getter]

The height of the map in units

tileSize
int tileSize [@property getter]

The size of a tile in units (both width and height)

width
int width [@property getter]

The width of the map in units

Meta