GameGrin Gaming Forums
Home LANs Forums Reviews Previews

Go Back   GameGrin Gaming Forums > General Community Forums > Introduce Yourself

Introduce Yourself First time on our forums, introduce yourself & tell us a bit about you.

Thread Tools Search this Thread Display Modes
Old 01-08-2019, 10:26 AM   #1

Join Date: Aug 2019
Posts: 1
gm1688 is an unknown quantity at this point
We are having problem with multi resolution screen

we are creating a game with cocos2dx, the game is in portrait mode, our resource resolution is 9:16 (7201280), our design resolution is 480320, now when we are setting using it will work for 16:9 ration phone but when we are using 18.5:9 it won’t work can anyone help me with that
static cocos2d::Size designResolutionSize = cocos2d::Size(480,320);
static cocos2d::Size smallResolutionSize = cocos2d::Size(480,320);
static cocos2d::Size mediumResolutionSize = cocos2d::Size(1920,1920);
static cocos2d::Size largeResolutionSize = cocos2d::Size(1920,1920);

glview->setDesignResolutionSize(designResolutionSize.widt h, designResolutionSize.height, ResolutionPolicy::NO_BORDER);
auto frameSize = glview->getFrameSize();

if (frameSize.height > mediumResolutionSize.height)

director->setContentScaleFactor(MIN(largeResolutionSize.hei ght/designResolutionSize.height, largeResolutionSize.width/designResolutionSize.width));

// if the frame's height is larger than the height of small size.
else if (frameSize.height > smallResolutionSize.height)
director->setContentScaleFactor(MIN(mediumResolutionSize.he ight/designResolutionSize.height, mediumResolutionSize.width/designResolutionSize.width));
// if the frame's height is smaller than the height of medium size.

director->setContentScaleFactor(MIN(smallResolutionSize.hei ght/designResolutionSize.height, smallResolutionSize.width/designResolutionSize.width));
gm1688 is offline   Reply With Quote


multi, problem, resolution, screen

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 01:36 PM.

More on gaming

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2016 GameOn Networking Ltd, T/A GameGrin