Interface IMask
A mask is basically a 2D array of booleans, usually representing an area on the screen.
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
public interface IMask
Properties
| Improve this Doc View SourceDebugDraw
When loading the mask there's an option for drawing the mask on the screen, for debugging purposes.
Declaration
IObject DebugDraw { get; }
Property Value
Type | Description |
---|---|
IObject | The debug draw. |
Height
Gets the height.
Declaration
int Height { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The height. |
MaxX
The maximum X with a "masked" (i.e a true) value.
Declaration
float MaxX { get; }
Property Value
Type | Description |
---|---|
System.Single | The max x. |
MaxY
The maximum Y with a "masked" (i.e a true) value.
Declaration
float MaxY { get; }
Property Value
Type | Description |
---|---|
System.Single | The max y. |
MinX
The minimum X with a "masked" (i.e a true) value.
Declaration
float MinX { get; }
Property Value
Type | Description |
---|---|
System.Single | The minimum x. |
MinY
The minimum Y with a "masked" (i.e a true) value.
Declaration
float MinY { get; }
Property Value
Type | Description |
---|---|
System.Single | The minimum y. |
Width
Gets the width.
Declaration
int Width { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The width. |
Methods
| Improve this Doc View SourceApplyToMask(Boolean[][], Point)
Adds the current mask to the target specified mask (i.e all true values in the current mask will be set to true in the target mask).
Declaration
void ApplyToMask(bool[][] mask, Point offset)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean[][] | mask | Mask. |
Point | offset | The offset of the mask from the (0,0) co-ordinate |
AsJaggedArray()
Returns the mask as a jagged array (https://msdn.microsoft.com/en-us/library/2s05feca.aspx).
Declaration
bool[][] AsJaggedArray()
Returns
Type | Description |
---|---|
System.Boolean[][] | The jagged array. |
DebugString()
Returns a display string with the mask contents as asterisks, for debugging purposes.
Declaration
string DebugString()
Returns
Type | Description |
---|---|
System.String | The string. |
IsMasked(PointF)
Is the specific point masked (i.e has a true value in the 2D array)?
Declaration
bool IsMasked(PointF point)
Parameters
Type | Name | Description |
---|---|---|
PointF | point | Point. |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsMasked(PointF, AGSBoundingBox, Single, Single)
Is the specific point masked after projecting the mask on the specified square?
Declaration
bool IsMasked(PointF point, AGSBoundingBox projectionBox, float scaleX, float scaleY)
Parameters
Type | Name | Description |
---|---|---|
PointF | point | Point. |
AGSBoundingBox | projectionBox | Projection box. |
System.Single | scaleX | The projection box x scaling (is only needed to know if the projection box is flipped horizontally). |
System.Single | scaleY | The projection box y scaling (is only need to know if the projection box is flipped vertically). |
Returns
Type | Description |
---|---|
System.Boolean |
|
To2DArray()
Copies the mask to a 2D array and returns it.
Declaration
bool[, ] To2DArray()
Returns
Type | Description |
---|---|
System.Boolean[,] | The DA rray. |
Transform(Matrix4)
Transform the mask (by moving and/or rotating it).
Declaration
void Transform(Matrix4 matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix4 | matrix | The transform matrix. |