Struct ClampCellsScope
Scope to clamp rendering cell into given rect position
Implements
Examples
using AngeliA;
namespace AngeliaGame;
public class Example {
[OnGameUpdate]
internal static void OnGameUpdate () {
int x = QTest.Int("X", 0, 0, Const.CEL * 128);
int y = QTest.Int("Y", 0, 0, Const.CEL * 128);
int w = QTest.Int("W", Const.CEL * 24, 0, Const.CEL * 128);
int h = QTest.Int("H", Const.CEL * 24, 0, Const.CEL * 128);
var cameraRect = Renderer.CameraRect;
Renderer.SetLayer(RenderLayer.UI);
using (new ClampCellsScope(new IRect(cameraRect.x + x, cameraRect.y + y, w, h))) {
// Rendering cell created inside will have be clamped inside
Renderer.Draw(BuiltInSprite.ICON_ENTITY, cameraRect.Shrink(Const.CEL * 3).Fit(1, 1));
}
}
}
Constructors
ClampCellsScope(IRect)
Scope to clamp rendering cell into given rect position
Declaration
public ClampCellsScope(IRect rect)
Parameters
Type | Name | Description |
---|---|---|
IRect | rect | Rect position in global space |
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()