How do I Optimize spritefont on mobile?

0 favourites
From the Asset Store
Forget about default textbox restrictions, you can create sprites atop of the textbox
  • I use a spritefont.png which is 256x256, but load like 1500 or even 1000 words in it, and on the first gen ipad mini it totally drops to 2 FPS

    This is a clean project, I have NOTHING else.

    Any ideas how to optimise? Can I somehow turn off collision checks? Is it up to CoocoonJS to fix it? Any tips?

  • Even just 270 words on one spritefont object causes -30 FPS. I think that CocoonJS loads ALL the sprites, visible or not. Damn it. This would've solved so much for the project I'm working on.

  • I hope i get you right, you got a 1500 words of text(sprite font) in your project? Is it static or you change it through events? Yeah, and spritefont not check for collisions.

  • completely static, completely new blank project. It just stays there and it syphons precious CPU

    It drains a lot even on 200 words loaded in it. Does it not do that on your export? And I'm using the default spritefont sheet, not some fancy big other one.

  • completely static, completely new blank project. It just stays there and it syphons precious CPU

    It drains a lot even on 200 words loaded in it. Does it not do that on your export? And I'm using the default spritefont sheet, not some fancy big other one.

    Can you please show me your capx? I think i had the same problem, i just use one sprite where all giant static texts typed, i can't found a better way to fix this.

  • It's really just a new project, with a spritefont, and random text added to it, that is 900 px wide, and 3000 px high.. nothing else. If you still want, sure I can make it again and upload it.

  • Sisyphus Could you trace your steps so I know what you've tried?

    I tried changing almost every function separately, to see if magically it works. That didn't help.

    I tried disabling webgl, NO.

    I tried lowering text quantity (FPS increased, but just by a little. still 200+ words lag awfully)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It's really just a new project, with a spritefont, and random text added to it, that is 900 px wide, and 3000 px high.. nothing else. If you still want, sure I can make it again and upload it.

    Oh, i just want to be sure that i understand you right, my english is not perfect, but now i think that i got it right

  • Sisyphus Could you trace your steps so I know what you've tried?

    I tried changing almost every function separately, to see if magically it works. That didn't help.

    I tried disabling webgl, NO.

    I tried lowering text quantity (FPS increased, but just by a little. still 200+ words lag awfully)

    Well, i didn't do anything, i just replace all spritefonts to a sprites with text's when noticed the fps lowering

    UPD: I just try to open a project with 2 sprite fonts with random text 1000x3000 in mobile browser, and fps is still 60! In cocoonjs launcher i have only 15fps with that project. So i think it's a problem in cocoonjs, try to report it to ludei.

  • Ludei have never replied to anything I've written... I don't think they will on such a seemingly marginal problem. Damn it. I was rather hoping that it's a problem on my device only.

    Although I bet that spritefont can be maybe tweaked for CocoonJS to delete what is no on screen, so it doesn't drain resources.

    Spritefont would've worked so perfectly for me project... damn.

  • Are you sure you are not "generating" the text every tick ?

    It's not clear from your explanation, but do you set the text content in a "On start of layout" event or any kind of triggered event of the like ?

    Otherwise you are generating a 900X3000 texture every tick and wondering why it is eating CPU.

  • Kyatric Nope, definitely not

    It's just a single spritefont box with text on it, no code whatsoever. Try it out if you have an ipad. If not, I can provide video evidence and fingerprints of perpetrators (that last part made no sense, still a serious issue though )

    Thanks for the help anyway

  • Ludei have never replied to anything I've written... I don't think they will on such a seemingly marginal problem. Damn it. I was rather hoping that it's a problem on my device only.

    Although I bet that spritefont can be maybe tweaked for CocoonJS to delete what is no on screen, so it doesn't drain resources.

    Spritefont would've worked so perfectly for me project... damn.

    Maybe try crosswalk or ejecta? I can't try it now, but i try that sprite font problem in chrome and have 60fps, if crosswalk is like chrome it's gonna be the solution for you.

  • Are you sure you are not "generating" the text every tick ?

    It's not clear from your explanation, but do you set the text content in a "On start of layout" event or any kind of triggered event of the like ?

    Otherwise you are generating a 900X3000 texture every tick and wondering why it is eating CPU.

    I make an example capx, event sheet is empty, works with 60fps everywhere except cocoonjs, after cocoonjs export or in cocoonjs launcher it gives 45fps.

    [attachment=0:1fk8qsez][/attachment:1fk8qsez]

  • Sisyphus , What device are you using on CocoonJS? Thanks for the example btw

    I'm going to attempt using Ejecta or Intel XKD since they have no Intro Logo like Ludei, and maybe they have their shit fixed with spritefonts, but I'm afraid I might be a bit dumb for the whole procedure. Is it complicated?

    I've already published one game on appstore via CocoonJS, and that took a moderate amount of time to handle

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)