flying-text: ability to change font

Post Reply
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

flying-text: ability to change font

Post by aubergine18 »

It seems there's no way to change font of flying-text - could this ability be added? (either in prototype or, preferably, when creating the entity)

Also, it seems that flying-text doesn't support `a` alpha channel in the `.color` property.
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.

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: flying-text: ability to change font

Post by aubergine18 »

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

Rseding91
Factorio Staff
Factorio Staff
Posts: 13171
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: flying-text: ability to change font

Post by Rseding91 »

The flying-text entity its self doesn't support setting a custom font. It uses the font that the main game uses.
If you want to get ahold of me I'm almost always on Discord.

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: flying-text: ability to change font

Post by aubergine18 »

Would there be any possibility to extend it to allow setting the font? It would be extremely useful as then sprite fonts could be used, facilitating easy runtime coloration, etc.

The only other viable alternatives I'm aware of are either `stickers` (not investigated those yet) or simple entities, both of which I'd have to update on-tick = slooow and crufty. I want to avoid having lots of entity definitions just for different sprites to manually float from the player. A glyph font applied to flying-text would be a very clean solution, at least from a modder perspective.

I appreciate that fonts are defined in locale files, and so we're back in to that whole nightmare again, but then again, the default font is also defined in locale files, so...
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.

Bilka
Factorio Staff
Factorio Staff
Posts: 3123
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: flying-text: ability to change font

Post by Bilka »

If you render text using the script rendered which I implemented for 0.17: https://lua-api.factorio.com/0.17.0-pre ... ering.html, you can dynamically change the font of the text. Since fonts are simply defined as prototypes (https://wiki.factorio.com/Prototype/Font) you can easily use your own custom font for the text. So I consider this implemented :)
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Implemented mod requests”