gum-layout
Skill659 starsChanged 2 months agoMITView on GitHub
Gum's layout system — dimension units, position units, children layout modes, layout calculation flow, suspension. Triggers: Width/HeightUnits, XUnits/YUnits, stacking, wrapping, auto-sizing, Anchor/Dock, GraphicalUiElement layout logic. For engine internals see gum-layout-engine.
In this repository69 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- debuggingSkill
- frb-build-verificationSkill
- frb-pixel-harnessSkill
- gum-architecture-layersSkill
- gum-bundleSkill
- gum-cliSkill
- gum-cross-platform-unificationSkill
- gum-docs-writingSkill
- gum-file-pathsSkill
- gum-forms-behaviorsSkill
- gum-forms-controlsSkill
- gum-forms-default-visualsSkill
- gum-forms-itemscontrolSkill
- gum-forms-theme-importSkill
- gum-iconsSkill
- gum-issue-creationSkill
- gum-kernsmith-integrationsSkill
- gum-layout-engineSkill
- gum-localizationSkill
- gum-monogame-renderingSkill
- gum-monthly-releaseSkill
- gum-project-versioningSkill
- gum-property-assignmentSkill
- gum-raylib-renderingSkill
- gum-releaseSkill
- gum-runtime-animation-chainsSkill
- gum-runtime-bindingSkill
- gum-runtime-fontsSkill
- gum-runtime-hot-reloadSkill
- gum-runtime-syntax-versionSkill
- gum-runtime-systemmanagers-initSkill
- gum-runtime-topologySkill
- gum-runtime-variable-referencesSkill
- gum-samplesSkill
- gum-serviceSkill
- gum-source-linked-projectSkill
- gum-themingSkill
- gum-tool-animationsSkill
- gum-tool-codegenSkill
- gum-tool-copy-pasteSkill
- gum-tool-delete-logicSkill
- gum-tool-dialogsSkill
- gum-tool-errorsSkill
- gum-tool-file-watchSkill
- gum-tool-font-generationSkill
- gum-tool-import-from-gumxSkill
- gum-tool-loggingSkill
- gum-tool-outputSkill
- gum-tool-pluginsSkill
- gum-tool-save-classesSkill
- gum-tool-screenshotsSkill
- gum-tool-selectionSkill
- gum-tool-tree-viewSkill
- gum-tool-undoSkill
- gum-tool-variable-gridSkill
- gum-tool-variable-referencesSkill
- gum-tool-viewmodelsSkill
- gum-unit-testsSkill
- gum-variable-deep-diveSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
All layout lives in GraphicalUiElement (the GumRuntime/GraphicalUiElement.*.cs partials.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Gum Layout System
Gum's layout is driven by unit enums that tell the engine how to interpret
numeric Width/Height/X/Y values, plus a children layout mode on containers.
All layout lives in GraphicalUiElement (the GumRuntime/GraphicalUiElement.*.cs partials; file map in gum-layout-engine).
Key Concepts
Dimension Units (Width & Height)
DimensionUnitType enum (GumDataTypes/DimensionUnitType.cs) controls how a
Width or Height value is interpreted. Units fall into dependency categories:
| Dependency | Units |
| No dependency | Absolute, PercentageOfSourceFile, PercentageOfOtherDimension, MaintainFileAspectRatio, AbsoluteMultipliedByFontScale, ScreenPixel |
| Depends on parent | PercentageOfParent, RelativeToParent, RelativeToMaxParentOrChildren* |
| Depends on children | RelativeToChildren |
| Depends on siblings | Ratio |
* RelativeToMaxParentOrChildren is classified as DependsOnParent but also
depends on children — special-cased throughout the layout engine. See
dimension-units.md for circular dependency handling.
See dimension-units.md for detailed descriptions.
Position Units (X & Y)
GeneralUnitType enum (GumDataTypes/UnitConverter.cs) controls how X/Y
values are measured: from edges, center, baseline, or as percentages.
Combined with XOrigin/YOrigin (HorizontalAlignment/VerticalAlignment) to
set which point on the element is being positioned.
See dimension-units.md for detailed descriptions.
Children Layout
ChildrenLayout enum (Gum/Managers/StandardElementsManager.cs):
- Regular — children positioned independently
- TopToBottomStack / LeftToRightStack — stack children along an axis
- AutoGridHorizontal / AutoGridVertical — arrange in wrapping grid
Related properties: StackSpacing, WrapsChildren,
AutoGridHorizontalCells, AutoGridVerticalCells,
StackedRowOrColumnDimensions.
Anchor & Dock
Convenience APIs on GraphicalUiElement that set multiple layout properties
at once (X, Y, XUnits, YUnits, XOrigin, YOrigin, Width, WidthUnits, etc.).
- Anchor — 9 positions (TopLeft..BottomRight) + CenterHorizontally/Vertically
- Dock — Top, Left, Right, Bottom, Fill, FillHorizontally, FillVertically, SizeToChildren
Layout Engine
See layout-engine.md for the calculation flow, suspension system, dirty tracking, and performance considerations.
Quick Reference
| Method | Purpose |
UpdateLayout() | Full layout recalculation |
UpdateLayout(updateParent, childrenUpdateDepth, xOrY) | Granular control |
SuspendLayout(recursive) | Pause layout, queue as dirty |
ResumeLayout(recursive) | Resume and apply queued updates |
AbsoluteWidth / AbsoluteHeight | Final computed dimensions |
MakeDirty(...) | Queue deferred update when suspended |
Key Properties
IsLayoutSuspended— instance-level pauseIsAllLayoutSuspended— thread-static global pause (background loading)GlobalFontScale— multiplier for AbsoluteMultipliedByFontScaleCanvasWidth/CanvasHeight— root canvas size
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

