AS3 Poor performance at the edges of a large stage

Using the large scene size of 3840 x 2160, I see performance issues when animating small sprites around the edges of the scene.

I can add hundreds of them to the scene without problems, but if they are near the edges, problems arise. Is there anything I can do to fix this?

Update:

sprite.cacheAsBitmap = true was the reason for me. Setting to false fixed the problem.

+4
source share
1 answer

This is probably due to the way the flash player displays the screen. He redraws everything that is between the four outer redrawn coordinates. (leftmost, rightmost, highest, lowest)

This means that if you have only two pixels with coordinates 1600,1000 and one at 1800,1200 that have changed between frames, then only an area of ​​200x200 pixels will be redrawn. If, however, you have a 10.10 pixel and one at 3830.2150 that you want to redraw, then you need to rewrite the area with a resolution of 3820x2140 pixels. This is a lot of pixels. (8.174.800)

This is true even if nothing has changed between these four external pixels.

+1
source

All Articles