#define floor(x) round(x)
#define ceil(x) (-round(-x))
#define TILE_WIDTH 32
#define TILE_HEIGHT 32
#define MAX_VIEW_TILES 800
world
icon_size = 32
client
var
view_width
view_height
buffer_x
buffer_y
map_zoom
verb
onResize()
set hidden = 1
set waitfor = 0
var/sz = winget(src,"map1","size")
var/map_width = text2num(sz)
var/map_height = text2num(copytext(sz,findtext(sz,"x")+1,0))
map_zoom = 1
view_width = ceil(map_width/TILE_WIDTH)
if(!(view_width%2)) ++view_width
view_height = ceil(map_height/TILE_HEIGHT)
if(!(view_height%2)) ++view_height
while(view_width*view_height>MAX_VIEW_TILES)
view_width = ceil(map_width/TILE_WIDTH/++map_zoom)
if(!(view_width%2)) ++view_width
view_height = ceil(map_height/TILE_HEIGHT/map_zoom)
if(!(view_height%2)) ++view_height
buffer_x = floor((view_width*TILE_WIDTH - map_width/map_zoom)/2)
buffer_y = floor((view_height*TILE_HEIGHT - map_height/map_zoom)/2)
src.view = "[view_width]x[view_height]"
winset(src,"map1","zoom=[map_zoom];")
mob
Login()
client.onResize()
return ..()
Problem description: I'm trying to get full screen working for my game, but I'm running into issues. The code above is from the almighty Ter13's article: http://www.byond.com/forum/?post=1816091.
When using any value lower than 2000 for MAX_VIEW_TILES, the screen is super zoomed in and looks terribly blurry, like so: https://gyazo.com/ff3e49de8f077a8d9747bb6660039e40
When using a value of 2000 or higher for MAX_VIEW_TILES, the screen is super zoomed out, but not blurry, like so: https://gyazo.com/411830cbbe2c17b49ee546f797138e25.
There is only two outcomes no matter what value I use, either super zoomed in and blurry, or too zoomed out.
I cannot for the life of me figure out how to make it so the screen is zoomed in the right amount and maintains image quality.
Any help would be greatly appreciated, thanks!
With their resolution known, it should be easy to know the client.view width & height to use.
Then to make the window fullscreen you just:
Maybe some of this helps maybe it doesn't. Gotta go.
There are other factors such as whether you have set your map element in the skin to "stretch" or whatever other options that may interfere with this.