I have no idea why _MIDDLE causes such issues on some machines? The game is centering on my computer.
The problem with _MIDDLE is often from a race condition on some machines.
If you ever watch, QB64 *always* starts in a 640x400 screen (for SCREEN 0). Usually, one of the first lines of code in a program is something similar to SCREEN _NEWIMAGE(800, 600, 32), with _SCREENMOVE _MIDDLE immediately after.
And ^there’s the glitch...
You’re in one screen. You’re clearing that screen. You’re creating a new screen. It takes Windows a few fractions of a second to do this process and register the new screen handle...
And _SCREENMOVE _MIDDLE occurs at some point in this process. If it occurs before the original screen is freed, your old window centers, disappears, and the new window pops up wherever windows wants to put it. If it triggers after the new window is registered, it centers properly... It all depends on that race condition and which window it’s working with.
Bplus posted some code above like this:
SCREENMOVE MIDDLE
DELAY...
This is an example of non-effective code, in an attempt to address the issue at hand. The glitch falls between SCREEN and SCREENMOVE, and with the race between which screen is registered when screenmove is called; not *after* the SCREENMOVE....
I would imagine if that delay was *BEFORE* the SCREENMOVE, the command would work properly as it’d give windows time to clear the old screen and create the new one and register it, before it tried to move the wrong (or non-existent) window.