i was wondering that currently in my app i have some big one-color rectangular shapes made with lineto etc. which i use e.g. as backgrounds for specific parts of the screen and i realized that maybe for such a thing this is not so efficient. would it be better to make a small (1x1 pixel?) shape and scale it, so that i don't consume much memory? or should i load a 1x1 pixel bitmap of the needed color and show that or perhaps should i make a color-mesh (with no texture)?
which is most memory efficient (normal memory/graphics memory) and which is fastest? is there much difference?
i note that my stage does not use scaling and currently i generate the rectangle(s) respective to the actual size of the screen, so they can be actually pretty big, although i don't have many naturally, together they fill the screen let's say.
Comments
On the other hand using any texture should be less efficient than solid color.
I had exactly the same question.
Without doing any testing (just like @Ar2rsawseen), I guessed that maaaaybe avoiding image files would be the quickest, most efficient method; so I tried that first (like you did, by the sound of it).
One scene in my app contains 68 rectangles and (in the desktop Gideros Player and in Xcode's simulator) it loads in an instant - like lightning! I hope it will be just as fast on mobile devices. (Is that a naive assumption?)
Anyway, one reason I am very glad I did it that way (the same way you did) is that I don't have to go back into Photoshop to make fine adjustments to the colour scheme or transparency. They can be adjusted in two keystrokes. Beauty!
Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
so i stick with shapes, but any additional opinion is welcome about meshes vs shapes.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game