@studiokeywi/banjo - v0.0.1
    Preparing search index...

    A hexagon is a 6-sided polygon

    Hierarchy

    Index

    Constructors

    • Create a new polygon

      Parameters

      • position: Vector2 = ...

        The location of the polygon

      • ...vertices: Vector2[] & { length: 6 }

        The vertices of the polygon

      Returns Hex

    Accessors

    • get angle(): number

      The angle of this polygon

      Returns number

    • get calculatedVertices(): Vector2[]

      The calculated vertices of this polygon

      Returns Vector2[]

    • get edges(): Vector2[]

      The edges of this polygon

      Returns Vector2[]

    • get normals(): Vector2[]

      The normals of each edge of this polygon

      Returns Vector2[]

    • get offset(): Vector2

      The offset of this polygon

      Returns Vector2

    • get position(): Vector2

      The location of this polygon

      Returns Vector2

    • get vertices(): Vector2[]

      The vertices of this polygon

      Returns Vector2[]

    Methods

    • Rotates the polygon by a given angle

      Parameters

      • radians: number

        The angle to rotate

      Returns this

      This for chaining

    • Sets the angle of the polygon

      Parameters

      • radians: number

        The new angle

      Returns this

      This for chaining

    • Sets the offset of the polygon

      Parameters

      Returns this

      This for chaining

    • Sets the vertices of the polygon

      Parameters

      • ...vertices: Vector2[]

        The new vertices

      Returns this

      This for chaining

    • Translates the polygon by a given vector

      Parameters

      • vector: Vector2

        The translation amount

      Returns this