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
{{ message }}
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.
Current depth values are absolute. If you have a composite Sprite made up of many child Sprites and you change the depth of the parent, the depth of the children won't change together with it, which is inconvenient.
Visual could have a relative_depth field. If relative_depth is non-null and a parent is set, the child's depth will be set to parent.depth + relative_depth. The child's depth should also change when the parent's depth changes.
This behaviour can be mimicked by overriding update() to update the child's depth every frame, but it seems more efficient and organized to have in-built support for it.
(If this is ok, I can make a pull request.)
The text was updated successfully, but these errors were encountered:
Good idea! However, it might be confusing to have both depth and relative_depth - what is the behavior if both are set?
I usually do something like the following for handling relative depths:
Current depth values are absolute. If you have a composite Sprite made up of many child Sprites and you change the depth of the parent, the depth of the children won't change together with it, which is inconvenient.
Visual
could have arelative_depth
field. If relative_depth is non-null and a parent is set, the child'sdepth
will be set to parent.depth + relative_depth. The child's depth should also change when the parent's depth changes.This behaviour can be mimicked by overriding update() to update the child's depth every frame, but it seems more efficient and organized to have in-built support for it.
(If this is ok, I can make a pull request.)
The text was updated successfully, but these errors were encountered: