Here are two ways to make a group of interactive objects.
This uses the hitArea
and hitAreaCallback
properties of the GroupCreateConfig, in createMultiple().
Each group member will use a distinct hit area shape identical to the others, positioned on itself.
This uses the SetHitArea action. That action also takes hitArea
and hitAreaCallback
arguments, but you can omit them; in that case it works just like setInteractive() and uses each object’s texture frame as a hit area.