goo and razor¶
both goo and razor compile to Sandbox.PanelComponent. you can make a HUD with both, side by side, under one ScreenPanel.
same base class¶
GooPanel<TRoot> inherits from PanelComponent. a .razor file compiles to the same base. sibling components on one GameObject work. one-feature-per-paradigm also works. chat in razor, HUD in goo, mix per-screen.
when to reach for razor¶
- you already have a
.razorcodebase - you want the established
.razor.scssstyling
when to reach for goo¶
- one language top-to-bottom. no separate template plus stylesheet
- structural diff. no sequence-number issues from hand-written render code
- the tree is GC-clean per rebuild. no retained component heap to leak
- you don't like razor
sizing parallel¶
a .razor file ends up under a host panel created by the engine, exactly the same as a GooPanel. razor users typically size that host with a sibling .razor.scss (myui { width: 100%; height: 100% }). the engine's LoadStyleSheet step picks it up automatically.
goo bypasses the BuildRenderTree path entirely and doesn't ship an SCSS-loader convention. sizing the host panel in OnEnabled is the C# equivalent. see gotchas for the snippet.