i’ve created a full spectrum color wheel Sprite object that is composed of 1440 vector triangles, or slices if you will.
since i want to animate the color wheel, i’ve activated the display object’s cacheAsBitmap property. however, caching the vector as a bitmap does not increase performance during animation – it remains slow, jumpy.
importing a PNG screenshot of the color wheel into the library with lossless compression, converting it to a Sprite, and rotating this new image asset performs great during animation.
why does an uncompressed PNG image asset import out perform the same vector image with cacheAsBitmap property set to true?
Because each time you rotate the object, it has to recalculate a new bitmap.
cacheAsBitmapis only intended for objects that are being translated, not rotated; from the docs:This is because the cached bitmap is copied pixel-by-pixel directly to the display surface (for speed — this is called blitting). Applying transformations to the bitmap every time it is rendered would be silly for objects that are rotated only once in a while. Recalculating the bitmap only when transformations are applied is a design decision which increases performance in the most common case, where transformations other than translation are infrequent.