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()
Assembly: ladybug.dll
Syntax
Constructors
|
Improve this Doc
View Source
HexGrid(HexOrientation, HexOffset)
Declaration
public HexGrid(HexOrientation orientation = HexOrientation.Point, HexOffset offset = HexOffset.Odd)
Parameters
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
Declaration
public HexTransform[, ] Grid { get; }
Property Value
|
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 |
|
|
Improve this Doc
View Source
Offset
The alternating-row offset method of the HexGrid
Declaration
public HexOffset Offset { get; }
Property Value
|
Improve this Doc
View Source
Orientation
Orientation of the HexTransforms within the HexGrid
Declaration
public HexOrientation Orientation { get; }
Property Value
|
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()
Declaration
public HexGrid Generate()
Returns
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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