Creating Actors, placed in wrong order

Paerics

  • Posts: 9
Hey guys,

I'm working on a PauseMenu,
I place the Objects via Code (First Picture).
The placing-order is correct and I assing the correct Layers.
But when I hit the MenuButton and the Menu shows up the order of apperance is cracked up... (Picture 2)
I don't know why, everytime I hit the Button again the Objects show up in different order, but the X- and Y-Orientation is correct.

Did anybody know whats wrong or happen there?

Thanks for help and best regards.
Take a look @ Paeric's on Facebook: http://www.facebook.com/PaericsBerlin

hansbe

  • Posts: 262
Q: Are some of the actors set to 'Can be paused' while others are not ?

Paerics

  • Posts: 9
No, none of the PauseMenu relevant Actors is pausable...

PS: There is one error in my first screenshot, I fixed it, but didn't changed anything.

« Last Edit: June 09, 2012, 08:14:30 am by Paerics »
Take a look @ Paeric's on Facebook: http://www.facebook.com/PaericsBerlin

hansbe

  • Posts: 262
Well I think officially there's no way of controlling which order actors get drawn within a layer, so I think you should either create another layer or just use front for the buttons. Also the double send to front/send to layer 4 shouldnt have any effect, the last one should be the effective.

malukorj

  • Posts: 22
How to kill all the menu actors when unpaused ?

hansbe

  • Posts: 262
Add each created actor to a list, then when you unpause you can use a 'for each' loop and go through each item, killing it. After that empty the list.

gplar

  • Posts: 1118
Or place all menu actors in a group and kill all members of group:


malukorj

  • Posts: 22
Or place all menu actors in a group and kill all members of group:

Thanks Gplar, I was trying with a diferente block code. Now it´s working!

Paerics

  • Posts: 9
Thanks for the advice.
I changed the order of placement in code a bit, step by step and added all the actors on different layers
and now it works.

Thanks a lot.
Take a look @ Paeric's on Facebook: http://www.facebook.com/PaericsBerlin