yohamta / donburi

Just another ECS library for Go/Ebitengine
https://pkg.go.dev/github.com/yohamta/donburi
Other
251 stars 21 forks source link

Add a transform.ChangeParent(child, parent, keepWorldPosition) Function #111

Closed PKuebler closed 11 months ago

PKuebler commented 11 months ago

This is a first draft for a function that allows to change the parent.

I will improve the tests and fix bugs if necessary.

The transform.SetParent changes only the positioning but not the actual parent, that happens only in the ApplyChildren.

My new RemoveParent also only changes the positioning. To avoid confusion I'm thinking about renaming this to RemoveParentTransformation or staying in the same naming scheme but making the function private.

yohamta commented 11 months ago

@PKuebler Looks awesome, thanks for the contribution!