Cocos2d-x JS Web adjustments to make text looks crispy

  • energyyzer
    Likes 0

    Problem Description

    Hi, as cocos2d-x team are working activly on javascript branch of engine to be able create Web games it is quite strange that from start you can’t launch project on the WEB with proper look and sharpnes.

    When you add Text labels in the game, they looks blurry. Can you please make tutorial: what should be adjusted in Cocos2d-x JS settings to make game look sharp(fonts) for WEB to make it production ready.

     

    Blurry text example: https://www.dropbox.com/s/7437ck0int2798f/Screen%20Shot%202015-08-24%20at%2016.43.18.png?dl=0

  • Sonar Systems admin
    Likes 0

    Could you send us a project for us to test out as that shouldn’t be the case

  • energyyzer
    Likes 0

    Hi,

    We created new project with simple Text line to test on Cocos2d-x JS 3.7.1:

    Without Framewroks(346kb):

    https://www.dropbox.com/s/drmb2ewn9bqm3e9/test_without_framework.zip?dl=0

    Project with Frameworks(195mb)

    https://www.dropbox.com/s/uf8br618z4qe5pj/testblurr.zip?dl=0

     

     

    Blurry text pic from our Mac:

    https://www.dropbox.com/s/bauxp2zh8c6gg18/Screen%20Shot%202015-08-25%20at%2015.21.53.png?dl=0

     

  • energyyzer
    Likes 0

    Hello, have you checked code or what do you think regarding that issue?

  • Sonar Systems admin
    Likes 0

    Figured out the issue, the resolution is too low

    change it in the following files:

    • index.html
    • main.js

    By default it is 800x450

     

    It needs to be bigger, I tried 1920x1080 and it worked well.


  • energyyzer
    Likes 0

    Hi I have changed

     

    main.js:

     

    cc.view.setDesignResolutionSize(1920, 1080, cc.ResolutionPolicy.SHOW_ALL);

     

    Index.html:

     

    canvas id="gameCanvas" width="1920" height="1080

    But still text is blurry, are you sure that you see it crispy? You using retina display?

     


  • Sonar Systems admin
    Likes 0

    Try 3840x2160

     

    What are you running it on?

  • Sonar Systems admin
    Likes 0

    But retina imac isn’t a wide spread machine, as long as it runs well on others for now its ok

  • energyyzer
    Likes 0

    We tested also on Macbook Pro 13 Retina and there is also same issue, can you please share you screenshot how text appears on your screen.

    As we want deliver to user perfect games with perfect visuals we trying our best to solve that issue.

  • Sonar Systems admin
    Likes 0

    Have you tried setting retina to false

        cc.view.enableRetina(true);

    in the main.js file

  • energyyzer
    Likes 0

    With retina enabled and 3840x2160 it looks better, but still not perfect. other resolutions gives bigger blurr. 

    How then to launch game, like get max dispaly resolution and run it in that mode(but still text not perfect), but if i need to run in smaller window how to handle it.

    What you think: is it global framework issue or our expectations is to high?:) 

    Would be interesting to see some other games developed for WEB using cocos2d-js to see if there is that issue or not.

  • Sonar Systems admin
    Likes 0

    Most people don’t have screens with a resolution that high so perhaps Cocos2d-x just isn’t designed for it yet.

  • bpdubey87
    Likes 0

    Hi All,

    Is that font issue resolved in Cocos2d js? I am still getting the issue, text is not clear (LabelTTF). I have changed many fonts and also tried different resolution ratio. But no luck so far.

    Plz Help!

  • Sonar Systems admin
    Likes 0

    On desktop?

Login to reply