Skip to content
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 a vertical property to GridContainer #2907

Closed
juanitogan opened this issue Jun 23, 2021 · 3 comments
Closed

Add a vertical property to GridContainer #2907

juanitogan opened this issue Jun 23, 2021 · 3 comments

Comments

@juanitogan
Copy link

juanitogan commented Jun 23, 2021

Describe the project you are working on

Multiplayer lobby for Sendit Soccer.

Describe the problem or limitation you are having in your project

Grid fills horizontally first.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add a property that tells grid to change the fill order from horizontal-first (row-based) to vertical-first (column-based).

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

grid.vertical = true

If this enhancement will not be used often, can it be worked around with a few lines of script?

It will be used often, but... using VBoxContainers inside a HBoxContainer is the obvious workaround and requires only one extra loop to break between vertical fills. If number of rows changes dynamically, however, it gets a bit more messy.

Is there a reason why this should be core and not an add-on in the asset library?

It doesn't add significant bulk to the core object for a feature that will likely see a lot of use.

@Calinou
Copy link
Member

Calinou commented Jun 23, 2021

As a workaround, you can rotate a GridContainer by 90 degrees and rotate all its children by -90 degrees (or 270 degrees and -270 degrees).

@Calinou Calinou changed the title Add a vertical property to GridContainer Add a vertical property to GridContainer Jun 23, 2021
@juanitogan
Copy link
Author

An amusing workaround idea, indeed... but only if you don't mind the first cell being in the upper right or lower left. Unless you apply -1 scaling as well to the proper axis. I toyed with that out of curiosity but found that duplicating an object (in the editor) not only resets the rotation and scaling on the duplicated object, it resets it on the original as well. Weird. That's probably another bug for another day.

@Calinou
Copy link
Member

Calinou commented Oct 30, 2024

Closing in favor of #10234, which is more detailed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants