Window coordinates

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
AngusWP
Prole
Posts: 9
Joined: Mon Jan 22, 2018 11:35 pm

Window coordinates

Post 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?
User avatar
zorg
Party member
Posts: 3441
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Window coordinates

Post 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
Me and my stuff :3True 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 174 guests