ImageFont, same font, 24 textures!!!

Discussion and feedback on Construct 2

Post » Tue Apr 26, 2016 2:52 pm

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.
[b]Andrew Donelson[b]
Nlaak Studios, LLC
https://www.nlaak.com/
[email protected]
B
15
S
3
Posts: 66
Reputation: 1,136

Post » Tue Apr 26, 2016 4:29 pm

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.
Image
B
79
S
29
G
12
Posts: 515
Reputation: 12,584

Post » Wed Apr 27, 2016 2:57 pm

Are you comparing the exported size or the capx? On export is when it optimizes finding duplicates and using the same image instead.
B
233
S
62
G
33
Posts: 902
Reputation: 40,398

Post » Sat May 14, 2016 12:38 am

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
[b]Andrew Donelson[b]
Nlaak Studios, LLC
https://www.nlaak.com/
[email protected]
B
15
S
3
Posts: 66
Reputation: 1,136

Post » Sun May 15, 2016 12:58 pm

You can also remove any chars that your game doesn't use, that usually helps with the size of spritefonts too.
ImageImageImage
B
63
S
23
G
78
Posts: 661
Reputation: 44,935


Return to Construct 2 General

Who is online

Users browsing this forum: Tjums and 13 guests