views:

37

answers:

1

I have an array of Sprites on stage and want to now the rectangle that bounds them. I could do a loop and check each element's getBounds() but that could be computationally expensive. Is there a better way to do it?

+1  A: 

You could put them all inside a Sprite, and get the bounding box of that sprite.

Cay
Yeah but thats not an option. Was hoping there would be some trick involving bitmapData etc to do it.
Arpit
How about temporarily?If not, the only "elegant" solution I can think of is just looping through them, etc...Another way could be drawing them in a bitmapdata and use getColorBounds, but it would probably be quite slower and dirty than the loop ;)
Cay