You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be super nice to be able to associate map objects with each other using parenting.
How parenting would work: All objects can either have one or zero parents. All objects can have any number of children. You can't parent an object to itself. You can't parent children to their recursive parent (no loops).
When a parent moves, the children copy its parent's displacement (recursively). When a parent rotates, the children copy its parent's rotation amount. i.e. If a parent moves 8 pixels up, all its children move 8 pixels up. If a parent rotates 80 degrees, all its children (recursive) rotate 80 degrees about the rotating parent.
Uses:
In the map editor it allows the user to manager multiple objects easily. In the code, it could help with associating objects with each other. i.e. A spawner that is associated with multiple types of monsters (all monsters are children to the spawner).
Implementation:
I think the biggest hurdle would be to find a good way to integrate this with the current .tmx structure. My idea would be to make it so every map object can also contain an object group (the children) and a parent object.
That, or each object have a list to the ID's of their children and a parent field with the id to their parent. That way we can leave it up to the library coders to implement the parenting in their own way.
Thoughts?
The text was updated successfully, but these errors were encountered:
I'm a little reluctant to actually introduce an object hierarchy, especially one that would apply the transform of parent objects to the children. This kind of hierarchy is not often seen in games as far as I am aware, though it is in graphics software.
It seems to me that the use-case presented by both you and @zilluss (in #572) would also be solved by introducing connections between objects (#707). That feature has the potential to be a lot more powerful than an object hierarchy, so it would be the direction I'd prefer to go in.
It would be super nice to be able to associate map objects with each other using parenting.
How parenting would work: All objects can either have one or zero parents. All objects can have any number of children. You can't parent an object to itself. You can't parent children to their recursive parent (no loops).
When a parent moves, the children copy its parent's displacement (recursively). When a parent rotates, the children copy its parent's rotation amount. i.e. If a parent moves 8 pixels up, all its children move 8 pixels up. If a parent rotates 80 degrees, all its children (recursive) rotate 80 degrees about the rotating parent.
Uses:
In the map editor it allows the user to manager multiple objects easily. In the code, it could help with associating objects with each other. i.e. A spawner that is associated with multiple types of monsters (all monsters are children to the spawner).
Implementation:
I think the biggest hurdle would be to find a good way to integrate this with the current .tmx structure. My idea would be to make it so every map object can also contain an object group (the children) and a parent object.
That, or each object have a list to the ID's of their children and a parent field with the id to their parent. That way we can leave it up to the library coders to implement the parenting in their own way.
Thoughts?
The text was updated successfully, but these errors were encountered: