简体   繁体   中英

Can I change nodes hierarchy?

I would like to know, is there a chance to change hierarchy of nodes?

Something like setChildIndex in ActionScript3. I want to move one sprite above the other, after some action.

Thanks in advance!

You can set the nodes zPosition with yourNode.zPosition = 0; zPosition 0 will be behind zPosition 1, and so on. You can set it at any event point if the node is available.

Also, check the docs here . It has a good explanation of setting many of a node's properties such as zPosition.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM