Page 1 of 1

Alignments in rendering are unclear

Posted: Thu Aug 04, 2022 3:11 pm
by Muppet9010
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.
each.PNG
each.PNG (135.47 KiB) Viewed 3386 times
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.
left.PNG
left.PNG (81.5 KiB) Viewed 3386 times

Re: Alignments in rendering are unclear

Posted: Fri Aug 25, 2023 8:14 am
by Therenas
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.

Re: Alignments in rendering are unclear

Posted: Fri Aug 25, 2023 8:28 am
by SoShootMe
Therenas wrote:
Fri Aug 25, 2023 8:14 am
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.
"ASCII art"?

Re: Alignments in rendering are unclear

Posted: Fri Aug 25, 2023 10:33 am
by curiosity
Therenas wrote:
Fri Aug 25, 2023 8:14 am
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.
"Where the target is relative to the text"? Not hard, if you ask me.

Re: Alignments in rendering are unclear

Posted: Fri Oct 06, 2023 7:22 am
by BrainGamer_
Therenas wrote:
Fri Aug 25, 2023 8:14 am
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.
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

Posted: Mon Oct 09, 2023 9:12 am
by Therenas
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

Posted: Tue Jan 09, 2024 7:41 pm
by Bilka
For viewtopic.php?p=600414#p600414 I made separate union types for the alignment and added these descriptions:
firefox_LrZqpS5yPb.png
firefox_LrZqpS5yPb.png (41.66 KiB) Viewed 502 times
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.

Re: Alignments in rendering are unclear

Posted: Tue Jan 09, 2024 9:25 pm
by curiosity
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
"The text is at the given side of the target position" is the exact opposite of the actual behavior. The elaboration is correct, though.

Re: Alignments in rendering are unclear

Posted: Wed Jan 10, 2024 11:11 am
by Bilka
curiosity wrote:
Tue Jan 09, 2024 9:25 pm
"The text is at the given side of the target position" is the exact opposite of the actual behavior. The elaboration is correct, though.
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.".