ID:2183355
 
Code:
world<<"help-me!"


Problem description:

Can I keep the aspect ratio of the entire skin when resize? Anchors dont treat it very well for different scales in this kind of style (2 maps). If possible, I want to keep the max height and centralize everthing OR just keep the scale, making it impossible to maximize. (I tested a lot of different combination of anchors)



http://www.byond.com/forum/?post=1816091

It's doable, but you will need to handle almost all the calculations yourself by responding to on-resize events.

This is a problem not unique to BYOND, but rather an obstacle any pixel game has to find a way to work through.
In response to Ter13
Ter13 wrote:
http://www.byond.com/forum/?post=1816091

Exist some library or demo about that?

No. In order to utilize it, you need to understand the math behind the process. If you can't make the proper calculations, you can't constrain the resolution scaling properly. It is a very complex problem for which there are a large number of variables you have to choose to control.

There is no one-size-fits-all solution and you cannot hope to achieve the results you want with BYOND or any other engine that utilizes 2D graphics without understanding the math backing it.

I took the time to write all of that because there is a lot to understand on the topic. Your specific needs just can't be addressed by a demo or a library.

Even if I did produce a demo, what it would do is self-explanatory. It makes the aspect ratio stay uniform while attempting to find the ideal view size for the required scaling factor. Screen gets bigger -> viewport gets bigger. viewport gets too big? -> scaling factor goes up.
In response to Ter13
client/verb/onResize()
set hidden = 1
var/i = findtext(winget(src, "default", "size"), "x")
var/texto = winget(src, "default", "size")
winset(src, "default", "size = [text2num(copytext(texto, i+1))*1.5]x[text2num(copytext(texto, i+1))]")


Works on non-maximized windows :), what should I do about the maximized windows? Can I change the black part to a background image?

You shouldn't be controlling the aspect ratio like this. The most popular resolution in the world at this moment is 1920x1080. Your game is trying to maximize at 1620x1080. A 3:2 aspect ratio is something that almost nobody is going to like.

Better not to obsess over it at all and don't use stretch to fit. Focus on the gameplay. There's too much for you to learn on the subject of aspect ratios and ideal UI design for it to distract you from having a game.
In response to Ter13
Thanks for the advice, I found this simple solution to who play in maximized windows. The gameplay will be the best part.