So my game uses the same ImageFont for 24 different "Texts" and I noticed the size of my app increase dramatically. The font size, optimized is 117k. Multiply that by 24 exact images and my app increased by 2,808,000 (2.8 MB). Why is the same texture being duplicated? Is this a bug? is there a work around? I was going to try load image from URL but it is not supported. Any info would be appreciated. Thanks.
Different objects uses different textures, if you want to share the texture, use different instances of the same object.
For sprites, if you use the same image for more than 1 frame/animation on the same object, it won't get duplicated.
Are you comparing the exported size or the capx? On export is when it optimizes finding duplicates and using the same image instead.
Develop games in your browser. Powerful, performant & highly capable.
Yeah I was stupid. I wasn't using the same instance of the object with different text. I don't know why I did that but I have since corrected it. Thanks
You can also remove any chars that your game doesn't use, that usually helps with the size of spritefonts too.