Rectangle.Contains Method (Microsoft.Xna.Framework)

Gets whether or not the provided coordinates lie within the bounds of this Rectangle.

Namespace: Microsoft.Xna.Framework
Assembly: MonoGame.Framework (MonoGame.Framework.dll 3.8.0.341)
  • C#
  • VB
  • F#
public bool Contains(
	int x, 
	int y
)

Syntax for VB is not yet implemented.

Syntax for F# is not yet implemented.

Parameters

x
Type: System.Int32
The x coordinate of the point to check for containment.
y
Type: System.Int32
The y coordinate of the point to check for containment.

Return Value

Type: System.Boolean
true if the provided coordinates lie inside this Rectangle; false otherwise.
Supported in:

    
 Windows DirectX Desktop
    
 Linux Desktop
    
 Windows OpenGL Desktop
    
 Web