开发者

Invisible sprites still take up a lot in memory

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜