ID:163720
 
[edit: Apparently this only works on XP???]

I would post this on my blog but the stupid javascript and blog filters and blah blah blah. The following code can be used to make your game fullscreen.

var/GetScreenResolution = {"<html><head></head><body><script type="text/javascript">window.location="?Action=ScreenResolution&Width="+screen.width+"&Height="+screen.height</script></body></html>"}

client
var
ScreenHeight = 0
ScreenWidth = 0
ScreenResolution = ""

Topic(Href, HrefList[])
if(HrefList["Action"] == "ScreenResolution")
ScreenWidth = text2num(HrefList["Width"])
ScreenHeight = text2num(HrefList["Height"])
ScreenResolution = "[ScreenWidth]x[ScreenHeight]"
..()

proc/GetScreenResolution()
src << browse(GetScreenResolution, "window=ScreenResolution&size=0x0&titlebar=0&can_resize=0&can_minimize=0")
while(!ScreenResolution) sleep(1)
src << browse(null, "window=ScreenResolution")

proc/FullScreen()
winset(src, "Main", "size=[ScreenResolution]&pos=0x0&focus=1")

mob
Login()
client.GetScreenResolution()
client.FullScreen()
..()


In order to use it, change the "Main" there in FullScreen() to your main interface. Then, in the main interface, put a map control, set its anchors to Top Left, and Bottom Right, and use the "Fill Window" button in the properties editor. Then, set the window itself to be not resizeable, not closeable, and not minimizeable. Also uncheck title bar and status bar.

You don't have to just have a map window, you can put other controls as well.

Now, this will be a problem with different resolutions because they might see unnecessary black bars around the map. Here is a snippet that can fix that (usually).

client/proc/ResizeMap()
var
MapSize = winget(src, "Main.Map", "size")
X32 = round(text2num(copytext(MapSize, 1, findtext(MapSize, "x"))), 32) / 32
Y32 = round(text2num(copytext(MapSize, findtext(MapSize, "x") + 1)), 32) / 32
NewView = "[X32+1]x[Y32]"
view = NewView


Just make sure you change "Main.Map" to your map control. Run this when the user logs on, and it will find the best client.view size for the players resolution.