Closed TheSillyDoggo closed 11 months ago
i dont get it
Devtools sorts the nodes by it's z order so it has the lowest z up the top and the highest at the bottom. That makes getting a node by it's index harder
On Sat, 16 Dec 2023, 11:18 am mat, @.***> wrote:
i dont get it
— Reply to this email directly, view it on GitHub https://github.com/geode-sdk/DevTools/issues/20#issuecomment-1858632095, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWVTFEETDCGIZH3JHMLRWY3YJTSFDAVCNFSM6AAAAABAVOZGLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJYGYZTEMBZGU . You are receiving this because you authored the thread.Message ID: @.***>
so just sort them by their index instead of by z order
That's what I was saying
On Sat, 16 Dec 2023, 12:43 pm Capeling, @.***> wrote:
so just sort them by their index instead of by z order
— Reply to this email directly, view it on GitHub https://github.com/geode-sdk/DevTools/issues/20#issuecomment-1858671191, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWVTFEDLTHISZHJWMZAEEXDYJT4FHAVCNFSM6AAAAABAVOZGLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJYGY3TCMJZGE . You are receiving this because you authored the thread.Message ID: @.***>
there is no node index. the order of nodes during an init function is only temporary, as cocos then sorts the nodes by z order the next frame ish, which is what devtools shows. we dont sort the nodes by z order, we just iterate them by what getChildren() return
Oh I didn't understand mostly because I only use get children in the init functions so that's why
On Sat, 16 Dec 2023, 2:32 pm mat, @.***> wrote:
there is no node index. the order of nodes during an init function is only temporary, as cocos then sorts the nodes by z order the next frame ish, which is what devtools shows. we dont sort the nodes by z order, we just iterate them by what getChildren() return
— Reply to this email directly, view it on GitHub https://github.com/geode-sdk/DevTools/issues/20#issuecomment-1858700627, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWVTFEHRJS3DVQAUGHU4GDDYJUI55AVCNFSM6AAAAABAVOZGLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJYG4YDANRSG4 . You are receiving this because you authored the thread.Message ID: @.***>
Instead of ordering it in the z order of the node it should be the child index so it's in the same order that it should be.
also you can make it an option but that doesn't have to happen