I'm working on a game menu where there is a popup sprite + txt + btn.
Is there any way to group different objects together? Some kind of extended Family maybe? Plugin?
Now I have to make absolutely same actions for all objects and it's not very convenient as you know.
I attached an example: https://www.dropbox.com/s/bflfwhx4koc0c0q/popup.c3p?dl=0
Develop games in your browser. Powerful, performant & highly capable.
to apply the same action to multiple objects, you need to use containers.
When you have an event that create an object in a container, it creates all the other objects in the same container.
If you have a condition that picks an object, all of the objects in the same container are also picked
For example, here:
I placed a bunch of UIScarf on my layer, like so puu.sh/AXJZu/1021d87a75.png
When the game starts, for each of those, the two other objects in it'S container on the bottom left are also spawned.
Running a for each loop picks every "UIScarf" object one by one, and when one of them is picked, then I change some of it's variables so that they match their parent object, and I dont need to pick them the right UIScarf picks it's contained thingies things
Here puu.sh/AXK4v/7ea10dd545.png the condition "On frame changed" is a trigger and picks the button object and every object in the container so i can directly set the position of UIScarf
If you want even easyer control you can also put them in a family, like here puu.sh/AXK6N/3ac5f1adc1.png where picking a "skin" object also picks boots, chainmail, clothes, hair, etc, but instead of stopping their animation one by one, I put them in a family and I only need one action for the whole group and the action will affect all picked object in the family, so make sure they were picked properly with containers and a "pick" condition or a trigger and it should work.