Window coordinates
Window coordinates
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?
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Window coordinates
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
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
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 6 guests