mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-08-01 00:08:05 -04:00
Panel can record custom commandlist like so:
```csharp
public class GlowPanel : Panel, IPanelDraw
{
static Material GlowMat = Material.FromShader( "shaders/ui_glow.shader" );
public void Draw( CommandList cl )
{
cl.Attributes.Set( "GlowColor", Color.Cyan );
cl.DrawQuad( Box.Rect, GlowMat, Color.White );
}
}```
12 lines
240 B
C#
12 lines
240 B
C#
using Sandbox.Rendering;
|
|
|
|
namespace Sandbox.UI;
|
|
|
|
/// <summary>
|
|
/// Implement on a <see cref="Panel"/> to issue custom GPU commands into the UI rendering pipeline.
|
|
/// </summary>
|
|
public interface IPanelDraw
|
|
{
|
|
void Draw( CommandList cl );
|
|
}
|