ID:155205
 
Is there any way to stretch your world view to auto-fit your map? My game is going to be full-screen style but, I can't seem to get the world view right :S
I'm pretty sure there's a demo that checks screen-resolutions, which you'll need.

Also, changing the world.view will change the default view of whoever logs on, not the view of the individual who's map you want to fit it to.
In response to Ill Im (#1)
Yes I know that, the world view is what I want every player to see, it works excluding the fact that there are black bars on the top and bottom from where the screen isn't fitting to the map which is the size of the skin. I'll look for this demo you're talking about though it seems like it might help.

But, on another topic, can someone explain to me how to set a picture as a background on a browser window, I have an avatar system that will use a 300x300 pixel picture in a roughly 50x50 pixel window, now before anyone complains about that, that's the best I can do when making a good looking avatar; anyways, sending said picture to the browser window just makes it so you have to scroll to see the picture, any ways around that?
Set world.view = 40 or whatever is max value.
For interface, make map, position it correctly, then go to properties and change icon size to yours.
In response to Zaoshi (#3)
Wouldn't max value just zoom it out all the way?
In response to SadoSoldier (#4)
No it won't if you set icon size.
I'm not completely sure on this but, couldn't you create a proc that triggers at login() and acquires the size of the map? I know that if you try

mob/proc/GetMapSize()
var/Size = winget(src,"param","size")
world<<Size


You get the complete size of the element provided. An example of Size would be "1440x400", If you can remove the x from the string, you just need to create two new num vars and set their value as the Size.width and the other as Size.height. Now, all you need to do is divide each value by 32 and then set the new values as the clients view (Possibly will need to round each value, as there could be a decimal involved)...

Is this possible, I have no clue... I'm not an expert :S

In response to Kenny84 (#6)
Its possible, but extremely complex, I don't really want to go through all that just to set the world view xD, I was hoping it would just be possible for something such as world.view "stretch to fit", as a rough example but oh well :(
In response to SadoSoldier (#7)
SadoSoldier wrote:
extremely complex

He just summed it all up into a couple sentences. It's really darn simple.
Also, since people have different resolutions, setting the world.view isn't going to be very useful.
Changing client.view is what you want.

#define ceil(X) (-round(-(X)))
client
proc
ResizeMap()
var/size = winget(src, "map", "size")
var/width = text2num(size)
var/height = text2num(copytext(size, findtext(size, "x") + 1))
//Assuming square icon_size
var/horizontal = ceil(width / world.icon_size)
var/vertical = ceil(height / world.icon_size)
view = "[horizontal]x[vertical]"

This is how you'd do it for a static map icon size.
In response to Complex Robot (#8)
Ugh! I completely forgot that copytext() existed >_< I don't use it too often :/