Copy link to clipboard
Copied
Hello,
I am working on a game for android with Adobe Air.
I would like to know if its possible to fill an existing background bitmap( that covers the screen) with bitmapData from a 64x64 movieclip so that the whole background image is covered by 64x64 tiled data as a pattern. If so how to do it since graphics.beginBitmapFill() method is available only to shapes and sprites.
If its possible will the GPU only cache the 64x64 image data or will it cache the whole background image data?
Will there be performance hit?
Thank you for your time.
Copy link to clipboard
Copied
you could do that using the draw method of the bitmapdata class, and your bitmap would be stored as the whole background image.
Copy link to clipboard
Copied
Thanks for the reply.
I can use bitmapData.draw() to draw the small image a number of times on the big bitmap, but wont that mean the bitmapData of the whole background image will be stored in memory.
Is there a way only the small 64x64 data is stored in memory and I can apply it to the background bitmap in a tiled manner?
I want to fill the background but only at the memory cost of a 64x64 image.
Would it be more memory efficient to have a number of small bitmaps(64x64). That way only the 64x64 data is stored by gpu. The tradeoff is more objects in the display list.
Copy link to clipboard
Copied
again, your bitmap would be stored as the whole background image.
the big trade-off is deciding whether you want to use a bitmap image which consumes memory, but is more efficient for the cpu to handle as long as the cached bitmap doesn't change, or use something that uses less memory but requires more work for the cpu.