ID:1420637
 
(See the best response by SuperSaiyanGokuX.)
Problem description:
How do I fit the whole map on the game screen itself (Without the void on left and right side of the map)?

Also, I wanted to have the best screen fit on my game to make the icons appear crisp. Any suggestions how to as well?

Screenshot:


Screenshot on runtime:

Best response
I believe that the best (only?) way to have your map fill the entire screen is to make sure that your world.view matches the aspect ratio of the screen.

It's the same principle as wide- vs. full-screen movies. If the output view is not the same proportions as the screen, then the extra space is filled in with nothingness.

What this means is that your world.view has to be a rectangular value, and not a simple square. Fortunately, world.view supports a format where you provide two values (one for the width, and another for the height), in the form of view="WIDTHxHEIGHT" (as in view="21x15" or whatever)

Note that if you enter view this way, then the numbers will now represent the total number of tiles for either dimension. (and not the "radius" distance out from your player, as it is with the normal, single-number view format)

What these numbers should be can be tricky, though. you need to pick two values that match the aspect ratio of your screen (4:3, 16:9, etc.), and to get the best final resolution, you need to pick high enough values that the number of tiles multiplied by your game's tile_size (32px by default) will be the closest to your screen's resolution.

The problem here, though, is that everyone's monitor is different. you might have a 4:3 screen ratio at 1024x768 (or whatever), but another player might have a 16:9 sceen at a 1920x1080 resolution, while another player might still be stuck with an old 800x600 screen. So you'd need to find a view size that will work the best for most people (but it won't be perfect for everyone).

Another problem is that unless you match your screen's resolution completely, there is going to be some stretching going on, which can result in your icons losing their crispness (this is actually system-dependent as well; depending on graphics hardware and so forth).

The only way to ensure perfect crispness is to force the screen to remain at exactly a 1:1 "zoom". Meaning it would have a fixed pixel width and height that exactly equals the tile width/height x tile_size. But then on some screens, it willl not fill the entire screen, and on others, it might even be too big to fit.

There's always going to be a toss-up.
Ah, I see your point. I understand it well now. Thanks for the reply.
The 'letterbox' parameter for map controls should help with this.
Dangit, there's all kinds of crap in the interface controls that I've never made myself aware of. Didn't even know there was a letterbox parameter until now. (though I suspected there would be some other way to make it work; hence the "(only?)" in my post above)
Oh wait. I don't feel so bad now. He'd still need to set a view size that will match the screen's aspect ratio, or viewable map area will be cut off of the top and bottom with letterbox turned off.

That might not be a problem depending on game design, but it would screw with any kind of screen objects placed along the top or bottom and other various potential issues.
In response to SuperSaiyanGokuX
Yeah, after reading the issue again it turns out letterbox isn't relevant as it only effects the stretched map, which usually isn't "crisp."

When tinkering with Hazordhu, I found that multiple of icon_size work best, but a high size is hard to fit on most screens and generally removes more, making larger screens a disadvantage.