Copy link to clipboard
Copied
Hi everyone!
I'm working on a little game and I was wondering about the efficiency of my blit class.
The way I see it I can do it in 2 ways:
1-Each displayed object contains a bitmapdata instance of the blitted image.
2-Each displayed object contains an array which holds the frames of the blitted image.
I was wondering about the pros and cons of each method (CPU, RAM, render speed, ect...), would like to hear from you
Thank you very much!
then it doesn't make any significant difference unless some of the data are duplicated in 1 or 2. the display is still fully blitted with both.
the only difference is 1 has more objects that contain the bitmapdata and 2 has fewer objects but each contains more data. in general, they both contain the same total amount of data.
Copy link to clipboard
Copied
do you mean:
1. each object used to update the display is a bitmapdata instance that you then blit to the stage?
2. each object is an array of bitmapdata instances each representing the display of some movieclip's frames which you then blit to the stage?
Copy link to clipboard
Copied
Yep...
Copy link to clipboard
Copied
then it doesn't make any significant difference unless some of the data are duplicated in 1 or 2. the display is still fully blitted with both.
the only difference is 1 has more objects that contain the bitmapdata and 2 has fewer objects but each contains more data. in general, they both contain the same total amount of data.
Copy link to clipboard
Copied
Thank you!
In that case I'll guess i'll go with 1, its more straightforward.
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now