Vector2.Clamp Method (Vector2, Vector2, Vector2)
Restricts a value to be within a specified range.
Syntax
'Declaration
Public Shared Function Clamp ( _
value1 As Vector2, _
min As Vector2, _
max As Vector2 _
) As Vector2
public static Vector2 Clamp (
Vector2 value1,
Vector2 min,
Vector2 max
)
public:
static Vector2 Clamp(
Vector2 value1,
Vector2 min,
Vector2 max
)
Parameters
- value1
Type: Vector2
The value to clamp. - min
Type: Vector2
The minimum value. - max
Type: Vector2
The maximum value.
Return Value
Type: Vector2
The clamped value.
Requirements
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
See Also
Reference
Vector2 Structure
Vector2 Members
Microsoft.Xna.Framework Namespace
Platforms
Windows Phone