Jump to content
Search Community

Scaling a container does not affect width of child

algro test
Moderator Tag

Recommended Posts

I've got a container(sprite) with children(sprites) added to it.

When I scale the container, I would like to get the new width of a child, but get always the original dimensions.

How do I overwrite the children-width ?

 

Thanks

Link to comment
Share on other sites

That's just how Flash works - width/height/scaleX/scaleY/rotation etc. are all reported locally, not globally. In your case, you could get the child's width in terms of its parent's parent coordinate system by either using getBounds() like child.getBounds(grandparent).width

 

Another option would be to multiply the child's width by its parent's scaleX but that won't factor in any rotation.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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