swissnetizen Posted February 24, 2015 Share Posted February 24, 2015 I've got a group, I would like to know if it is possible to bind events to it to detect if a sprite has been added to it.I understand that I could check every frame if a new sprite was added, but I hope there is a better way.Something like:group.events.newSpriteAdded.add(""); Link to comment Share on other sites More sharing options...
rich Posted February 24, 2015 Share Posted February 24, 2015 sprite.events.onAddedToGroup.add(yay, this); sprite.events.onRemovedFromGroup.add(ohTheHorror, this); markusT 1 Link to comment Share on other sites More sharing options...
swissnetizen Posted February 24, 2015 Author Share Posted February 24, 2015 This isn't exactly what I'm looking for. I don't have the ability to attach events to sprites themselves. I want to attach the event to the group itself Link to comment Share on other sites More sharing options...
rich Posted February 24, 2015 Share Posted February 24, 2015 No then. Although it begs the question how exactly you're adding things to a Group without knowing what you're adding. Link to comment Share on other sites More sharing options...
swissnetizen Posted February 25, 2015 Author Share Posted February 25, 2015 I've got an object which is supposed to monitor the group and see if any new sprites are added, the reason for this is that it needs to perform some setup.I'm going to go with manually calling the setup function every time something for every new sprite. Link to comment Share on other sites More sharing options...
Recommended Posts