which is more performant for blitting – repositioning a sprite sheet within a scrollRect or using copyPixels()?
which is more performant for blitting – repositioning a sprite sheet within a scrollRect
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.