Sign in to follow this  
Followers 0
timmyboobear

Best way to handle different screen resolutions?

3 posts in this topic

Hello, Is there an efficient way of handling this?

The thing is, I have to be able to publish my program for different screen resolutions.

For example;

screenresolutionperson1 = 2000*1000

screenresolutionperson2 = 1000*500

Some pseudo code to explain it:

$coords = Scanforcolour(0,0,x,y, COLOURCODE)

if coords[0] == 700 And coords[1] == 500 then

Excecute()

 

The coordinates of person2 will be different from person1 his coords.

Any ideas?

Thanks.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Look in the macro reference for @ScreenHeight and @ScreenWidth. Then calculate the ratios needed.

Edited by czardas

Share this post


Link to post
Share on other sites

If the program window or Gui keeps the same aspect ratio in all resolutions then you might simply calculate the percentage of desktop width and height for resolutions that are compatible.  If it is designed for a 16x9 res and the user switches to a 4x3 res or another then you may have to take into account the aspect ratio of that resolution's desktop during the calculations.  As example I have a window placement sizer utility that is dirt simple.  The user manually sizes the window then saves it.  Rather than put pixel width and height in  the .ini file I save the Window's position and percentage of screen height used and percentage of screen width used.  Changing to another res at least results in the window being totally on the desktop.  Not chopped.

 

Also there was an old tool that resized the program's main window to simulate various resolutions so you could get an idea how it looked, if the controls were chopped etc., without actually changing the screen res during development.  I don't remember the name of it though.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0