Fricken Hamster

Group scale?

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.