1.0.0 • Published 5 years ago
tiled-geometry v1.0.0
Tiled Geometry
Utilities for 2-D tiled geometry
This library contains several useful functions and classes for dealing with 2-D tiled geometry.
Installation
npm install tiled-geometryAPI
Constants and utlities for 2-D tiled coordinate spaces:
Direction- constants for eight compass directionsTurn- constants for rotation among eight compass directionsCardinalDirection- constants for four cardinal directionsCardinalTurn- constants for rotation among four cardinal directionsCardinalDirectionFlags- bitmask constants for four cardinal directionsFlip- constants for mirroring the coordinate spaceCardinalOrientation- constants combining CardinalDirection and FlipAxis- constants for the two major axes
Classes for coordinates, shapes, masks, and more:
Offset- a location or relative offsetSize- a two-dimensional extentRectangle- a rectangle (with offset and size)Mask- a rectangular area with boolean values for each cellMaskRectangle- a mask with an offsetRasterMask- a mask encoded as "raster lines"CardinalPath- a path on the grid, moving only in the four cardinal directionsTransformRectangle- maps a rectangular area onto a grid with transformations
1.0.0
5 years ago