Page 1 of 1
Window coordinates
Posted: Tue Jan 30, 2018 10:50 pm
by AngusWP
Let's say I manage to finish my game (not going to happen lets face it), and it all goes fine and I manage to get it on itch or something. If someone who downloaded my game had a different screen dimensions and resolutions find that my game had graphics in the wrong place because the graphics are drawn due to the locations and coordinates fit for my screen? If so, how would I fix this?
Re: Window coordinates
Posted: Wed Jan 31, 2018 1:41 am
by zorg
First off, let me say that unless you're doing the sort of game Undertale was, manipulating stuff outside the game, you'd want to give people the ability to use both (desktop) fullscreen and windowed modes.
Now, usually every game has one base resolution, that's the smallest supported. Second, games may allow window resizing, some may not; of those that do, you can either implement it so window size affects the overall zoom level, or you could implement it so only the viewport gets shrunk (an example for the latter is OpenTTD).
The short answer to what i understand the biggest concern is, that you really should use a camera/viewport library in your game; they transform the game world coordinates into screen/window coordinates, meaning no matter how far off 0,0 you are in the game world, the screen will show exactly what you want.
Now, your graphics should not be in the wrong place regardless of resolution, since the "internal resolution", or metrics of your world should not change just because the user resized their window, or has a differently sized desktop