[0.15.31] Invalid text width inside the LuaFrame

This subforum contains all the issues which we already resolved.
Post Reply
_npo6ka_
Fast Inserter
Fast Inserter
Posts: 102
Joined: Mon Sep 26, 2016 10:29 pm
Contact:

[0.15.31] Invalid text width inside the LuaFrame

Post 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?

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.15.31] Invalid text width inside the LuaFrame

Post 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

_npo6ka_
Fast Inserter
Fast Inserter
Posts: 102
Joined: Mon Sep 26, 2016 10:29 pm
Contact:

Re: [0.15.31] Invalid text width inside the LuaFrame

Post 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.

Post Reply

Return to “Resolved Problems and Bugs”