Page 1 of 1

GuiElement Textfield localised .text

Posted: Thu Sep 15, 2016 8:42 pm
by matjojo
So a lot of gui elements have the .caption tag wich can take localised strings. But when trying to make a placeholder text for a textfield found that the .text tag for Lua/GuiElement textfield does not allow localisation. I can see why this would not matter for the user adding text in the textbox, as it does not have a use for localisation there, but when making a placeholder using the .text tag it makes sense to be able to use it.

Another way of doing this is adding a .placeholder tag in the .add{type = (...)} which does allow localisation, I'd certainly use it.

Re: GuiElement Textfield localised .text

Posted: Thu Sep 15, 2016 9:45 pm
by aubergine18
+1 for the .placeholder property; assuming that displays text in the text box and when the box gets focus the placeholder text disappears?

Would also need new property in textfield_style prototypes to define the placeholder_color.

While on subject of textfield_style prototypes, it would be nice to define different background images for different states, for example: default, hover, clicked/selected?, disabled - I'd like to make text field with dark background normally, but when active have light background.

Re: GuiElement Textfield localised .text

Posted: Thu Sep 15, 2016 10:10 pm
by Rseding91
Factorio TextFields don't currently support any kind of water-mark text. If at some point we decide to implement that mechanics I'll add a way to use it in the mod API.