Hi, I was wondering if it's possible to have a resizeable window with a minimum size. The idea being that it would become impossible to cover important interface elements by making the window tiny.
|
With an interface you can set your window size and do it the way I did and simply make the minimize button that window size and the maximize, well, maximize.
the commands are: .maximize and .normal Simply make a menu in the dmf and add options with these commands. Customize the winset options to suit your needs; as you can see I have a background set. mob/verb |
Hmm, that's not quite what I'm looking for but thank you. I'd really like people to be able to resize however they like rather than lock them into an either/or situation.
|
In response to Zecronious
|
|
Yeah, so would I. Currently I don't think there is a minimum window size, which is why I use the above method.
Let me know if you find anything or maybe make a feature request and I'll +1 it! :) |
As an alternative, in the mean time, you could just offer menu options for window size. An option for smallest, default, and large windowed resolutions seems fair. That would allow the player control for both normal resizing and for playing how you, the developer, feel is optimal if they choose to do that.
|
I'll wait and see if any DM wizards have an answer, I certainly can't find it.
If not I'll make the feature request for sure. |
The simple answer is no; in the current version of BYOND there is no way appealing way to force a minimum window size. If you'd like to make it ugly, you could do some fancy work with winset(), checking the size of the window when resized, then resizing it to the minimum if it is less. Or you could simply disable resizing altogether for the window. But any DM dev would advise you to avoid that.
However, if one were to be using the Webclient, this would easily be possible. In the current state of BYOND, the webclient seems to prove superior in terms of limitations. Check it out here to see if it fits your needs. |
In the interface editor set the windows on-resize command to the verb.
You can also use on-size using winset() if prefered. mob |
In response to Kozuma3
|
|
Here is the "fancy work with winset" ;)
|
In response to Konlet
|
|
Konlet wrote:
Here is the "fancy work with winset" ;) 30 seconds of work ;) [Edit] There seems to be a bug where it isn't called if the window is stretched using windows stretchy feature thingy, or if it's maximized. But will fix itself if pulled away from the edge of the screen so I don't see this being a issue :) |
BROWSER HACK AHOY!
This is a client-side way of limiting how far a window can be resized. It'll auto-detect when it exceeds the limits and forcibly end the resize operation momentarily by disabling the window. Then it'll resize itself to the minimum/maximum size depending on which axis was over the limit, then re-enable the window and give focus back to that window. It's ugly, it's dirty, but it happens entirely on the client-side, so it's got that going for it, which is nice. Here's a gif of it in action: http://gfycat.com/UnevenUnhealthyAmbushbug And here's the example project: http://files.byondhome.com/Ter13/sizertest_src.zip And if anybody's interested in how the guts of this thing work: Basically, I just hide a browser under the content of a window and anchor it to the top-left and bottom-right of the window and set the browser to the full size of the window element. Then I use some Javascript magic to capture when the browser resizes and do some winsets on the client-side via javascript there. client This is the document that does the client-side work: <!DOCTYPE html> This is a hack. You probably shouldn't use this. I repeat. You probably shouldn't use this. It's a hack. |
I just wanted to add to this, the reason that I requested .winset, .winget, and .output is because I hate the BYOND 3.5/4.0 feature set with a fiery burning passion.
It wasn't a step backward, but it wasn't a step forward. BYOND as a platform has only been getting better in my opinion since the late 400 and especially since 500. |
In response to Ter13
|
|
Oh it's very usefull. I hope see this in tutorials. This would help for a lot of people.
|
http://www.byond.com/forum/?post=717931