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.

DarkBASIC Professional Discussion / Detect window size?

Author
Message
NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 8th May 2010 16:06 Edited at: 8th May 2010 16:08
Hi,

I'm just experimenting with using windows. Is there a way of detecting if the window has been sized? I'm trying to make them react well to a resize. I know this has been mentioned before, but I've not found a good way of doing this...PureGDK looks tempting now

EDIT - Sorry slightly misleading topic title. I know how to get the window size, just can't seem to find a way of detecting if it has been resized.
=PRoF=
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 8th May 2010 17:06
you could store the original size as a variable, and then check against the current size?

NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 8th May 2010 18:50 Edited at: 8th May 2010 19:52
Quote: "you could store the original size as a variable, and then check against the current size?"


Thats the first thing I tried...after looking through Ian M's matrix plugin for a command I thought was in there. I can't seem to get that to work. I've done that sort of thing a million times with other stuff.

I'll have another go...

EDIT-I've solved it but not exactly how it was suggested, but why does changing the resolution delete objects? If I was to make something with multiple complicated objects that could be annoying having to load objects and placing them everytime the window is resized.

EDIT2-It also crashes when maximised. Heres my VERY rough code. This does use MatrixUtil commands
NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 9th May 2010 02:30 Edited at: 9th May 2010 03:18
EDIT - Removed
sladeiw
17
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 9th May 2010 03:27 Edited at: 9th May 2010 03:29
When you maximize the window, the window client height will no longer match the screen height. This makes your resize code run every loop when the window is maximized. Add this just below your print statements to show:



Client and screen dimensions are not always the same depending on window border sizes etc.
NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 9th May 2010 13:37 Edited at: 9th May 2010 13:41
Thanks, Yeah I realised that lastnight, which is why I removed whatever I said in my next post . I've fixed it now.



EDIT- Again, this is only rough code
sladeiw
17
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 9th May 2010 13:45 Edited at: 9th May 2010 13:46
Quote: "
I removed whatever I said in my next post
"


Yea I should really refresh the thread before answering
Edit: Also, posting your `it dosent work code` usually causes you to find the solution yourself within the next 5 minutes! Try it - it works!

What type of app are you planning on writing btw?
NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 9th May 2010 13:49 Edited at: 9th May 2010 13:51
Quote: "Also, posting your `it dosent work code` usually causes you to find the solution yourself within the next 5 minutes! Try it - it works!"

Hehe yeah you do tend to think of a new angle of attack

Quote: "What type of app are you planning on writing btw?"


Not sure, just having a break from my game project. I've been curious about this for a while so thought I'd have a go this weekend...before and after the F1 of course

EDIT - I do have app ideas, just not sure if I'll make them right now.

Login to post a reply

Server time is: 2026-07-26 02:37:26
Your offset time is: 2026-07-26 02:37:26