klg Posted February 25, 2015 Share Posted February 25, 2015 Hi Everyone, I'm trying to understand what swap() and swapChildren() methods in group do. Can they be used to swap X and Y positions of children in group?The example here only seems to swap the Z position. Should I update X and Y position manually or does phaser has a method for that? Thanks Link to comment Share on other sites More sharing options...
rich Posted February 25, 2015 Share Posted February 25, 2015 They swap children on the display list, so yes, z-index only. There's no concept of x or y in a display list, that's a userland level sort really (i.e. do it in your own code). The Group.sort method could help though. Link to comment Share on other sites More sharing options...
klg Posted February 25, 2015 Author Share Posted February 25, 2015 They swap children on the display list, so yes, z-index only. There's no concept of x or y in a display list, that's a userland level sort really (i.e. do it in your own code). The Group.sort method could help though. Thank Rich. By reading the API, I thought they might swap the X and Y positions too. Also, thank you so much for the awesome framework and all the support you are providing for it. Link to comment Share on other sites More sharing options...
Recommended Posts