Cocos2d-x Display resolution problem in in iPad Air(4th Gen) and iPadPro 11 inch

Published

I used resource of 2048×1536 for all iPad device. Resolution is not perfect in iPad Air(4th Gen) and iPadPro 11 inch.

In all other iPad display correct.

Tested in Cocos2dx v4.0

Here is my code:

if (MyGameBridge::sharedGameBridge()->IsIpad())
       {
           auto designSize = Size(1024, 768);
           
           auto resourceSize = Size(2048, 1536);
           director->setContentScaleFactor(resourceSize.height/designSize.height);
           
           searchPaths.push_back("Data/iPad");
       }

Something wrong in my AppDelegate class..

Here is AppDelegate.cpp : https://app.box.com/s/i1zubskcq4hqky4e9depfcwlskm4xzmc

Here is Cocos2d v4 My Sample : https://app.box.com/s/6dp8o5ccbe8dtvulilficb3uk4b34keo
Please check and help me.

In this sample source, you can see iPad Air(4thGen) resolution problem, also in iPadPro(11inch)..works perfect in all other iPads. Using separate resource set for iPadAir(4thGen) may works..but how to use single set of graphics for all iPad?

Source: Ios Questions

Published
Categorised as c++, cocos2d-x, ios, iphone, xcode Tagged , , , ,

Answers

Leave a Reply

Your email address will not be published. Required fields are marked *

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq