How to replace display objects within groups
Oct 28 2018 03:17 AM
Best Answer roaminggamer , 28 October 2018 - 07:26 AM
Things you can do do:
- For textured objects of same size, change the fill. - If the object you are replacing is the same size and the new one, just fill the old object with a new texture.
- Insert the new object at the index of the old. - Just determine the index of the replacement object in the group. Then use group:insert() to add the new object at that index. The remove the old object.
I think perhaps you forgot this, but you can insert at a specific index:
group:insert( [index,] child, [, resetTransform] )