Functions for working with directions and orientations.
local Direction = require('__stdlib__/stdlib/area/direction')
opposite(direction) | Returns the opposite direction |
next(direction[, eight_way=false]) | Returns the next direction. |
previous(direction[, eight_way=false]) | Returns the previous direction. |
to_orientation(direction) | Returns an orientation from a direction. |
to_vector(direction, distance) | Returns a vector from a direction. |
north | defines.direction.north |
east | defines.direction.east |
west | defines.direction.west |
south | defines.direction.south |
northeast | defines.direction.northeast |
northwest | defines.direction.northwest |
southeast | defines.direction.southeast |
southwest | defines.direction.southwest |
Returns the opposite direction
Parameters:
Returns the next direction.
Parameters:For entities that only support two directions, see opposite.
Returns the previous direction.
Parameters:For entities that only support two directions, see opposite.
Returns an orientation from a direction.
Parameters:
Returns a vector from a direction.
Parameters: