The descriptions for the alignments in rendering are not terribly clear. i.e.
https://lua-api.factorio.com/latest/Lua ... .draw_text
When you set something to "left" it doesn't appear to the left of the target, instead it's on the right of it.
From a casual usage this appears that each option is being reversed.
From a discord discussion it was explained that the alignment options are which side of the text is aligned against the target position. So left aligned text has the left hand side of the words up against the target position.
Or viewed as the alignment sets the anchor point of the text.
Alignments in rendering are unclear
- Muppet9010
- Filter Inserter
- Posts: 279
- Joined: Sat Dec 09, 2017 6:01 pm
- Contact:
Re: Alignments in rendering are unclear
Just want to note that this is a very valid issue, but hard to explain without an image, which the runtime docs don't support yet, so I'll likely wait on that.
- BrainGamer_
- Long Handed Inserter
- Posts: 93
- Joined: Sun Nov 14, 2021 9:52 pm
- Contact:
Re: Alignments in rendering are unclear
Are images supported since the prototype docs moved from wiki to lua-api docs? Because they certainly work for ElementImageSetLayer?
Re: Alignments in rendering are unclear
They are supported for the prototype docs, but not yet for the runtime docs, since they use an older format under the hood. It's due for unification, but that'll take a while still.
Re: Alignments in rendering are unclear
For viewtopic.php?p=600414#p600414 I made separate union types for the alignment and added these descriptions:
I think that should mostly resolve this. But I won't move the thread to resolved for now because I agree that an image would still be good to have.
I think that should mostly resolve this. But I won't move the thread to resolved for now because I agree that an image would still be good to have.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: Alignments in rendering are unclear
"The text is at the given side of the target position" is the exact opposite of the actual behavior. The elaboration is correct, though.Bilka wrote: ↑Tue Jan 09, 2024 7:41 pm For viewtopic.php?p=600414#p600414 I made separate union types for the alignment and added these descriptions:
firefox_LrZqpS5yPb.png
Re: Alignments in rendering are unclear
Thanks for pointing that out, fixed to be "The text is aligned so that the target position is at the given side of the text.".
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.