Tween sprite or uicomponent?
I need to move 100+ sprites from right to left, for example, a hundred musical notes will be scrolling horizontally should be as smooth as possible, having tried move s:Group component found it to be inefficient with high CPU load even after apply updateafterevent(). Is it possible to scro开发者_JAVA技巧ll a large numbers of sprite smoothly?
Using Flash builder 4.
I've been working on a game engine for some time that uses BitmapData
and its copyPixels()
function to render extremely quickly.
The process is basically:
- Create a
Bitmap
object and attach it to the stage - this will be your Canvas. - Create an instance of
BitmapData
that represents the graphics for your notes (sprite sheet type) - this can be generated on the fly usingBitmapData
'sdraw()
method. - Create a class for your notes that has a property representing a reference to this sprite sheet.
- Loop through each of these objects and use
copyPixels()
from the Canvas to parse reference to the relatedBitmapData
.
If you visit my website you'll see a little demo of what the engine I've been working on that does the above can handle - 4000+ objects.
Many objects rendering smoothly:
精彩评论