开发者

Invisible sprites still take up a lot in memory

开发者 https://www.devze.com 2022-12-19 06:33 出处:网络
Just curious, if I have a sprite开发者_如何学编程 on the stage with the alpha set to 0 does that take up just as much memory as a sprite that is visible?

Just curious, if I have a sprite开发者_如何学编程 on the stage with the alpha set to 0 does that take up just as much memory as a sprite that is visible?

I imagine it does because it draws the sprite to the stage and then it has to set the alpha to zero.

It may seem like a stupid question but I just wanted to verify.


Yes, the memory footprint will be the same, and much worse, it will use up gpu/cpu resources as well, as it is, as you say, drawn to the stage, albeit invisibly.

If you don't need to display a sprite removeChild it or set visible = false, which neither will save up on memory, but will reduce gpu/cpu load.

0

精彩评论

暂无评论...
验证码 换一张
取 消