AngeliA
Search Results for

    Show / Hide Table of Contents

    Struct ClampCellsScope

    Scope to clamp rendering cell into given rect position

    Implements
    IDisposable
    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()
    Back to top ๐Ÿ„๐Ÿฆโ€โฌ›๐Ÿงฆ๐Ÿˆ๐ŸŽƒ๐Ÿ’“๐ŸŒนโ˜•๐Ÿดโ€โ˜ ๏ธ๐Ÿค