Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,466 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Changing resolution to users desktop size. #240070
12/09/08 06:11
12/09/08 06:11
Joined: Mar 2004
Posts: 71
Scotland
westray Offline OP
Junior Member
westray  Offline OP
Junior Member

Joined: Mar 2004
Posts: 71
Scotland
I have searched but cannot find a clear answer to this question.How can I get the programme to determine the end users desktop resolution and change the game resolution to this.I realise that any panels etc. will have to be scaled and repositioned at differant resolutions.I need this because some of my friends have wide screen monitors and the game looks stretched at 4:3 resolutions.

Re: Changing resolution to users desktop size. [Re: westray] #240085
12/09/08 11:07
12/09/08 11:07
Joined: May 2008
Posts: 150
Switzerland
Hitsch Offline
Member
Hitsch  Offline
Member

Joined: May 2008
Posts: 150
Switzerland
The present system resolution can be determined by sys_metrics(0) and sys_metrics(1).

Now you can just set the resolution like this:

Code:
set resolution
video_set(sys_metrics(0),sys_metrics(1),32,1);


That way the engine resolution is always the system resolution.
As for the Panels. I use my normal system resolution of 1280/1024 to place them and find the right size and then a function adjustes the variables to any other system resolution. I don't know if this is the best solution but it works alright for me.

Code:
resx = screen_size.x;
resy = screen_size.y;

function adabtScrSizePanel(PANEL* tempP)		
{
tempP.pos_x = tempP.pos_x * (resx/1280);
tempP.pos_y = tempP.pos_y * (resy/1024);
tempP.scale_x = tempP.scale_x * (resx / 1280);
tempP.scale_y = tempP.scale_y * (resy / 1024);
}



Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1