s&box/field-guide
the symptom, in your words

"Runtime textures for UI panels must be assigned from C#"

✓ verified on engine 26.07lane: Building UIposted
▸ SYMPTOM

You create a Texture at runtime (e.g. a minimap, heatmap, or procedural preview) and want to display it in a Razor UI panel. Setting background-image in SCSS doesn't work — it only accepts asset path strings, not runtime texture references.

▸ CAUSE

SCSS background-image: resolves a path string to a compiled asset at load time. A Texture created in C# at runtime has no asset path — it exists only in memory.

▸ FIX

1. Create the texture

snippet
var tex = Texture.Create(width, height)
    .WithFormat(ImageFormat.RGBA8888)
    .WithDynamicUsage()   // makes repeated Update() cheap
    .WithName("minimap")
    .Finish();

2. Fill and update

snippet
var colors = new Color32[width * height]; // row-major
// ... fill colors ...
tex.Update(colors, 0, 0, width, height);

Color32 fields are lowercase r, g, b, a. Use .WithDynamicUsage() so you only recreate the texture when dimensions change — otherwise just call Update in place.

3. Assign from code-behind

@ref a Panel in the Razor markup and set the texture in OnTreeBuilt():

snippet
protected override void OnTreeBuilt()
{
    // @ref is a new Panel each rebuild — re-assign here
    MapPanel.Style.BackgroundImage = _texture;
}
▸ WHY IT WORKS

The engine's own PreviewImage component uses this exact pattern. SCSS styles are resolved statically against the asset system; runtime textures bypass the asset system entirely and must be wired through C#.

Verified on engine 26.07 — seen in a real project.
s&box moves fast; an undated fix is a liability. Spot a stale detail?