Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / How to change screen size

Author
Message
AncientGamer
14
Years of Service
User Offline
Joined: 10th Jan 2010
Location: United States
Posted: 17th Aug 2014 18:31
I must have missed something. The setup file that used to be created with every project no longer appears to exist in the newer releases of AppGameKit V1 or V2. I need to change the screen size but I don't know how and my searches have been fruitless. Help please?

Windows 7 Home Premium 64-bit SP1
AMD FX-4100 Quad Core 3.6Ghz 8.0GB
NVidia GeForce GT 520 2GB
Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 17th Aug 2014 19:15 Edited at: 17th Aug 2014 19:33
AGK V2 has a new command called SetScreenResolution. The command-list in the Help function has some explanations for it's use, should you need them. (I believe you just specify X and Y).

EDIT:
Ah, turns out I was wrong: you need to specify if you want your program to run fullscreen as well. Like this:


0 = windowed
1 = fullscreen
AncientGamer
14
Years of Service
User Offline
Joined: 10th Jan 2010
Location: United States
Posted: 17th Aug 2014 23:54
Thanks for the reply. I tried this, it leaves the window on the PC the same and simply changes the resolution of the viewable area within the window. I attached a before and after.

Windows 7 Home Premium 64-bit SP1
AMD FX-4100 Quad Core 3.6Ghz 8.0GB
NVidia GeForce GT 520 2GB

Attachments

Login to view attachments
Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 18th Aug 2014 14:37
Yes, that is how it should work. If you specify a 0 for the 'fullscreen' statement, the command will only resize the window of your application to the desired values.

If you want to change the actual resolution of the screen, you need to specify a 1 for the fullscreen-statement. I don't think you can change the resolution *and* specify the program to run in a window at a desired size at the same time.

I hope I am understanding your problem correctly, though Your screenshot shows several overlapping images. It might be that their height is being miscalculated?
AncientGamer
14
Years of Service
User Offline
Joined: 10th Jan 2010
Location: United States
Posted: 18th Aug 2014 19:27
The problem seems to be with the "AddVirtualButton" command, or so it would seem. This code is from "HandsOnAGK" by Alistair Stewart. No matter what I try I can't seem to get the buttons to line up correctly at the top right of the screen. I could do this previously by editing the "setup.agc" file, but it no longer exists.

Here is the code I am using where I call the function:


Windows 7 Home Premium 64-bit SP1
AMD FX-4100 Quad Core 3.6Ghz 8.0GB
NVidia GeForce GT 520 2GB
Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 18th Aug 2014 22:35
Ah, I see. I currently do not have access to my PC, so I can't test the code you've posted. However, I wonder what happens if you add a 'SetVirtualResolution' command after SetScreenResolution. You can give it the values you used in the old setup.agc. This way, your program should emulate the way the example-code from Alistar's book is handled, only in a windows of your own desired size.
AncientGamer
14
Years of Service
User Offline
Joined: 10th Jan 2010
Location: United States
Posted: 19th Aug 2014 03:55
Thanks Zerotown, I used SetScreenResolution followed by SetVirtualResolution and used virtual pixels to size the images and to position them. Works fine now!

Windows 7 Home Premium 64-bit SP1
AMD FX-4100 Quad Core 3.6Ghz 8.0GB
NVidia GeForce GT 520 2GB
Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 19th Aug 2014 08:55
Glad to hear that!!

Login to post a reply

Server time is: 2024-11-25 07:48:57
Your offset time is: 2024-11-25 07:48:57