Class HexTransform
A transform representing the size and position of a hexagon
Inheritance
Inherited Members
Namespace: Ladybug
Assembly: ladybug.dll
Syntax
public class HexTransform
Constructors
| Improve this Doc View SourceHexTransform(Rectangle, HexOrientation)
Create a HexTransform with given bounds and orientation
Declaration
public HexTransform(Rectangle bounds, HexOrientation orientation = HexOrientation.Point)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Xna.Framework.Rectangle | bounds | |
HexOrientation | orientation |
Properties
| Improve this Doc View SourceBounds
Bounds of the HexTransform
Declaration
public Rectangle Bounds { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Xna.Framework.Rectangle |
Location
Location of the HexTransform
Declaration
public Vector2 Location { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Xna.Framework.Vector2 |
Orientation
Orientation of the HexTransform
Declaration
public HexOrientation Orientation { get; set; }
Property Value
Type | Description |
---|---|
HexOrientation |
Size
Size of the HexTransform
Declaration
public Vector2 Size { get; set; }
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
Methods
| Improve this Doc View SourceBoundsToSize(Vector2, HexOrientation)
Convert a Vector2 representing the outer rectangular width and height of a HexTransform to a Vector2 representing the inner size value of the HexTransform
Declaration
public static Vector2 BoundsToSize(Vector2 bounds, HexOrientation orientation)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Xna.Framework.Vector2 | bounds | |
HexOrientation | orientation |
Returns
Type | Description |
---|---|
Microsoft.Xna.Framework.Vector2 |
Remarks
A hexagon's size value represents the distance from the center to one of its corners
Contains(Vector2)
Check if the given point is within this HexTransform's hexagonal bounds
Declaration
public bool Contains(Vector2 point)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Xna.Framework.Vector2 | point |
Returns
Type | Description |
---|---|
System.Boolean |
SizeToBounds(Vector2, HexOrientation)
Convert a Vector2 representing the inner size value of a HexTransform to a Vector2 representing its outer rectangular width and height
Declaration
public static Vector2 SizeToBounds(Vector2 size, HexOrientation orientation)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Xna.Framework.Vector2 | size | |
HexOrientation | orientation |
Returns
Type | Description |
---|---|
Microsoft.Xna.Framework.Vector2 |
Remarks
A hexagon's size value represents the distance from the center to one of its corners