Hi I am trying to run my very old code(year 2011) to new Xcode12. I am able to run it but my offset mess the UI. My SCALEX, SCALEY, OFFSETX, OFFSETY make the mess as that time device available is only iPhone4s and standard iPad. How to change those to Support all device avail today. Here is my old constant.
// Scale
#define SW ([[CCDirector sharedDirector] winSize].width)
#define SH ([[CCDirector sharedDirector] winSize].height)
#define SCALEX (1600.0f / 3.0f) / 800.0f
#define SCALEY 320.0f / 480.0f
#define OFFSETX ((1600.0f / 3.0f) - 480.0f) / 2
#define OFFSETY (320.0f - 320.0f) / 2
I am not very sure about how
SCALEXandOFFSETXis being calculated, but it seems the 480.0f and320.0fcan be substituted withand
The final expression would be
Please let me know if it produces better results, if we can know what 1600 and 800 values we can improve the soultion.