Formspec scaling

Post Reply
User avatar
Tmanyo
Member
Posts: 196
Joined: Mon Sep 29, 2014 01:20
GitHub: Tmanyo
IRC: Tmanyo
In-game: tmanyo
Location: United States
Contact:

Formspec scaling

by Tmanyo » Post

I don't know if this question has already been asked. I did a search on it through the forum search and Google and can't seem to find an answer. I made a formspec on my desktop which has a different resolution than my laptop. When I view the form on my laptop, not all of the elements fit on the screen correctly. My desktop is Windows and my laptop is Ubuntu. I don't know if the operating system makes a difference. I would like to know if there is a way to fix the scaling or if I need to have several different coordinate systems for several different screen resolutions.
Tmanyo
http://www.rrhmsservers.ml
Servers I Host:
Tmanyo-Realism
Mods of mine that I don't totally hate:
Bank Accounts
T-Rating
Tmusic Player

User avatar
rubenwardy
Moderator
Posts: 6978
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: Formspec scaling

by rubenwardy » Post

Please may you show screenshots to demonstrate this?

Also, try changing the gui_scaling setting
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Tmanyo
Member
Posts: 196
Joined: Mon Sep 29, 2014 01:20
GitHub: Tmanyo
IRC: Tmanyo
In-game: tmanyo
Location: United States
Contact:

Re: Formspec scaling

by Tmanyo » Post

I tried changing the gui_scaling, but it made no difference. It changed the overall size of the form, but not the location of elements. These are pictures of a new computer mod I have been working on. I started it a long time ago and resumed developing it recently.

This is what it looks like on my laptop:
Bad Scaling

This is what it looks like on my desktop and what it should look like:
Good Scaling

I would post the pictures, but my image hosting service is not working correctly.
Tmanyo
http://www.rrhmsservers.ml
Servers I Host:
Tmanyo-Realism
Mods of mine that I don't totally hate:
Bank Accounts
T-Rating
Tmusic Player

User avatar
ChimneySwift
Member
Posts: 320
Joined: Fri Sep 22, 2017 06:46
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift
Location: 127.0.0.1

Re: Formspec scaling

by ChimneySwift » Post

The fonts for the 2 look different, that might be the issue? Unless the text is not the only issue and I'm missing something.
A spoon is basically a tiny bowl with a stick on it

User avatar
Tmanyo
Member
Posts: 196
Joined: Mon Sep 29, 2014 01:20
GitHub: Tmanyo
IRC: Tmanyo
In-game: tmanyo
Location: United States
Contact:

Re: Formspec scaling

by Tmanyo » Post

ChimneySwift wrote:The fonts for the 2 look different, that might be the issue? Unless the text is not the only issue and I'm missing something.
The text is pretty much the only issue. It doesn't fit the way it should. I believe it should be the same font because Minetest does not allow different fonts of text in formspecs as far as I know. I did some messing around to see if I could make it look right without editing the code further. It looked normal when I set my DPI to 65 and the gui_scaling to 1.3. I am not a big fan that a player has to change settings in the game and out of the game to make a formspec look the way it is intended to look on a different computer.
Tmanyo
http://www.rrhmsservers.ml
Servers I Host:
Tmanyo-Realism
Mods of mine that I don't totally hate:
Bank Accounts
T-Rating
Tmusic Player

User avatar
ChimneySwift
Member
Posts: 320
Joined: Fri Sep 22, 2017 06:46
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift
Location: 127.0.0.1

Re: Formspec scaling

by ChimneySwift » Post

The font's are set by the client (check font_path in minetest.conf). The bad scaling looks like it's using fallback font (fallback_font_path) and the good scaling is using the regular font. If this is the case you either need to assume the client is using the fallback font and scale it for that (possibly sacrificing looks for clients using the normal font). Unfortunately it doesn't look like there is another option here as you can't adjust the text alignment for text labels AFAIK.
A spoon is basically a tiny bowl with a stick on it

User avatar
Hybrid Dog
Member
Posts: 2835
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: Formspec scaling

by Hybrid Dog » Post

Unfortunately formspec lacks proper text displaying. If you want to define a rectangle in which a set text is shown, you can either use "label" to manually do the alignment, this only works as long as the font size is small enough, or you can use the writeable "textarea" text field (https://github.com/minetest/minetest/bl ... .txt#L2105), but it looks ugly and is not read only.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

Post Reply

Who is online

Users browsing this forum: talamh and 9 guests