Struct AGSBoundingBox
A bounding box (a square that bounds something)- used for rendering and hit-tests.
Inherited Members
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
public struct AGSBoundingBox
Constructors
| Improve this Doc View SourceAGSBoundingBox(Vector2, Vector2, Vector2, Vector2)
Initializes a new instance of the AGSBoundingBox struct.
Declaration
public AGSBoundingBox(Vector2 bottomLeft, Vector2 bottomRight, Vector2 topLeft, Vector2 topRight)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | bottomLeft | Bottom left. |
Vector2 | bottomRight | Bottom right. |
Vector2 | topLeft | Top left. |
Vector2 | topRight | Top right. |
AGSBoundingBox(Vector3, Vector3, Vector3, Vector3)
Initializes a new instance of the AGSBoundingBox struct.
Declaration
public AGSBoundingBox(Vector3 bottomLeft, Vector3 bottomRight, Vector3 topLeft, Vector3 topRight)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | bottomLeft | Bottom left. |
Vector3 | bottomRight | Bottom right. |
Vector3 | topLeft | Top left. |
Vector3 | topRight | Top right. |
AGSBoundingBox(Single, Single, Single, Single)
Declaration
public AGSBoundingBox(float minX, float maxX, float minY, float maxY)
Parameters
Type | Name | Description |
---|---|---|
System.Single | minX | |
System.Single | maxX | |
System.Single | minY | |
System.Single | maxY |
Properties
| Improve this Doc View SourceBottomLeft
Gets the bottom left point.
Declaration
public Vector3 BottomLeft { get; }
Property Value
Type | Description |
---|---|
Vector3 | The bottom left point. |
BottomRight
Gets the bottom right point.
Declaration
public Vector3 BottomRight { get; }
Property Value
Type | Description |
---|---|
Vector3 | The bottom right point. |
Height
Gets the height.
Declaration
public float Height { get; }
Property Value
Type | Description |
---|---|
System.Single | The height. |
IsValid
Gets a value indicating whether this AGSBoundingBox is invalid (i.e max is not bigger than min).
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
MaxX
Gets the maximum x of the square.
Declaration
public float MaxX { get; }
Property Value
Type | Description |
---|---|
System.Single | The max x. |
MaxY
Gets the maximum y of the square.
Declaration
public float MaxY { get; }
Property Value
Type | Description |
---|---|
System.Single | The max y. |
MinX
Gets the minimum x of the square.
Declaration
public float MinX { get; }
Property Value
Type | Description |
---|---|
System.Single | The minimum x. |
MinY
Gets the minimum y of the square.
Declaration
public float MinY { get; }
Property Value
Type | Description |
---|---|
System.Single | The minimum y. |
TopLeft
Gets the top left point.
Declaration
public Vector3 TopLeft { get; }
Property Value
Type | Description |
---|---|
Vector3 | The top left point. |
TopRight
Gets the top right point.
Declaration
public Vector3 TopRight { get; }
Property Value
Type | Description |
---|---|
Vector3 | The top right point. |
Width
Gets the width.
Declaration
public float Width { get; }
Property Value
Type | Description |
---|---|
System.Single | The width. |
Methods
| Improve this Doc View SourceContains(Vector2)
Is the specified point contained in the square?
Declaration
public bool Contains(Vector2 point)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | point | Point. |
Returns
Type | Description |
---|---|
System.Boolean | True if the point is in the square, false otherwise. |
Crop(BoundingBoxType, ICropSelfComponent, PointF)
Create a cropped bounding box.
Declaration
public AGSCropInfo Crop(BoundingBoxType boundingBoxType, ICropSelfComponent crop, PointF adjustedScale)
Parameters
Type | Name | Description |
---|---|---|
BoundingBoxType | boundingBoxType | The type of the bounding box to be cropped. |
ICropSelfComponent | crop | Crop. |
PointF | adjustedScale | Adjusted scale. |
Returns
Type | Description |
---|---|
AGSCropInfo | The crop info. |
Equals(AGSBoundingBox)
Declaration
public bool Equals(AGSBoundingBox square)
Parameters
Type | Name | Description |
---|---|---|
AGSBoundingBox | square |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
FlipHorizontal()
Create a new square which is flipped horizontally from the current square.
Declaration
public AGSBoundingBox FlipHorizontal()
Returns
Type | Description |
---|---|
AGSBoundingBox | The new flipped square. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
Multiply(Single, Single)
Multiply the box limits with the specified factorX and factorY.
Declaration
public AGSBoundingBox Multiply(float factorX, float factorY)
Parameters
Type | Name | Description |
---|---|---|
System.Single | factorX | Factor x. |
System.Single | factorY | Factor y. |
Returns
Type | Description |
---|---|
AGSBoundingBox | The new multiplied box. |
SameSize(AGSBoundingBox)
Is the given box the same size as this box?
Declaration
public bool SameSize(AGSBoundingBox box)
Parameters
Type | Name | Description |
---|---|---|
AGSBoundingBox | box | Box. |
Returns
Type | Description |
---|---|
System.Boolean |
|
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |