ActionScript 3.0 - Blitting with repositioning sprite sheet vs. copyPixels?
-
07-02-2021 - |
Question
which is more performant for blitting - repositioning a sprite sheet within a scrollRect or using copyPixels()?
Solution
Without doing any test I will answer copyPixels.
In the first case you have 2 objects: a sprite sheet which may be quite large and another object which may be quite complex, there is a masking process involved. You lose all the interest of blitting.
In the second solution you have a very low-level operation (copying pixels) and a single display object (the bitmap). The spritesheet is not even loaded in the display, this is by far the lightest solution in my humble opinion.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow