But, when running in preview mode, the right edge gets cutoff by the window. Or, it adds black bars to the window depending on the mode you set it to, but here is one example:
So, it seems the window size is different from the game resolution settings, causing the resolution to get stretched/cutoff/black bars added to get them to match.
My question is, how do I actually set the default window size to start with, so that they match without needing resize or black bars? I can change the window size of the preview window manually to fix it, but I would like it to be correct to start with so when I publish it works correctly for the player.
When you set the window params in the properties, did you have the bottom set to “no changes to the game size”, or is it on the fit to height or fit to width? if so, set it to" No changes" and see if that helps.
Keep in mind the bars you’re seeing there are because you’re using a windowed preview mode. Preview mode has black bars even when at a 16:9 resolution because it is hiding the native window titlebar. You can see how it would appear if you hit f11 to fullscreen it.
Separately, if you have “Update resolution” checked, it will not matter what you set your game resolution to, because it will update the resolution to whatever size window there is. This means more or less of your game scene will be shown than what appears in the scene editor.
With that option unchecked, your game scene will stay the same size no matter what (just scale up/down to match the window size). You will have to have bars when using a non 16:9 aspect ratio resolution window, though.