Gamestudio Links
Zorro Links
Newest Posts
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
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (degenerate_762, NewtraderX), 856 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
sys_metrics(0) and sys_metrics(1) not showing the correct values #224936
09/02/08 01:40
09/02/08 01:40
Joined: Feb 2002
Posts: 288
California, USA
J
jaknine Offline OP
Member
jaknine  Offline OP
Member
J

Joined: Feb 2002
Posts: 288
California, USA
I am trying this on both a laptop with a widescreen monitor and my desktop with a 4:3 monitor. No matter what resolution I set my desktop to, 3DGS always returns 1280 and 1024 for the sys_metrics(0) and sys_metrics(1) values respectively.

Am I missing something? Aren't these variable supposed to return the current desktop resolution's width and height? Even if I set my desktop to 800x600, it still shows 1280x1024 in 3DGS.

Hopefully I've missed something crucial that will be easy enough to put in, because this has ground today's coding to a halt.

Re: sys_metrics(0) and sys_metrics(1) not showing the correct values [Re: jaknine] #224944
09/02/08 04:58
09/02/08 04:58
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
i tried this on my system. and i do get proper values. when i change my screen resolution. i go get a change in the values.

can u post ur code .. maybe something missing somewhere.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: sys_metrics(0) and sys_metrics(1) not showing the correct values [Re: delinkx] #224952
09/02/08 07:15
09/02/08 07:15
Joined: Feb 2002
Posts: 288
California, USA
J
jaknine Offline OP
Member
jaknine  Offline OP
Member
J

Joined: Feb 2002
Posts: 288
California, USA
Code:
function get_Desktop()
{
	theDesktopWidth = sys_metrics(0);
	theDesktopHeight = sys_metrics(1);
}

panel screen_size_panel =
{
  digits(10,10,"width: %.1f","Arial#16b",1,theDesktopWidth);
  digits(10,30,"height: %.1f","Arial#16b",1,theDesktopHeight);
  flags = VISIBLE, refresh;
  layer = 60;
}



Then I call get_Desktop(); in the code. No matter what I set my desktop resolution to the panel always says it's 1280x1024.

Re: sys_metrics(0) and sys_metrics(1) not showing the correct values [Re: jaknine] #224967
09/02/08 09:46
09/02/08 09:46
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
i dont find any problem with this. it should be running fine. the variables "theDesktopWidth" and "theDesktopHeight" are declared global ?


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: sys_metrics(0) and sys_metrics(1) not showing the correct values [Re: delinkx] #224970
09/02/08 10:52
09/02/08 10:52
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
Originally Posted By: delinkx
i dont find any problem with this. it should be running fine. the variables "theDesktopWidth" and "theDesktopHeight" are declared global ?


Without it being declared as global, it'd return 0.

I've tested your code and have it working on mine, are you sure that your pc isn't set up for 2 monitors, and it's reading the values of monitor 1 though it doesn't exist?

It's the only think I can think of smirk

Re: sys_metrics(0) and sys_metrics(1) not showing the correct values [Re: MrGuest] #225138
09/03/08 00:25
09/03/08 00:25
Joined: Feb 2002
Posts: 288
California, USA
J
jaknine Offline OP
Member
jaknine  Offline OP
Member
J

Joined: Feb 2002
Posts: 288
California, USA
I only have the one monitor and I checked my card settings to verify that it's not seeing two.

I made a completely new project to test this out and it's still not giving the results I would expect. This time it does actually change the results it gives, but they are off. For instance, if I set the desktop to 800x600 or 1024x768, it shows 640x480 on the panel. If I set the desktop to 1152x864 or even 1280x1024, it shows 1024x768 on the panel. In other words, even in this completely new project it's not giving the expected readings.

Here is the project, zipped up, if anyone wants to take a look and see what I'm doing wrong. - http://www.jaknine.com/3dgs/test.zip

Thanks for the help.

Re: sys_metrics(0) and sys_metrics(1) not showing the correct values [Re: jaknine] #225153
09/03/08 03:32
09/03/08 03:32
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
hi.. i hv fixed ur error. check ur mail. i sent the fixed code to ur mail.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: sys_metrics(0) and sys_metrics(1) not showing the correct values [Re: delinkx] #225154
09/03/08 03:35
09/03/08 03:35
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
u should note something. do u need the desktop resolution or the game resolution ? they are different. and the game resolution is set by the video_mode in your display00.wdl.

the desktop resolution can be any resolution but when u using video_mode, it sets the game at that resolution.

1 - 320x200
2 - 320x240
3 - 320x400
4 - 400x300
5 - 512x384
6 - 640x480 - (default mode)
7 - 800x600
8 - 1024x768
9 - 1280x1024
10 - 1400x1050
11 - 1600x1200

U can set the video_mode to any resolution u want at the beginning of the game or use "video_switch" to switch between resolution after the device has been opened.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: sys_metrics(0) and sys_metrics(1) not showing the correct values [Re: delinkx] #225155
09/03/08 03:53
09/03/08 03:53
Joined: Feb 2002
Posts: 288
California, USA
J
jaknine Offline OP
Member
jaknine  Offline OP
Member
J

Joined: Feb 2002
Posts: 288
California, USA
Wow, thank you so much Delinkx. I got your email, applied the changes, and now everything works perfectly. I thought I was losing my mind, heh. Much appreciated.

Re: sys_metrics(0) and sys_metrics(1) not showing the correct values [Re: jaknine] #225157
09/03/08 03:56
09/03/08 03:56
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
enjoy smile


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook

Moderated by  HeelX, Spirit 

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