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 / Windows - Minimum window size

Author
Message
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 15th Apr 2021 08:07 Edited at: 15th Apr 2021 08:13
I've currently got something like so to handle window resizing:

However, when the window size goes below 512 the window flickers a lot and occasionally the window still ends up smaller that 512.
Is there a built-in way with the WinAPI to restrict window size? Can we get an AppGameKit command to restrict window size (min & max) while using SetWindowAllowResize(1)?
Loktofeit
AGK Developer
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 15th Apr 2021 14:23
You could add a line in your main game loop to check window size and if it is below 512, make it 512.
LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.
Use virtual resolution instead of the default percentage system." - Digital Awakening
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 16th Apr 2021 22:29 Edited at: 16th Apr 2021 22:29
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 17th Apr 2021 17:17
My window close plugin already hooks into the agk window callback so I added a few lines to set the MINMAXINFO structure

// Resizing Window
WC.SetMinTrackSize(300, 300)
WC.SetMaxTrackSize(900, 700)

Example: (plugin attached)

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-24 04:19:06
Your offset time is: 2024-11-24 04:19:06