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 / problem with GetScreenBounds. Could be a Bug. Not sure.

Author
Message
Dark Raven
9
Years of Service
User Offline
Joined: 27th Jul 2014
Location: United States
Posted: 11th Jul 2018 08:15
I'm not sure if I'm doing something wrong or if this is a Bug but when creating a program in both tier 1 and porting it to tier 2 I'm getting different results when using GetScreenBoundsTop and I'm guessing that the other bounds commands does the same. The code that I've been experimenting is the Endless Tunnel which uses GetScreenBounds on the score text. When I run it on Windows basically GetScreenBoundsTop returns 0 and the score text actually displays as it should. But when taking the same code to a linux based OS (Linux and Android) I'm getting a completely different number for the bounds and the score text doesn't show because the top bound come up as a high negative number. On Linux with same resolution; same settings in the code; I'm getting a -120 as the Top bound instead of 0 which is windows returns.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 11th Jul 2018 09:23
try to draw lines as rectangle to visualize the border.
the outerbounds is the area where you would see black bars if the inner view is smaller in width or height because aspect ratio.
the inner view (inside a window) is the virtual resolution
do you have an example code of your problem?
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : NVIDIA (390.65) GeForce GTX 1050 Ti : Mac mini OS High Sierra (10.13)
Dark Raven
9
Years of Service
User Offline
Joined: 27th Jul 2014
Location: United States
Posted: 11th Jul 2018 11:03
I'm testing on windows and linux - tier 1. Same code on both.



screen shots attached

Attachments

Login to view attachments
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 11th Jul 2018 12:13
because of a resize does this work ? or try to make a sync after screen settings
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : NVIDIA (390.65) GeForce GTX 1050 Ti : Mac mini OS High Sierra (10.13)
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Jul 2018 15:13
It seems there is some delay between SetWindowSize and the window size changing, so when you position the text it is still using a window size of 1024x768 with a virtual resolution of 1280x720, which would produce the screen bounds values you are seeing. Moving the SetTextPosition command into the loop fixes this, since it is constantly repositioning the text at the current screen bounds. This is also the preferred method when you allow window resizing since the screen bounds could change at any time, so if you want the text to always appear at the window edge then it has to be constantly repositioned.

Login to post a reply

Server time is: 2024-04-18 20:30:21
Your offset time is: 2024-04-18 20:30:21