Generated by DocFX

Class HexGrid

A two-dimensional grid of HexTransforms

Inheritance
System.Object
HexGrid
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Ladybug
Assembly: ladybug.dll
Syntax
public class HexGrid

Constructors

| Improve this Doc View Source

HexGrid(HexOrientation, HexOffset)

Create a HexGrid

Declaration
public HexGrid(HexOrientation orientation = HexOrientation.Point, HexOffset offset = HexOffset.Odd)
Parameters
Type Name Description
HexOrientation orientation
HexOffset offset

Properties

| Improve this Doc View Source

Dimensions

The dimensions of the grid represented by row/column count

Declaration
public Vector2 Dimensions { get; }
Property Value
Type Description
Microsoft.Xna.Framework.Vector2
| Improve this Doc View Source

Grid

Contents of the HexGrid

Declaration
public HexTransform[, ] Grid { get; }
Property Value
Type Description
HexTransform[,]
| Improve this Doc View Source

HexSize

The size of the HexTransforms contained in this grid

Declaration
public Vector2 HexSize { get; }
Property Value
Type Description
Microsoft.Xna.Framework.Vector2
Remarks

A hexagon's size value represents the distance from the center to one of its corners

| Improve this Doc View Source

Offset

The alternating-row offset method of the HexGrid

Declaration
public HexOffset Offset { get; }
Property Value
Type Description
HexOffset
| Improve this Doc View Source

Orientation

Orientation of the HexTransforms within the HexGrid

Declaration
public HexOrientation Orientation { get; }
Property Value
Type Description
HexOrientation
| Improve this Doc View Source

Origin

The positional origin of the grid

Declaration
public Vector2 Origin { get; }
Property Value
Type Description
Microsoft.Xna.Framework.Vector2

Methods

| Improve this Doc View Source

Generate()

Build the HexGrid

Declaration
public HexGrid Generate()
Returns
Type Description
HexGrid
| Improve this Doc View Source

HexToPixel(Hex)

Get the pixel position of the given hex within this grid

Declaration
public Vector2 HexToPixel(Hex hx)
Parameters
Type Name Description
Hex hx
Returns
Type Description
Microsoft.Xna.Framework.Vector2
| Improve this Doc View Source

PixelToHex(Vector2)

Get the hex within this grid which lies at the given position

Declaration
public Hex PixelToHex(Vector2 px)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 px
Returns
Type Description
Hex
| Improve this Doc View Source

WithDimensions(Vector2)

Set the dimensions of this HexGrid by row/column count

Declaration
public HexGrid WithDimensions(Vector2 dimensions)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 dimensions
Returns
Type Description
HexGrid
| Improve this Doc View Source

WithDimensions(Int32, Int32)

Set the dimensions of this HexGrid by row/column count

Declaration
public HexGrid WithDimensions(int x, int y)
Parameters
Type Name Description
System.Int32 x
System.Int32 y
Returns
Type Description
HexGrid
| Improve this Doc View Source

WithHexBounds(Vector2)

Set the bounds of the HexTransforms within this HexGrid

Declaration
public HexGrid WithHexBounds(Vector2 bounds)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 bounds
Returns
Type Description
HexGrid
| Improve this Doc View Source

WithHexBounds(Int32, Int32)

Set the bounds of the HexTransforms within this HexGrid

Declaration
public HexGrid WithHexBounds(int x, int y)
Parameters
Type Name Description
System.Int32 x
System.Int32 y
Returns
Type Description
HexGrid
| Improve this Doc View Source

WithHexSize(Vector2)

Set the size of the HexTransforms within this HexGrid

Declaration
public HexGrid WithHexSize(Vector2 size)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 size
Returns
Type Description
HexGrid
Remarks

A hexagon's size value represents the distance from the center to one of its corners

| Improve this Doc View Source

WithHexSize(Int32, Int32)

Set the size of the HexTransforms within this HexGrid

Declaration
public HexGrid WithHexSize(int x, int y)
Parameters
Type Name Description
System.Int32 x
System.Int32 y
Returns
Type Description
HexGrid
Remarks

A hexagon's size value represents the distance from the center to one of its corners

| Improve this Doc View Source

WithOrigin(Vector2)

Set the origin of this HexGrid

Declaration
public HexGrid WithOrigin(Vector2 origin)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 origin
Returns
Type Description
HexGrid
| Improve this Doc View Source

WithOrigin(Int32, Int32)

Set the origin of this HexGrid

Declaration
public HexGrid WithOrigin(int x, int y)
Parameters
Type Name Description
System.Int32 x
System.Int32 y
Returns
Type Description
HexGrid