AggrorJorn Posted July 8, 2013 Share Posted July 8, 2013 Perhaps the topic can be moved here. http://www.leadwerks.com/werkspace/topic/7172-screen-size-and-mouse-coordinates/ I have been getting weird results with my GUI. I made a script that displays the x and y coordinate of the mouse. My window is 1024 x 768. I would expect that 768 is the bottom of the window, but the mouse coordinates indicate that height 768 is actually lower than the window. I have been getting weird results with my GUI. I made a script that displays the x and y coordinate of the mouse. My window is 1024 x 768. I would expect that 768 is the bottom of the window, but the mouse coordinates indicate that height 768 is actually lower than the window. I am not sure if this is intended or a bug. See the video attached: 768.zip 2.11MB 1 downloads The image shows a blue dot where my mouse is. I made an image which display a window of resolution 1024 x 768. Link to comment Share on other sites More sharing options...
beo6 Posted July 8, 2013 Share Posted July 8, 2013 i can confirm this. When i create a window with 1024x768 the window including the window title and borders is 1034x778 (measured with paint. pressing ALT and Print key ) But if you use context:GetWidth() and context:GetHeight() it fits perfectly. So i don't think it is an inaccuracy. however window:GetWidth() and window:GetHeight() return 1024x768. Maybe it is more of an inaccuracy of microsoft windows? Link to comment Share on other sites More sharing options...
Admin Posted July 14, 2013 Share Posted July 14, 2013 This is working as intended. Use Context::GetWidth(), GetHeight() to get the size of the drawable area inside the window. Link to comment Share on other sites More sharing options...
beo6 Posted July 14, 2013 Share Posted July 14, 2013 thats what i wanted to write. However the window that is created when i set the window size to 1024x768 is a bit larger when i measured it. So either my measuring is inaccurate or windows calculates the window size a bit different. Link to comment Share on other sites More sharing options...
Admin Posted July 15, 2013 Share Posted July 15, 2013 Confirmed. Link to comment Share on other sites More sharing options...
Admin Posted August 31, 2013 Share Posted August 31, 2013 Fixed the Mac version... Link to comment Share on other sites More sharing options...
Josh Posted August 31, 2013 Share Posted August 31, 2013 Wow, the plot keeps thickening. Apparently Microsoft can't accurately return the size of a window: http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/6c1c67a9-5548-4e9b-989f-c7dbac0b1375/getwindowrect-on-nonresizable-windows-under-aero-glass I tried adding a preprocessor define of "WINVER 6" in the code and in the project, but to no avail. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Admin Posted November 14, 2013 Share Posted November 14, 2013 This issue is resolved, for now. A link to this report has been added to the docs. Link to comment Share on other sites More sharing options...
Recommended Posts