Class ClipRectDisposable
Assembly: Dalamud.dll
public sealed class ClipRectDisposable : IDisposable
Implements:
System.IDisposable
Properties
Count
Gets the number of ClipRects currently pushed with this object.
public int Count { get; }
Methods
Push(in Vector2, in Vector2, bool, bool)
Push a new global ClipRect.
public ClipRectDisposable Push(in Vector2 topLeft, in Vector2 bottomRight, bool intersectWithCurrentClipRect = false, bool condition = true)
Returns
Dalamud.Interface.Utility.Raii.ClipRectDisposable: A disposable object that can be used to push further ClipRects and pops those ClipRects after leaving scope. Use with using.
Parameters
| Type | Name | Description |
|---|---|---|
System.Numerics.Vector2 | topLeft | The top-left corner of the rectangle in screen coordinates. |
System.Numerics.Vector2 | bottomRight | The bottom-right corner of the rectangle in screen coordinates. |
System.Boolean | intersectWithCurrentClipRect | Whether to intersect the rectangle with the current existing ClipRect or to replace it. |
System.Boolean | condition | If this is false, the ClipRect is not pushed. |
Remarks
If you need to keep ClipRects pushed longer than the current scope, use without using and use Dalamud.Interface.Utility.Raii.ClipRectDisposable.PopUnsafe(int).
Push(in Vector2, in Vector2, bool)
Push a new global ClipRect.
public ClipRectDisposable Push(in Vector2 topLeft, in Vector2 bottomRight, bool intersectWithCurrentClipRect = false)
Returns
Dalamud.Interface.Utility.Raii.ClipRectDisposable: A disposable object that can be used to push further ClipRects and pops those ClipRects after leaving scope. Use with using.
Parameters
| Type | Name | Description |
|---|---|---|
System.Numerics.Vector2 | topLeft | The top-left corner of the rectangle in screen coordinates. |
System.Numerics.Vector2 | bottomRight | The bottom-right corner of the rectangle in screen coordinates. |
System.Boolean | intersectWithCurrentClipRect | Whether to intersect the rectangle with the current existing ClipRect or to replace it. |
Remarks
If you need to keep ClipRects pushed longer than the current scope, use without using and use Dalamud.Interface.Utility.Raii.ClipRectDisposable.PopUnsafe(int).
Push(in Rectangle, bool, bool)
Push a new global ClipRect.
public ClipRectDisposable Push(in Rectangle rectangle, bool intersectWithCurrentClipRect = false, bool condition = true)
Returns
Dalamud.Interface.Utility.Raii.ClipRectDisposable: A disposable object that can be used to push further ClipRects and pops those ClipRects after leaving scope. Use with using.
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Interface.Utility.Rectangle | rectangle | The rectangle in screen coordinates. |
System.Boolean | intersectWithCurrentClipRect | Whether to intersect the rectangle with the current existing ClipRect or to replace it. |
System.Boolean | condition | If this is false, the ClipRect is not pushed. |
Remarks
If you need to keep ClipRects pushed longer than the current scope, use without using and use Dalamud.Interface.Utility.Raii.ClipRectDisposable.PopUnsafe(int).
Push(in Rectangle, bool)
Push a new global ClipRect.
public ClipRectDisposable Push(in Rectangle rectangle, bool intersectWithCurrentClipRect = false)
Returns
Dalamud.Interface.Utility.Raii.ClipRectDisposable: A disposable object that can be used to push further ClipRects and pops those ClipRects after leaving scope. Use with using.
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Interface.Utility.Rectangle | rectangle | The rectangle in screen coordinates. |
System.Boolean | intersectWithCurrentClipRect | Whether to intersect the rectangle with the current existing ClipRect or to replace it. |
Remarks
If you need to keep ClipRects pushed longer than the current scope, use without using and use Dalamud.Interface.Utility.Raii.ClipRectDisposable.PopUnsafe(int).
Pop(int)
Pop a number of ClipRects in this draw list.
public void Pop(int count = 1)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | count | The number of ClipRects to pop. This is clamped to the number of ClipRects pushed by this object. |
Dispose()
Pop all ClipRects pushed with this object.
public void Dispose()
PopUnsafe(int)
Pop a number of ClipRects from the ClipRect stack without using an IDisposable.
public static void PopUnsafe(int count = 1)
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | count | The number of rects to pop. The number is not checked against the rect stack. |
Remarks
Avoid using this function, and ClipRects across scopes, as much as possible.
Implements
System.IDisposable