I have a c++ app that scrolls big Sprites made with the drawing API (simple shapes though). I need to use software rendering because of the user computer. And I wonder what is the best method to optimize time rendering and memory.
For now, I create my Sprites with the drawing API and if I need twice the same Sprite on screen I clone it with clone.graphics.copyFrom(someSprite.graphics); And I addChild only what’s on screen and scroll everything.
But what if copy/past the drawing in BitmapData and use Bitmap instead? Is it better?
What if I use graphics.clear() and draw every frame instead of scrolling containers?
My goal is to reduce memory and CPU use in software mode.
You add one child for every image you draw with the api?
I dont know if is the best way but, I draw in just one sprite all the images and them mach with it position to know wath image i´m clicking on… and just scroll that sprite
It depends on a lot of factors. If the machine has enough memory to store the bitmaps (and some to spare for other tasks), they might still be fastest. On the other hand, if memory is a bottleneck, then vector graphics will be more likely to work better.
Speaking of vector graphics, have you considered using Shape rather than Sprite? That saves a little bit of overhead.