1

which is more performant for blitting - repositioning a sprite sheet within a scrollRect or using copyPixels()?

Charles
  • 50,943
  • 13
  • 104
  • 142
Chunky Chunk
  • 16,553
  • 15
  • 84
  • 162

1 Answers1

3

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.

Kodiak
  • 5,978
  • 17
  • 35