Copy link to clipboard
Copied
When using multiple pieces of vector art I've noticed that performance gets rather sloppy, so I created a simple test program that displays 100 copies of the same graphic and allows zooming. I used what I believe to be a fairly simple vector image (can see links below). However, fps drops massively when zooming in or out. I know zooming requires a lot of calculations, but I have an above average system (i5 2500k processor) that I would expect to handle such demands. Is there something I'm missing? or is vector art just not viable for my game (I would need lots of similar artwork on the screen at one time)
Picture of image - http://i.imgur.com/Cj50O.png
SVG file - http://pastebin.com/MjBLebFQ
Test Code: http://pastebin.com/Xmquy9Py
1 Correct answer
for optimum performance you should use bitmaps (or enable cacheAsBitmap). but if you're doing a lot of zooming that won't work unless you're publishing for a mobile and can use the cacheAsBitmapMatrix property.
Copy link to clipboard
Copied
for optimum performance you should use bitmaps (or enable cacheAsBitmap). but if you're doing a lot of zooming that won't work unless you're publishing for a mobile and can use the cacheAsBitmapMatrix property.
Copy link to clipboard
Copied
Oh wow, cache as bitmap seems to make quite a noticable improvement in performance. I didn't know that option was possible.
I will look into bitmaps, but I tried before and noticed the quality was poor when zooming. Lots of jagged edges. I tried using bitmapSmoothing but then my images were noticably blurry afterwards.
Thanks for the help again kglad. You are an absolute legend!
Copy link to clipboard
Copied
you're welcome.
if you're publishing for mobiles and can use cacheAsBitmapMatrix, you can import (or create) the highest zoomed bitmap you will need. then you won't have a problem with quality when zooming down. you will be consuming more memory so there are limitations on using bitmaps with zooming for mobiles.

