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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UI Materials #9506
Add UI Materials #9506
Changes from 43 commits
2d37454
fb90baa
7a98e22
ccba0a2
4298848
cbbbd88
7ed8914
e65163e
d5e12d4
bb19f42
3b8022a
ced9292
62709a0
62a51e0
d4327cc
7706744
493d3cc
f637d7a
033dee0
86ae1b8
66a4cd9
ac911ba
d800744
4c65b29
794b722
4a150cd
c9fcabe
193197a
d2fbd1d
930ec95
fef7fac
7eeb644
6294a17
1226bf1
301b193
e77172b
239faf9
1239117
bc2c029
84ef0ac
62b99d6
1e0727a
781fb57
7988610
b51c143
57419c0
4a9bf5f
08cf2f3
a978a1e
a3c613e
fb49734
83d703a
b0c6ec9
12b6a33
3ea88ca
65ae48a
b412839
349af3c
d5909ba
c61a2aa
afe56e5
f8267d1
2425a10
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah noticed a snag, ideally we want some sort of
MaterialImageBundle
as well:The
ContentSize
component contains a measure func that is used to negotiate with the layout algorithm to find an optimal size for a node's content given that content's properties (like its aspect ratio and pixel density) and the space constraints of the UI layout.ImageBundle
has a matching systemupdate_image_content_size_system
that retrieves the size of the image from its texture asset and sets a measure func that preserves its aspect ratio. But we can't do that here becauseUiMaterial
doesn't expose its texture asset publically (if it has one).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be fine not to worry about measurefuncs for this PR though, the implementation looks great, really nice and clean.
It's not essential as users can create their own system to add a measurefunc, which isn't very hard. We do need a custom measurefunc example, it would make sense to base one around a
UiMaterial
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great suggestion, I agree with you there, I wasn't aware of
ContentSize
I'd like to get this PR done and would be happy to take on the
MaterialImageBundle
as a followup once it is readyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn’t the image just be a member of the material type? @ickshonpe as well as other data needed - the image size.