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.
GuiElement Textfield localised .text
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: GuiElement Textfield localised .text
+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.
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.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: GuiElement Textfield localised .text
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.
If you want to get ahold of me I'm almost always on Discord.