-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add modifiable FormSpec size types #8646
Conversation
Great! What would speak against a new element with that you can change the |
If you change it midway, only If I added it to BTW, when is someone going to fix the Xcode compiler for Travis CI? It's rather annoying having the check fail half the time because it's outdated. |
a1c58da
to
e9e5866
Compare
9ba50c5
to
4ff7774
Compare
4ff7774
to
31e31de
Compare
What would be possible use-cases of |
On the contrary,
An example of this would be like a fullscreen Another use-case is that, since you can change size types at will, you can make a form that starts with
As for |
I'm considering closing this because changing the coordinates can have bad side effects. I can't think of the examples I was thinking about earlier, but this PR could mess up a lot of things with no easy fix. I think it's not worth the bugs, maintenance, and trouble to both MT and mod developers. If anyone considers this indispensable, then I'm willing to listen. |
Up to you. I think that we can make an alternative main menu which doesn't need this feature, and so doesn't invoke all the issues that could come with it |
I will trust the author on whether this should be closed =) |
|
This PR adds multiple different size types of FormSpec sizing types. All new types require
real_coordinates
to be set totrue
. This is an expansion of #8630 (I meant to continue it, but I messed it up and accidentally deleted it while trying to rebase -- I'm still trying to figure out Git).There are four new types of sizing:
stretch
,fill
,fit
,wide
,tall
, andmini
. These are illustrated in the below image (black is Minetest window, red is FormSpec):In order: normal (
false
),fit
,fill
,stretch
,mini
,wide
,tall
fit
is as big as possible without being cut off.fill
is as big as possible without being bigger than the side of the screen, so the form will always be cut off.stretch
stretches coordinates to make the form match the screen size, so things like images might look lopsided.wide
is as wide as the screen, and the height may or may not be cut off depending on the screen size.tall
is the same aswide
but with the height as opposed to the width.mini
works as a single pixel per coordinate. Certain things (like labels) won't work inmini
. There is a note inlua_api.txt
that states thatmini
should not be used for normal forms, only for specialized purposes.mini
may not quite meet up with the edge of the screen when they should due toimgsize
being integers, not floats.To specify which system to use, you have to use the third parameter in the
size
element, e.g.size[10,5,fit]
. The old behavior oftrue
for fixed size has not been changed for compatibility (although I don't think any mods use it).Screenshots
fit
,fill
, andstretch
FormSpec:fit
fill
stretch
wide
tall
mini
This PR is Ready for Review.