Multi Resolution Using Cocos2d-JS for mobile browsers

  • Gurudath
    Likes 1

    Problem Description

    Hello,

     

    Am developing Web game using cocos2d-JS.

    My design resolution is :

    cc.view.setDesignResolutionSize(1212, 768, cc.ResolutionPolicy.NO_BORDER);
    

    When i run the game on IOS Safari browser or any android mobile browser game is not loading full screen. Corner buttons are going out of screen.

    Does anyone have sample working example code for multi resolution for mobile browsers. 

    I want to know is it possible to achieve Full screen game play in browser devices

     

    Thanks

    Gurudath

     

  • Sonar Systems admin
    Likes 0

    Could you show us a screenshot please of the problem.

  • Gurudath
    Likes 0

    Hello,

    I have made small mistake. I will check once again i will update you soon. 

    Thanks for the reply. 

     

  • Gurudath
    Likes 0

    Hello,

     

    Here is my code:

    cc.view.setDesignResolutionSize(1212, 768, cc.ResolutionPolicy.NO_BORDER);
    cc.view.resizeWithBrowserSize(true);

    I have checked in difference device.

    Ipad device OS Version 8 and above: Above code is working fine.

    Ipad device OS Version 7.1 browser: Corner part are getting cut. 

    https://www.dropbox.com/s/8k0lxoi25mxj01d/Ipad_OSVersion7.PNG?dl=0

    Tested in MOTO G Android mobile browser: Positions also displaying wrong

    https://www.dropbox.com/s/ngojsj3vf8j8mmf/AndroidMotoG.png?dl=0

    Tested in Iphone 5 & 6: Full screen is working fine.  But Address bar is appearing. Can we hide top and bottom notification bar. 

    https://www.dropbox.com/s/94cipki0jv78ekc/Iphone_5.PNG?dl=0

     

    Let me know your thought on this.

     

     

     

     

     

     

  • Sonar Systems admin
    Likes 0

    With web dev the bars are defo an issue.

     

    For Moto G try logging out the coordinates plus what browser are you using?

  • Gurudath
    Likes 0

    Hello,

     

    Moto G am using Google chrome browser. I found in design resolution if we give design resolution with the policy Fixed width is full screen is working fine. 

    Is there any alternative method to solve Iphone bars issue. Corner parts of the game are not visisble bcz of bars. So its difficult to play game sin Iphones

     

     

  • Sonar Systems admin
    Likes 0

    I would recommend web game for desktop devices and native app for mobile as Cocos2d-x is cross platform.

  • Gurudath
    Likes 0

    Okay. 

    That will be fine. 

     

     


    This reply has been verified.
  • Sonar Systems admin
    Likes 0

    Good to hear.

Login to reply