SDF-2D - v0.8.0
    Preparing search index...
    • Creates a drawable hexagon class with a shared color.

      Parameters

      Returns typeof HexagonBase

      A class with constructor new Hexagon(center: vec2, radius: number). center is the position in world coordinates; radius controls the size in world units. Pass the class's static descriptor to compile!compile, then pass instances to graphics/rendering/renderer/renderer!Renderer.addDrawable.

      import { HexagonFactory } from 'sdf-2d';

      const Hexagon = HexagonFactory([1, 0.5, 0]);
      const hexagon = new Hexagon([160, 120], 30);