DrawContextExtensions.UseRenderLayer(this IDrawContext, byte) Method
Definition¶
Namespace: Brine2D.Rendering
Sets the render layer and returns a scope that restores the previous layer on dispose.
public static Brine2D.Rendering.RenderLayerScope UseRenderLayer(this Brine2D.Rendering.IDrawContext context, byte layer);
Parameters¶
context IDrawContext
layer System.Byte
Returns¶
Example¶
using (drawContext.UseRenderLayer(200))
{
drawContext.DrawTexture(foregroundTexture, position);
}
// Previous render layer is restored here.