I'm not sure if this is a bug, but I couldn't find a note in the recent change logs that mention any changes like this.
I used to use maximal_height=10 to have multiple labels arranged vertically closer together.
The default spacing between labels is very large.
I tried playing with padding and setting heights but I can no longer get the desired spacing due to clipping.
I attached a picture of what it looks like since one of the recent patches. I think this change happened in .27 or maybe .28?
Thanks,
Oarc
[0.16.30] Gui Label maximal_height clipping
[0.16.30] Gui Label maximal_height clipping
- Attachments
-
- text_label_clipping.PNG (105.18 KiB) Viewed 2212 times
Re: [0.16.30] Gui Label maximal_height clipping
Can you please post a sample mod that shows the issue?
Also, why not just set a single label to be multi-line and use that instead of multiple labels?
Also, why not just set a single label to be multi-line and use that instead of multiple labels?
If you want to get ahold of me I'm almost always on Discord.
Re: [0.16.30] Gui Label maximal_height clipping
I'm looking at this and can't figure it out: http://lua-api.factorio.com/latest/LuaGuiElement.html
I see multi-line for text-boxes but I'm not sure how to do that for a label.
(I got pointed to viewtopic.php?p=349133#p349133 which says to set single_line to false. http://lua-api.factorio.com/latest/LuaS ... ingle_line. Thanks!)
Here's an example. I'm doing this in my scenario code, I don't know how to make a mod.
Code: Select all
script.on_event(defines.events.on_player_joined_game, function(event)
local player = game.players[event.player_index]
player.gui.center.add{name = "test_msg",
type = "frame",
direction = "vertical",
caption="test GUI height clipping issues"}
local tGui = player.gui.center.test_msg
tGui.style.maximal_width = 200
tGui.style.maximal_height = 100
tGui.add{name = "lable_1", type = "label",
caption="A test message blah blah blah blah blah message blah blah blah blah blah."}
tGui.add{name = "lable_2", type = "label",
caption="A test message blah blah blah blah blah message blah blah blah blah blah."}
tGui.add{name = "lable_3", type = "label",
caption="A test message blah blah blah blah blah message blah blah blah blah blah."}
tGui.lable_1.style.maximal_height=10
tGui.lable_2.style.maximal_height=10
tGui.lable_3.style.maximal_height=10
end)
Re: [0.16.30] Gui Label maximal_height clipping
yeah i have the same issue.
it looks like the label leaves a ton of space on the top.
when i set mine to 6-8 px height i don't even see any text..
it looks like the label leaves a ton of space on the top.
when i set mine to 6-8 px height i don't even see any text..
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
Re: [0.16.30] Gui Label maximal_height clipping
That's because the font defines the minimum height to render it and that's the height you see.ownlyme wrote:yeah i have the same issue.
it looks like the label leaves a ton of space on the top.
when i set mine to 6-8 px height i don't even see any text..
If you want to get ahold of me I'm almost always on Discord.
Re: [0.16.30] Gui Label maximal_height clipping
big part of the problem is that the font scales with window size, regardless of the "scaleable" property.
look at my graph. the spacers above the texts are 0 px height (triple checked!), yet there are huge gaps above them (texts have huge top-padding inside the label.)
i've tried everything but there is no way to fix it.
look at my graph. the spacers above the texts are 0 px height (triple checked!), yet there are huge gaps above them (texts have huge top-padding inside the label.)
i've tried everything but there is no way to fix it.
- Attachments
-
- Screenshot_5.png (2 KiB) Viewed 2084 times
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
Re: [0.16.30] Gui Label maximal_height clipping
try this:
/c frame = game.players[1].gui.left.add{type = "frame", name = "frame", caption = "", direction = "vertical"}
tbl = frame.add{type = "table", column_count=1, name = "tbl", direction = "vertical"}
tbl.style.vertical_spacing=0
tbl.style.scaleable = false
above=tbl.add{type = "progressbar", name = "above", direction = "vertical"}
above.style.height = 1
above.value = 1
above.style.scaleable = false
textbox = tbl.add{type = "label", name = "textbox", direction = "vertical"}
textbox.style.height = 12
textbox.caption="12345%"
textbox.style.font = "default-small-bold"
textbox.style.scaleable = false
(paste the whole block into console^^)
i attached the result you should see.
/c frame = game.players[1].gui.left.add{type = "frame", name = "frame", caption = "", direction = "vertical"}
tbl = frame.add{type = "table", column_count=1, name = "tbl", direction = "vertical"}
tbl.style.vertical_spacing=0
tbl.style.scaleable = false
above=tbl.add{type = "progressbar", name = "above", direction = "vertical"}
above.style.height = 1
above.value = 1
above.style.scaleable = false
textbox = tbl.add{type = "label", name = "textbox", direction = "vertical"}
textbox.style.height = 12
textbox.caption="12345%"
textbox.style.font = "default-small-bold"
textbox.style.scaleable = false
(paste the whole block into console^^)
i attached the result you should see.
- Attachments
-
- demo.png (60.76 KiB) Viewed 2080 times
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds