gum-layout

Featured

Reference guide for Gum's layout system — dimension units, position units, children layout modes, layout calculation flow, and layout suspension. Load when working on Width/HeightUnits, XUnits/YUnits, stacking, wrapping, auto-sizing, Anchor/Dock, or GraphicalUiElement layout logic. For deep engine internals (debugging/optimizing UpdateLayout, UpdateChildren, dirty state), see the gum-layout-engine skill instead.

Web & Frontend 511 stars 74 forks Updated today MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
90
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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` (`GumRuntime/GraphicalUiElement.cs`). ## 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](dimension-units.md) for circular dependency handling. See [dimension-units.md](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](dimension-units.md) for detailed descriptions. ### ...

Details

Author
vchelaru
Repository
vchelaru/Gum
Created
11 years ago
Last Updated
today
Language
C#
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category