Implement runtime UI workflow and editor integration#819
Open
Gopmyc wants to merge 25 commits into
Open
Conversation
adriengivry
requested changes
May 23, 2026
Member
adriengivry
left a comment
There was a problem hiding this comment.
Found a bunch of issues that I reported to you directly on Discord.
Didn't dive into the code yet, as it's subject to change.
Some design issues to figure out:
Transformshould be "adaptive", depending on the context (2D/3D).- When in 2D mode, width/height/anchor preset/anchor pivot should be displayed
- When in 3D mode, nothing should change from what was previously shown
- There should be no need for an extra component, the transform should store 2D-related properties under an
std::optionaldata struct.
- Font rendering: currently fonts are rasterized with a fixed font size, so scaling a font will lead to blurry text. This could be fixed by implemented either SDF or dynamic glyph rendering. Dynamic glyph might be easier for now.
CText::m_textshould be displayed as a multiline string. Right now it's not possible to add line breaks in texts.
Some bugs I found so far:
- Anchor presets not working properly (partially addressed, the bounds in scene view are rendering incorrectly)
- Constant-size/scale with screen size issue, if I set the Canvas to 1920x1080, and add an image of size 1920x1080, it doesn't exactly fit the screen. When using scale with screen size (which should be default), we should be able to choose when the ratio is mismatching, to either match Width or Height, shrink, or expand. (see Unity documentation)
- When using multiple Canvas, composition order should be based on their position in the hierarchy.
Member
There was a problem hiding this comment.
Clay header should be in an include/ folder. A src/ folder should be added with clay.c that will esentially contain:
#define CLAY_IMPLEMENTATION
#include <clay.h>This way Clay.cpp can be removed from Overload's srouces.
premake5.lua will need to be added with similar content to freetype (C project with warnings off).
Member
There was a problem hiding this comment.
You'll also need to update the root premake5.lua to have clay in the "Dependencies" group
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
CCanvas,CTransform2D,CImage,CText.CLayoutGroup,CHorizontalLayout,CVerticalLayout.controlChildrenWidth/Heightsizing.Related Issue(s)
Fixes #631
Review Guidance
CLayoutGroup(controlChildrenWidth/Height).CTransform2Dstretch presets and inspector behavior.CText/Fontmaterial path (EnsureEmbeddedMaterial+ color override).Reviewer Notes (Key integration details)
1) Layout behavior (
CLayoutGroup)controlChildrenWidth/Heightnow effectively writes computed sizes to supported child UI components (CImage,CTextextents,CTransform2Dsize).2) Dedicated layout components
CHorizontalLayoutandCVerticalLayoutare concrete specializations ofCLayoutGroup.3) Transform2D anchor/stretch presets
HORIZONTAL_STRETCH_TOP/MIDDLE/BOTTOMVERTICAL_STRETCH_LEFT/CENTER/RIGHTSTRETCH_BOTH4) Text/Font material flow
Fontnow owns an embedded UI material (EnsureEmbeddedMaterial/GetEmbeddedMaterial).CTextreuses this embedded material and only overrides dynamic text color.5) Editor rendering mode behavior
GameView: always includes UI in screen space.SceneView: always includes UI; toolbar toggle switches screen-space mode on/off for Scene View display.6) Lua exposure
CHorizontalLayoutandCVerticalLayout.Transform2Danchor preset enum values.Screenshots/GIFs
AI Usage Disclosure
Generated new code / Refactored code / Debugging
Build Warnings
The changes generate build warnings, specifically 29 new warnings originating from the
Claylibrary itself.These correspond to typical internal conversions on MSVC side: pointer to
uint32_t(hash),doubletofloat,float/__int64toint32_t.These are true narrowing warnings, but not relevant to our current integration as long as we remain within normal layout/UI sizes.
Note
You can find an Overload project on the
631-demobranch of my Overload fork. It includes scenes and scripts used to test the Lua API, as well as the added and modified source code.Checklist