Hey all,
I have several icons displayed on-screen which change their position over time.
I can know through code which one should be above the others, but I don't know how to tell CEGUI which object to show above the rest?
(Like: Icon 10 is first, icon 6 is second, icon 4 is third. And then a few seconds later: Icon 10 is second, icon 6 is third, icon 4 is first.)
Changing the order of an image
Moderators: CEGUI MVP, CEGUI Team
Re: Changing the order of an image
You will need to change their order in the child array. This is what defines what is drawn on top (and i think you ask for occlusion draw order right?).
You can either remove all child windows and then add them in order or you can simply use the moveToFront and moveToBack functions until you get the order you want It might be preferrable to use the functions the window already provides, unless this is inconvenient for you. If you do not change order often, then I would just remove all windows and re-add.
You can either remove all child windows and then add them in order or you can simply use the moveToFront and moveToBack functions until you get the order you want It might be preferrable to use the functions the window already provides, unless this is inconvenient for you. If you do not change order often, then I would just remove all windows and re-add.
CrazyEddie: "I don't like GUIs"
Re: Changing the order of an image
I tried doing the remove and re-add method, but that gave issues with multithreading.
I'll try out the moveToFront function, thanks!
I'll try out the moveToFront function, thanks!
Re: Changing the order of an image
Anasky wrote:I tried doing the remove and re-add method, but that gave issues with multithreading.
I'll try out the moveToFront function, thanks!
CEGUI has to run in a single thread. If you still get issues despite having it running in one thread then something must be wrong with how you sync between threads, i dont think it can be related to CEGUI itself in that case.
CrazyEddie: "I don't like GUIs"
Re: Changing the order of an image
Ident wrote:Anasky wrote:I tried doing the remove and re-add method, but that gave issues with multithreading.
I'll try out the moveToFront function, thanks!
CEGUI has to run in a single thread. If you still get issues despite having it running in one thread then something must be wrong with how you sync between threads, i dont think it can be related to CEGUI itself in that case.
I have my update thread and my render thread separated. This means that when the Update function tells CEGUI to change parents of a window, the RenderThread might be rendering CEGUI at that point in time.
It works fine for everything else, just switching parents has a bit of an issue ^^
But the moveToFront seems to work
Who is online
Users browsing this forum: No registered users and 40 guests