Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 1,170 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 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 | chip programmers | 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