Centering the dream seeker window in BYOND Discussion
winset(src, "window", "size=5000x5000") //window will auto-adjust to your screen's resolution var window_res=winget(src, "window", "size") //get the window's resolution, ex: 1000x500 res_width=text2num(copytext(window_res, 1, findtext(window_res, "x"))) //get the first portion of the resolution (1000) res_height=text2num(copytext(window_res, findtext(window_res, "x") + 1)) //the height portion (500) winset(src, "window", "size=[WINDOW_WIDTH]x[WINDOW_HEIGHT]; pos=[(res_width - WINDOW_WIDTH) / 2], [(res_height - WINDOW_HEIGHT) / 2]") //center it
You can just create your own method. Get the user's screen resolution and position your window accordingly. > winset(src, "window", "size=5000x5000") //window will auto-adjust to your screen's resolution> var> window_res=winget(src, "window", "size") //get the window's resolution, ex: 1000x500> res_width=text2num(copytext(window_res, 1, findtext(window_res, "x"))) //get the first portion of the resolution (1000)> res_height=text2num(copytext(window_res, findtext(window_res, "x") + 1)) //the height portion (500)> winset(src, "window", "size=[WINDOW_WIDTH]x[WINDOW_HEIGHT]; pos=[(res_width - WINDOW_WIDTH) / 2], [(res_height - WINDOW_HEIGHT) / 2]") //center it> A built-in feature would be nice, but not really necessary.
> winset(src, "window", "size=5000x5000") //window will auto-adjust to your screen's resolution> var> window_res=winget(src, "window", "size") //get the window's resolution, ex: 1000x500> res_width=text2num(copytext(window_res, 1, findtext(window_res, "x"))) //get the first portion of the resolution (1000)> res_height=text2num(copytext(window_res, findtext(window_res, "x") + 1)) //the height portion (500)> winset(src, "window", "size=[WINDOW_WIDTH]x[WINDOW_HEIGHT]; pos=[(res_width - WINDOW_WIDTH) / 2], [(res_height - WINDOW_HEIGHT) / 2]") //center it>
Get the user's screen resolution and position your window accordingly.
A built-in feature would be nice, but not really necessary.