At 7/10/13 02:14 AM, MSGhero wrote:
At 7/10/13 02:07 AM, TheNavigat wrote:
At 7/10/13 02:02 AM, MSGhero wrote:
Because you'd have to type out and instantiate every single linkage name instead of instantiating one bmd and letting a for loop put everything where it needs to go.
Aha, so no performance difference then?
Instantiating 24 bmds to make an animation vs instantiating one would drop the framerate a bit, but that should be done at compile time anyway. And there's gotta be more memory used by the 24 than the one as far as overhead and stuff: imagine thousands of 1x1 bmds or one large bmd.
Well, in the end I'll splice it anyway to instantiate bitmapDatas out of it, if you've got them in the library, it's the same concept. You only replace bitmapDatas and by doing so the old ones have no reference and will be set to null.
Let me illustrate what I've understood in a simpler way.
Let's say we've got an asset sheet, 5 body parts. You'll have to instantiate 5 bitmaps, and then run a loop to copy each body part to a bitmapData, so you've got 5 bitmapDatas. Now you can move the thing.
On the other hand, using a library, you've got 5 bitmapData unique classes. You instantiate each one, and then add them to the 5 bitmaps. According to this, using library would even save more performance, because there's no bit copying.
I don't really know what's behind the scenes so I may be wrong, but even if there was some bit copying, then the performance is equal. Asset/Sprite sheets just get it more complicated by packing them and having some properties with rotation and stuff that need to be sliced..