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

feat: Option to add child at First position to ViewComponent #1362

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

DeathPhoenix22
Copy link
Contributor

Hi @AlmasB,

Add the possibility to add child to ViewComponent Last vs First.

No change to default behavior.
Reference: #1361

Copy link
Owner

@AlmasB AlmasB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, please see below

@@ -214,7 +221,11 @@ class ViewComponent : Component() {
}
}

group.children += child
if(addLast) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addLast is currently being used to add groups to parent -- in-game groups go first, developer groups go last, so we cannot use it to manage group children.

Perhaps we can generalise this to something like addChild(index: Int, node: Node, isTransformApplied: Boolean) with the default implementation being just addChild(node: Node, isTransformApplied: Boolean) which adds it last.

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

Successfully merging this pull request may close these issues.

None yet

2 participants