Tools for working with tiles.
A tile represents a 1 unit2 on a surface in Factorio.
local Tile = require('__stdlib__/stdlib/area/tile')
from_position() | Get the tile position of a tile where the given position resides. |
to_area() | Converts a tile position to the area of the tile it is in. |
adjacent(surface, position[, diagonal=false][, tile_name]) | Creates an array of tile positions for all adjacent tiles (N, E, S, W) OR (N, NE, E, SE, S, SW, W, NW) if diagonal is set to true. |
get_data(surface, tile_pos[, default_value]) | Gets the user data that is associated with a tile. |
set_data(surface, tile_pos, value) | Associates the user data to a tile. |
Get the tile position of a tile where the given position resides.
See also:
Converts a tile position to the area of the tile it is in.
See also:
Creates an array of tile positions for all adjacent tiles (N, E, S, W) OR (N, NE, E, SE, S, SW, W, NW) if diagonal is set to true.
Parameters:
Gets the user data that is associated with a tile.
The user data is stored in the global object and it persists between loads.
Parameters:Associates the user data to a tile.
The user data will be stored in the global object and it will persist between loads.
Parameters: