Documentation ¶
Overview ¶
Package tile provides utility functions for hexagon tile maps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var HexDirs = []image.Point{{-1, -1}, {0, -1}, {1, 0}, {1, 1}, {0, 1}, {-1, 0}}
Functions ¶
func HexCirclePoint ¶
HexCirclePoint returns a point along the edge of a radius sized hexagon tile "circle" specified by windingIndex. The HexCircumference(radius) consecutive clockwise points on the circle are denoted by consecutive windingIndex values.
func HexCircumference ¶
HexCircumference returns the number of distinct hexagons at exactly radius distance from origin.
func HexVecToDir ¶
HexVecToDir returns the unit length hex direction that matches the given hex coordinate vector best.
func HexWallType ¶
HexWallType returns the wall tile offset base on the binary mask built from its six neighboring walls. The mask starts at the neighbor at (-1, -1) at bit 0, and proceeds to the rest of the neighbors clockwise from there.
A bit 1 indicates a wall-type tile at that neighbor position. The result value is between 0 and 3:
0: Pillar (o) 1: x-axis wall (\) 2: y-axis wall (/) 3: xy-diagonal wall (|)
func IsoWallType ¶
Types ¶
This section is empty.