Libgdx - textures

↘锁芯ラ 提交于 2020-01-05 07:18:14

问题


If I create a texture of .PNG 1024 x 1024 and draw a circle in the middle that is 124 x 124, around it would be empty, does it use the same amount of RAM as if I would draw a circle 124 x 124 on a 124x124 space?

I could make all sprites in photoshop on a 1920 x 1080, and lay it out there already and then import all in game at a 0, 0 coordinate and all would lay out perfectly!


回答1:


Transparency has nothing to do with RAM usage - it depends on how big in decoded image it means that for picture 16x16 it will need 4 times more memory than for 8x8 no matter if it is transparent or not

Second thing is that by using pictures like this you will impact rendering performance because renderer will need to "iterate" over all pixels - also these transparent



来源:https://stackoverflow.com/questions/37050653/libgdx-textures

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!