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 when I trace the children’s width I always get the original dimensions, even though everything gets visually scaled as it should.
How do I overwrite the children-width ?
Update:
I just found out that the children.graphics-“dimensions” could have caused the problem. When I leave the graphics, everything seems ok. Is it possible to scale the graphics at same time as the child-sprite?
You can use
DisplayObject.transform.pixelBounds.widthorDisplayObject.transform.pixelBounds.heightto get the width and height of the child display objects like in the following:DisplayObject.transform.pixelBoundsbasically gets “aRectangleobject that defines the bounding rectangle of the display object on the stage”.