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 Studio Chat / [SOLVED] Windows screen resolution help

Author
Message
Spadey
7
Years of Service
User Offline
Joined: 5th Sep 2016
Location:
Posted: 1st Sep 2019 16:02
Hi,

I am currently creating my first windows based game using AppGameKit Studio and its coming along fine but i have a question regarding screen resolution.
In screen manager i have selected the resolution of 1366x768 (most used 2019 desktop) when i run the game i get a windowed version (my current screen monitor res it at 1920x1080).
When i resize to fullscreen (using the window maximise button) the game doesn't seem to be keeping the virtual resolution I've set in the code of 1366x768, for example the background doesn't quite fit anymore etc.
Now i might be doing this in the wrong way so please advise if i am but my understanding is setting the virtual resolution within the code will keep that res whatever the window size is?

My aim is to get the game running windowed and be able to minimise / maximise the window but keeping the same virtual screen resolution. Is this possible? Also is there away to lose the window top bar when the windows is maximised?

Any help would be appreciated,

Thanks

Richard

The author of this post has marked a post as an answer.

Go to answer

Onomatopoesie
4
Years of Service
User Offline
Joined: 6th Aug 2019
Location: Germany
Posted: 1st Sep 2019 16:14
Use SetWindowSize(1920,1080,1) to get a fullscreen window without the top bar.
Spadey
7
Years of Service
User Offline
Joined: 5th Sep 2016
Location:
Posted: 1st Sep 2019 18:04
Thanks but when i setwindowsize(1920,1080,1) i still get a windowed version (see image)

in the screen shot the text is showing windowsize


print ("window size : " + str(GetWindowWidth()) + " ... " + str(GetWindowHeight()))
print ("device size : " + str(GetDeviceWidth()) + " ... " + str(GetDeviceHeight()))

Thanks

Attachments

Login to view attachments
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 1st Sep 2019 18:59
The last parameter of SetWindowSize() needs to be 1 (one).
You have written that as though you have done it but the screenshot proves that you have not because when you do, the game runs in full-screen mode with no title bar.

Try it again with the last parameter correct and you should see a difference.
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 1st Sep 2019 19:05
I don't know if this could be your problem, but if you call SetScreenResolution in fullscreen mode and it doesn't match your native resolution, it will force windowed mode. This is because agk doesnt support setting the render (backbuffer) resolution to anything other than the window size.
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 1st Sep 2019 19:15 Edited at: 1st Sep 2019 20:34
This post has been marked by the post author as the answer.
https://www.instagram.com/qugurun/
Spadey
7
Years of Service
User Offline
Joined: 5th Sep 2016
Location:
Posted: 1st Sep 2019 19:54
Thank you all for your help.

@Scraggle : I was setting the window size with a 1 but what i didn't realise was i was doing the scene_setup() after that and in the scene script it sets the window size again, this time with a 0!

@Quguron : Thanks that works great but it does lead me to another question : i have a 3 monitor setup, my main monitor being at the res 1920x1080 and your code works fine. My other 2 monitors are working at a lower res but if i drag the windowed game on to the smaller res monitor and run your code it defaults back to the main 1920x1080 screen. I suppose my question is : is there anyway for AppGameKit to know which monitor i'm on and use that res?

It's great to know that there are so many other users of AppGameKit that are so quick to lend a hand.

Once again thanks you.

Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 1st Sep 2019 21:54 Edited at: 1st Sep 2019 21:57


I'm not sure. Let me know if this works now.
https://www.instagram.com/qugurun/
Spadey
7
Years of Service
User Offline
Joined: 5th Sep 2016
Location:
Posted: 2nd Sep 2019 19:28
@Qugurun
Thanks for the reply, tried this and it still functions the same way, no matter which monitor i'm on it always defaults back to the main monitor at 1920x1080.

No worries, it's a lot better then it was so i can live with it like this if that's the best it's going to be.

Once again thank you for all your help.

Rich


Login to post a reply

Server time is: 2024-04-20 07:21:34
Your offset time is: 2024-04-20 07:21:34