How to find resolution in Delphi XE5

I started developing a game for Delphi XE5 for iOS. I have a problem with the Firemonkey permission function.

When I open the screen and I check the resolution on the iPhone, I get 320x480. But the native resolution of the iPhone 4 and 5 doubles. I found on the official Delphi pages that FireMonkey recounts the screen using "Resolution", which is for displaying Retina 2.

I think this is a cool feature for regular applications, but when you start to make a game and want to manipulate images by code, it brings strange situations.

My question is, is there a way to find the actual resolution value, or at least what is the actual type of device (iPhone, iPad?)

thanks

+7
ios delphi firemonkey 2d-games delphi-xe5
source share
1 answer

ok, we found the answers.

There is an FMX.Platform module that processes very important data.

var ScreenSvc: IFMXScreenService; begin if TPlatformServices.Current.SupportsPlatformService(IFMXScreenService, IInterface(ScreenSvc)) then begin <your code> end; end; 

and result values:

  ScreenSvc.GetScreenSize.X ScreenSvc.GetScreenSize.Y ScreenSvc.GetScreenScale 
+3
source share

All Articles