Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17071

Resolution problem with different screens

$
0
0

@hgokturk wrote:

Hi. I'm creating a game. This is my AppDelegate for scaling:

    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if (!glview) {
        glview = GLViewImpl::create("Kelimece");
        director->setOpenGLView(glview);
    }

    //director->setDisplayStats(true);

    director->setAnimationInterval(1.0 / 60);

    auto screenSize = glview->getFrameSize();
    Size designSize = Size(320, 480);
    Size resourceSize = Size(640, 1136);
    director->setContentScaleFactor(resourceSize.height / designSize.height);
    director->getOpenGLView()->setDesignResolutionSize(
        designSize.width, designSize.height, ResolutionPolicy::FIXED_HEIGHT);

The game is a portrait game and the assets designed for 640x1136.
Here is the screenshot of how it looks on 1080x1920 Galaxy S4.

And here is how it looks on 720x1280 M4 Aqua.

So, you see the difference of gaps between the boxes and the position of the left most and right most boxes relative to the edges. The ideal look is the S4 one. Can anybody explain what is wrong with my set of scaling? And what is the best way to create what i am looking for? Thanks.

P.S: sprites positioned using percentage.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17071

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>