-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Create a new OverflowAxis
that allows scrolling while keeping overflown items visible
#19773
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
base: main
Are you sure you want to change the base?
Conversation
It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note. Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes. |
Why is that so bad? I think you need a clearer justification for this change. |
Using |
I'm not very convinced either. The overflow implementation isn't complete, overflow-scroll is meant to display scrollbars. Once we implement scroll bars, a "ScrollNoClip" variant doesn't make any sense. |
The scrollbars will be required by all ui nodes, not opt-in? |
Looking at the screenshots you will see that all 3 have a ui node that is 128x128, using |
Updated the example to include a border to show the UI Node |
Looking at the screenshot, it seems like you are trying to create a diegetic user interface. If that's the case, then perhaps In any case, this seems like a very niche use case, and given that there's a (admittedly more complex) workaround, I'm not sure it's worth it adding to Bevy engine. (There's another argument I could make, but this involves an etymological argument about the definition of the word "scroll" which I'd rather not get into.) On the question of scrollbars: I've been assuming that games will want to customize the look and feel of scrollbars, so I've been wary of the idea of automatically adding scrollbars to scrolling entities. |
It's not so much about about displaying the scrollbars themselves. It's about controlling the non-visual layout behaviour like:
Problems which our current scrolling implementation just completely ignores 😓 |
i don't want this discussion to devolve into a discussion about scrollbars, but i would like for scrollbars to be able to be placed anywhere, even on a separate UI hierarchy, probably using relationships, i.e. |
and back to this PR, what alternative do y'all suggest then? |
Objective
If you want to create a node that has a long list of items, have all of them visible and scroll through them, you would need to fiddle with
Node::left
orNode::right
Solution
Create
OverflowAxis::ScrollNoClip
that keeps all items visible and allows you to scroll usingScrollPosition
Showcase
overflow_scroll
example