Page 1 of 1

[0.15.31] Invalid text width inside the LuaFrame

Posted: Sat Sep 09, 2017 6:52 pm
by _npo6ka_
I created a label inside the frame and assigned it some description from the localized file.
Also for label specified parameter single_line = false.

Code: Select all

local label = content_tab.add({type = "frame", name = "frame_for_label", style = "text_frame"})
label.add({type = "label", name = "label_0", caption = {"mod.caption"}, single_line = false  })

Code: Select all

data.raw["gui-style"].default["text_frame"] =
{
  type = "frame_style",
  maximal_width = 270,
  minimal_width = 270,
  scalable = false,
}
When I entered the game, I saw the following:
Image

Using the parameter want_ellipsis = true also yields no result :(

I also tried to create the following style for the label:

Code: Select all

data.raw["gui-style"].default["my_label"] =
{
  type = "label_style",
  width = 260,
  single_line = false,
  left_padding = 1,
  right_padding = 1,
  top_padding = 1,
  bottom_padding = 1,
  scalable = false,
}
But this also did not have any effect.
What am I doing wrong?

Re: [0.15.31] Invalid text width inside the LuaFrame

Posted: Sun Sep 10, 2017 11:25 am
by Klonan
You can set the maximal width of the label with style, which would probably work well if you are hard defining the frame width
_npo6ka_ wrote: I also tried to create the following style for the label:

Code: Select all

data.raw["gui-style"].default["my_label"] =
{
  type = "label_style",
  width = 260,
  single_line = false,
  left_padding = 1,
  right_padding = 1,
  top_padding = 1,
  bottom_padding = 1,
  scalable = false,
}
But this also did not have any effect.
What am I doing wrong?
single_line in the style won't have any effect, it is a property of the label, not the label style

Re: [0.15.31] Invalid text width inside the LuaFrame

Posted: Sun Sep 10, 2017 8:35 pm
by _npo6ka_
Klonan wrote:You can set the maximal width of the label with style, which would probably work well if you are hard defining the frame width
thank you very much for your help, it work.