Resolution in iPhone

miguetrek

New member
Joined
Aug 23, 2017
Messages
5
Hello,
I'm new in monkey/cerberus and I've been testing for a few days, but my app not get the correct resolution in IOS. I have created a basic program (code shown), built with "IOS Game" target, opened the project in xcode and run for iphone5 emulator. The resolution shown is low and incorrect, and the text does not appear in the upper corner (screenshot).
Is it a bug or am I doing something wrong?

code:
Code:
Import mojo

Class MyApp Extends App

Method OnRender()
DrawText DeviceWidth+"x"+DeviceHeight,0,0
End

End

Function Main()
New MyApp
End

screenshot:
iPhone5.png
 

Martin

Active member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
Joined
Jun 19, 2017
Messages
334
You have to add a correctly sized launch images within xcode. I know this sounds strange but that way you get the correct size.
 

miguetrek

New member
Joined
Aug 23, 2017
Messages
5
Thanks Martin! I have added a blank launch image of size 640x1136 and now goes right.
I have been a couple of years without developing for mobile and i had forgotten the strangeness of xcode/ios :)
 

APC

Member
Joined
Aug 8, 2017
Messages
45
Hello Mike,'
Do you guys have the Launch Screen for iPhone 11 Xs Max (2688 × 1242 pixels) and iPhone Xr ( 1792 × 828 pixels)?

The Defaulf image that is generated by Cerberus is 640x1136 pixels, this is the maximum resolution I get from my iPhone Xs Max.
 

APC

Member
Joined
Aug 8, 2017
Messages
45
I added two additional default images 1792 × 828 pixels for iPhone Xr and 2688 × 1242 pixels for iPhone Xs Max , but when I run on the simulator for iPhone Xs Max, the DeviceWidth() and DeviceHeight are retuning 1704 x 960 on the iPhone Xs Max on the Simulator and on my iPhone Xs Max this id not the correct resolutions.
What can I do to get the correct resolution from the Device? I am Using Cerberus v2020-05-09
 

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
643
I don't have a clue about xcode and ios, because I don't have any devices. But did you look into this last answer on StackOverflow?
If you have to create a storyboard, this video might help.
 

APC

Member
Joined
Aug 8, 2017
Messages
45
Phil7 Thanks for your response, I know that and I have all screen resolutions on my assets catalog, this game I am updating was also released before when it was Monkey X.’The questions is why the screen resolution Is incorrect ? Also the issue happens in the Simulator.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,167
I will look into this during my vacation wish starts in 10 days.
 

APC

Member
Joined
Aug 8, 2017
Messages
45
Hello Mark, were you able to confirm if Cerberus is returning the correct resolution from the Device? You can confirm my issue using the Apple Emulator.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,167
My name is Michael.

And sorry, so far i had no time to look into this but i hope soon.
 

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
643
I was able to display it in the native resolution of 750x1334 in the iphone SE simulator by adding a "Launch Screen.storyboard" file like described on this site.
Otherwise I also couldn't get a higher resolution than 640x1136 by changing the launch image. So I deleted it and added the mentioned file in xcode. The only thing I had to do was to disable "Safe Area Layout Guide" with the file inspector in the storyboard file.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,167
@APC I have uploaded the changes suggested by Phil7 to Github. Works fine here. If you need further help, please let us know.
 

APC

Member
Joined
Aug 8, 2017
Messages
45
@APC I have uploaded the changes suggested by Phil7 to Github. Works fine here. If you need further help, please let us know.
Hello @MikeHart and @Phil7, thank you so much for fixing it, switching to storyboard launch screen is the way to got with iOS. I tested and the resolution issue is resolved! I downloaded the Cerberus_v2020-09-12 but it did no have the Cerberus application so just copied the iOS target files over to my version Cerberus_v2020-05-09. ad a suggestion on the Storyboard screen you could add the Cerberus Logo .
Now I will keep testing with other device sizes.
 
Last edited:
Top Bottom