Search the Community
Showing results for tags 'setAll'.
-
Hello, I just upgraded from Phaser 2.0.2 to 2.0.4 and when I ran my project with the new build it was not working. After inspecting everything I realized it was an issue with Group.setAll as it was setting just some properties (things like checkWorldBounds and outOfBoundsKill are set correctly) but not others (frameName, anchors, update). As of now I got everything working again replacing Group.SetAll with Group.forEach and setting the properties in the callback. Is this a known issue? Am I doing something wrong (any change to they way this method works from 2.0.2 to 2.0.4)? Thank you.
-
Hello again everyone, I need to change the body side of every component of a group, but I can't find a way to do it because I need to pass 4 values in body.setSize. Here's the code so far: blueEnemy = game.add.group();blueGuy = blueEnemy.create(100, 100, 'blueEnemy');blueGuy.body.setSize(30, 30, 8, 8);I can set the size of the body if I create a variable that holds that sprite. But since I will create and kill lots of blueEnemy's, I don't know if that's the most practical way. I wanted to do something that would body.setSize(30, 30, 8, 8) in every new blueEnemy, but I don't know if it is possible to use setAll in this case (couldn't find any example of it). What I wanted to do was something like this, but working: blueEnemy = game.add.group();blueEnemy.setAll('body.setSize', [30, 30, 8, 8])blueEnemy.create(100, 100, 'blueEnemy');[30, 30, 8, 8] is not accepted. No error in console, but no affect either. If not possible to use setAll this way, is there a way to change the body size without assigning it to a variable? Thanks for the attention.