Class RectUtilities
Contains some utility functions related to rects
Namespace: WeaverCore.Utilities
Assembly: WeaverCore.dll
Syntax
public static class RectUtilities
Methods
| Edit this page View SourceClampWithin(Rect, Vector2)
Clamps a point within a rect
Declaration
public static Vector2 ClampWithin(this Rect rect, Vector2 point)
Parameters
| Type | Name | Description |
|---|---|---|
| Rect | rect | The rect to clamp the point within |
| Vector2 | point | The point to clamp |
Returns
| Type | Description |
|---|---|
| Vector2 | Returns the point clamped within the rect |
RandomPointWithin(Rect)
Gets a random point within a rect
Declaration
public static Vector2 RandomPointWithin(this Rect rect)
Parameters
| Type | Name | Description |
|---|---|---|
| Rect | rect | The rect to get a random point within |
Returns
| Type | Description |
|---|---|
| Vector2 | Returns a random point within the rect |