ID:875042
 
Code:
mob
proc
getscreenresolution()
var/width
var/height
var/totalsize
winset(usr,"default","is-maximized=true")
var/max = winget(usr,"default","is-maximized")
if(max)
totalsize = winget(usr,"default","size")
width = copytext(totalsize,1,findtext(totalsize,"x"))
height = copytext(totalsize,findtext(totalsize,"x")+1,lentext(totalsize)+1)
return "your screen res is [width]x[height]"


Problem description:
Basically I made this to get the screen resolution of a persons computer. It works by maximising the default window and then getting its size which should return the proper size of the persons screen. But for me it only returns the original size of the window which is 640x480 basically which is not my screen resolution.

In order to Retrive player's screen location you need to write javascript but here you are in luck my friend, someone on byond has already made demo for this have a look.
http://www.byond.com/developer/Leur/ ScreenResolutionRetrieval
I know how to get it using JS. My way should work since the winget command retrieves the width and height of the window thats filling the screen but for some reason its retrieving the height and width of the original window
1. Does window get maximized after you call that proc?
2. Have you tried to add sleep()? It doesn't maximize right away.
In response to Dj dovis
Dj dovis wrote:
I know how to get it using JS. My way should work since the winget command retrieves the width and height of the window thats filling the screen but for some reason its retrieving the height and width of the original window

If i am not wrong then DM only retrieves the size of the window restored down to its original size not its maximized size.
I just tested it with sleep(100). Still the same result
I solved this issue. It is kind of easy now. If anybody is wondering how you just have to place a label in the background all the other skin elements and when the window is maximised the label covers the entire background(but you cant see it) so when ya get the size of the label it retrieves the resolution.