Jump to content

Group scale?


Fricken Hamster
 Share

Recommended Posts

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

  • 1 month later...
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

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

  • 1 year later...
  • 7 months later...

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...