Generated by DocFX

Class HexTransform

A transform representing the size and position of a hexagon

Inheritance
System.Object
HexTransform
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 HexTransform

Constructors

| Improve this Doc View Source

HexTransform(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 Source

Bounds

Bounds of the HexTransform

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

Location

Location of the HexTransform

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

Orientation

Orientation of the HexTransform

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

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 Source

BoundsToSize(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

| Improve this Doc View Source

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
| Improve this Doc View Source

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