API Docs for: 0.1.1
Show:

flatworld.extensions.fogOfWars.extensions.hexagons.utils Class

This manages some utility functionalities for creating hexagons

Item Index

Methods

coordsToPixiPoints

(
  • radius
)
Array private static

Converts Array of x- and y-coordinates to new PIXI.Point coordinates

Parameters:

  • radius Number

    Hexagons radius

Returns:

Array:

Array of PIXI.Point coordinates

createHexagon

(
  • radius
  • {}
)
PIXI.Polygon private static

Credits belong to: https://github.com/alforno-productions/HexPixiJs/blob/master/lib/hexPixi.js Creates a hex shaped polygon that is used for the hex's hit area.

Parameters:

  • radius Number

    Radius of the hexagon

  • {} Object

    OPTIONAL

    • orientation Object

      Is the heaxgon grid horizontal or vertical. Default: 'horizontal"

Returns:

PIXI.Polygon:

Hexagon shaped PIXI.Polygon object. That houses the hexagons corner points.

createVisibleHexagon

(
  • radius
  • options
)
PIXI.Graphics private static

Parameters:

  • radius Number

    Radius of the hexagon

  • options Object

    Options, such as: color: The fill color of the hexagon isFlatTop (Boolean), is the heaxgon flat-topped

Returns:

PIXI.Graphics:

Graphics object that is shaped as hexagon, based on given radius and options.