Jan Lovšin
Jan Lovšin

Reputation: 171

Libgdx - textures

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!

Upvotes: 1

Views: 90

Answers (1)

m.antkowicz
m.antkowicz

Reputation: 13591

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

Upvotes: 1

Related Questions