-
-
Notifications
You must be signed in to change notification settings - Fork 895
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
Row and Column for Flame Components #1944
Comments
Sgtm, do you want to work on this? |
@spydon I don't have that much spare time at the moment, therefore rather no, sorry. |
I've a few things on my queue, but I could try tackling this after clear some space on it |
Here are my first attempts:
It can be used like this:
I'm sure there are lots of things i didn't think of and which need to be considered. |
Now supports a constant gap between the children which can be changed dynamically.
To be used like this:
|
Can we rename the Component to be RowComponent instead of ComponentRow? That way it follows the current naming convention. |
@alestiago Done |
In order to get notified about a change in a parent's children this new function will be called now. This feature will help simplifying e.g. the implementation of issue #1944 (Row and Column components).
Is this feature available? |
@mrbeardad Not really. At the moment there's only AlignComponent available, where additional layout components shall be added later. |
Waiting for use now.... |
interesting... +1 |
Problem to solve
With
Row
andColumn
classes childrenComponent
s could be placed and layouted correctly without overlapping and without having to care about repeating size and position calculations.In my games i often have
Component
s (Sprites, buttons, etc.) which have to be placed either in rows or columns, where it's always quite an effort to calculate their positions and sizes.The goal of the suggested two classes would be to make these calculations transparent for the developer.
Proposal
Flutter-like
Row
andColumn
classes with alignment options for both axes (i.e.mainAxisAlignment
andcrossAxisAlignment
).Some ideas:
PositionComponent
themselvesPositionComponent
extending classes (since getting their size is important)Row
orColumn
would need to re-layout the componentSizedBox
) - ok this can be accomplished by just adding aPositionComponent
with asize
definedThe text was updated successfully, but these errors were encountered: