-
Notifications
You must be signed in to change notification settings - Fork 63
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
More sizing options for entities #18
Comments
Hi Craig, I like the idea and what you did with the Sizing class. I have a version almost ready in dev that I will merge with stable soon, this could be really nice ideas for next version after that one. I'll keep you updated when relevant. Thanks :) |
Ronen, I was wondering what the status of this was? I am running into the same situation and have not been able to find a way around it. I have a panel with a paragraph and then another panel below that. I want to make the inner panel fill the remaining space after the paragraph, but cannot figure out how to do that with the current API. |
The behaviour described by @chitoiur is not implemented currently and could only be added to the current API by overwriting some of the Entity methods which is not ideal for such a fundamental feature.
Are there other possibilities you see @RonenNess? I am considering those changes for my fork at the moment.. Would there be an interest in pulling those changes back into your original repo afterwards? |
This is an enchancement/feature request. I know you're busy so this is kind of just when you can get to it (if you agree!) or I could do a PR sometime and you could look at that.
It'd be handy if entities could have these extra sizing options:
FitParent
and it would be expanded toParent.Size.Y-button.Size.Y
. If there's more than one entity with this option set, they'll share the remaining space, so 2 entities get 50% each, 3 get ~33% each, etc.. I was also thinking that this could probably replaceVector2.Zero
(i.e. parent size), since this is the more intuitive outcome when you're trying to fit to parent.Also, I was thinking the rule with these could be that they can't be stacked both ways, e.g. a panel with
FitChildren
containing a panel withFitParent
. If they're stacked, the child withFitParent
sizing gets set to default. Either that or you could just throw an exception (which might be a better idea, then you don't have the annoying instance where the layout just isn't looking right but you can't figure out why).Lastly, because there would be more sizing options, it would probably be a good idea to make a static class, e.g. something like:
So then you can do
and it's explicit what sizing method you're using, and you can add more in the future just by expanding them into the negatives (-3, -4, etc.).
There's quite a lot in this issue, it could probably be split up, but I just wanted to kind of gauge what you thought about it and get some feedback!
The text was updated successfully, but these errors were encountered: