Fricken Hamster Posted November 16, 2013 Share Posted November 16, 2013 Hey, I don't know if this is a bug or feature, groups scale doesn't extend to the sprites in the group.I'm using group.scale.x and yStuff like position and rotation propagate. Link to comment Share on other sites More sharing options...
JackBid Posted November 18, 2013 Share Posted November 18, 2013 Just a guess, but you may need to use the setAll group method.group.setAll(scale.x, 2);i have not tested this myself, but it may be worth a try! Link to comment Share on other sites More sharing options...
Fricken Hamster Posted November 18, 2013 Author Share Posted November 18, 2013 I'll try this later, but I don't know if it'll keep track of each sprite's current scale, or if it'll just set all of them to the target scale. Link to comment Share on other sites More sharing options...
Alvin Posted November 18, 2013 Share Posted November 18, 2013 Hi,As JackBid said, it will set the scale.x property of each member of the group to a new value, you cannot do something like group.scale.x++ with setAll only, you would need to iterate through the group with Group.forEach for example.PS : Be careful as the first parameter of Group.setAll must be a string. Link to comment Share on other sites More sharing options...
Fricken Hamster Posted November 21, 2013 Author Share Posted November 21, 2013 I don't think this is what I'm looking for. In Flash if you add display containers onto a Sprite, you can change the scale of the children, then change the scale of the parent and the ratios would stay the same. Link to comment Share on other sites More sharing options...
rich Posted November 22, 2013 Share Posted November 22, 2013 You're right, you should be able to scale the group and have it update children. Can you file an issue on github please (if you didn't already). en4ce 1 Link to comment Share on other sites More sharing options...
Fricken Hamster Posted November 25, 2013 Author Share Posted November 25, 2013 Done! Link to comment Share on other sites More sharing options...
Mathieu Anthoine Posted January 19, 2014 Share Posted January 19, 2014 Hi, I'm new to Phaser. My background is more ActionScript than HTML5. I try to do some behaviors close to nested MovieClips but Phaser Sprites don't seem to work like DisplayContainer in Flash. So I tried to use a group, add a sprite in it and play with alpha, rotation and.... scale. Scale doesn't seem to work as expected, it's why I reply to this post.I have seen that the "bug" Fricken Hamster has noticed is fixed in the Phaser 1.1.4, so I downloaded the phaser.min.js 1.1.4 and tried again but it doesn't seem to work. Maybe I did something wrong, here is a part of my code: var world= game.add.group (); var grid=new Phaser.Sprite (game,0,0,'grid'); world.add(grid); world.scale=new Phaser.Point (0.5,0.5);Thank you for your help. Link to comment Share on other sites More sharing options...
rich Posted January 19, 2014 Share Posted January 19, 2014 Scale is an existing property of group, so just set it rather than overwrite it: world.scale.x or world.scale.setTo(x,y)Also you can just do:var grid = world.create(0, 0, 'grid)To create sprites within an existing group. Link to comment Share on other sites More sharing options...
Heppell08 Posted January 19, 2014 Share Posted January 19, 2014 So is the scale of the children in the group a phaser bug? My code has grouped sprites for my players health and I had to seperate each heart for scale within the group creation. I've got it as heart1.scale.x= .5 and so on and so forth. That is also set like that as each heart as its own for killing them in an order but it works so don't want to mess with it so much. Mainly the group scale stuff could be helpful though if its not a bug. Link to comment Share on other sites More sharing options...
pgoloskokovic Posted September 1, 2015 Share Posted September 1, 2015 Was this bug resolved? Still when I change group scale factor it's children stay unaffected. If I change scale factor for every child in a group I get the desired effect.It would be so much cleaner and easier if this worked. Link to comment Share on other sites More sharing options...
rich Posted September 1, 2015 Share Posted September 1, 2015 This proves it works: http://phaser.io/examples/v2/groups/group-scale So if you reckon it's broken the ball is in your court to provide a perfectly reproducible test case showing otherwise. netcell 1 Link to comment Share on other sites More sharing options...
pgoloskokovic Posted September 4, 2015 Share Posted September 4, 2015 I does work, it was my mistake... Sorry for that. Link to comment Share on other sites More sharing options...
ptotheaul Posted April 18, 2016 Share Posted April 18, 2016 I have a problem. I can scale a group but the bounding rectangles of the groups children do not scale proportional to the group scale. Is there an easy way to do this? I've seen people post that they loop through and reset the body dimensions for the children but it seems like there should be an easier way. Link to comment Share on other sites More sharing options...
Recommended Posts