This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
Scene Graph (Parent / Children) component #176
oaklandgit
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Yes I don't think it's possible to do it with external APIs. I'm interested in doing it but it does require some non-trivial refactor, will get to it when I got more time. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I posted this as a feature request in Issues, but I think it might be better for a discussion here, as I am trying to build this component myself, but am hitting some snags.
I wanted a "parent/child" component (e.g. a turret as a child of a tank in this example) so I did my best to make one here:
https://KaboomParentChild.larrystone.repl.co
But I recognize it has a few issues for a full-fledged component:
In order to affect children (e.g. their rotation or position) you need to target the custom "localX, localY, and localAngle" variables, which seems wrong. Ideally, the child should be positionable via the pos() component, and the "children()" component should mange the children accordingly.
A proper scene graph component should also be able to manage the origin offset, and alpha transparency of the children.
I will continue to try to improve this, but any advice would be appreciated!
Also, are there others out there who would find a children() component to be useful?
Beta Was this translation helpful? Give feedback.
All reactions