johnbakers
johnbakers

Reputation: 24770

CCLabelBMFont memory usage

Do I understand correctly that CCLabelBMFont only loads the font texture once, no matter how many labels you have, thus 10 labels will not exceed the memory requirements of 1 label, or said another way, the actual memory usage of any and all labels is approx equivalent to the memory usage of the font texture itself?

I ask because I preferred to use CCLabel but when I compared it to UILable, the resolution of UILabel is much sharper; I'm not sure the cause of this but CCLabel just doesn't look that great.

Upvotes: 0

Views: 369

Answers (1)

CodeSmile
CodeSmile

Reputation: 64477

Yes.

Every texture cocos2d uses is cached only once. CCTextureCache does that, regardless of the class that created or loaded the texture. Memory-wise the only difference between using 1 CCLabelBMFont and 1000 is just the memory of the CCLabelBMFont instances. Which is roughly around 500 Bytes per instance.

Upvotes: 1

Related Questions