struct Bounds (Niantic.ARDK.Extensions.Gameboard.Bounds)

Overview

Specifies an area in a top-down 2D grid using a square. More...

struct Bounds: IEquatable< Bounds > {
    // fields

    readonly int Size;

    // properties

    Vector2Int BottomLeft;
    Vector2Int BottomRight;
    Vector2Int Center;
    Vector2Int TopLeft;
    Vector2Int TopRight;

    // methods

    Bounds(Vector2Int bottomLeft, int size);
    bool ContainsPoint(Vector2Int point);
    void DrawGizmos(float unitSize, Color color);
    bool Equals(Bounds other);
    override bool Equals(object obj);
    override int GetHashCode();
    bool Intersects(Bounds other);
};

Detailed Documentation

Specifies an area in a top-down 2D grid using a square.

Fields

readonly int Size

The size of each side.

Properties

Vector2Int BottomLeft

Returns the bottom left corner point (this is also the anchor of this square).

Vector2Int BottomRight

Returns the bottom right corner point.

Vector2Int Center

Returns the center of the square.

Vector2Int TopLeft

Returns the top left corner point.

Vector2Int TopRight

Returns the top right corner point.

Methods

bool ContainsPoint(Vector2Int point)

Returns true if the specified point is within bounds.

bool Intersects(Bounds other)

Returns true if the specified bounds overlap with this one.