Cocos2d-x and multiresolution system

  • thejavelin
    Likes 0

    Problem Description

    I know this is the 983498th question about this topic but I don’t care, it is still not clear for me and your videos doesn’t clarify this enough however this would be the most important thing in the developing process, yet you prefer everything else. :s

    So what is the main concept about multiresolution support?
    I’ve read somewhere that your advice is to use only one aspect ratio which is held by 768*1136 resolution in portrait mode, in addition make another asset folder half of this size and another one doubled (that would be: 384*568 and 1536*2272) so these 3 resolutions would be enough to cover all devices. Easiest way is to make the biggest one, name it something like “HD”, resize the sprites and backgrounds in that asset 50% “Normal”, and resize it again “Small”.

    Next in your AppDelegate.cpp or main.js add the following line (I don’t know the right syntax I’m just writing this from head, can’t remember correctly):

    setDesignResolutionSize(768, 1136, cc.ResolutionPolicy.NO_BORDER);

    NO_BORDER basically stretches the background/sprites to fit your device’s screen, this means some parts of the background won’t be displayed due to your screen size/aspect ratio (the edges most likely). SHOW_ALL policy would just cut off these “extra parts”, sometimes giving “black lines” on the edges just like in the movies on the TV. This will hold the original aspect ratio though.

    Still I have no clue how to develop a game like this. Even if I manage to make the backgrounds how do I place the sprites on the game field for example. I can’t use setPosition(0, 0) on a different screen than 768*1136 because if I have smaller screen, setPosition(0, 0) will place it somewhere I cannot see it due to the cut off parts. 

    Please take the time to give a more detailed answer about this, many of us would be grateful, really. :D


  • Sonar Systems admin
    Likes 1

    We will be doing a new series covering this in depth along with Cocos Studio in roughly 3-4 weeks.


    This reply has been verified.
  • thejavelin
    Likes 0

    Finally :D!


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

    indeed :D


    This reply has been verified.

Login to reply