Alignments in rendering are unclear

Place to report issues and suggest improvements to the API documentation.
User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 279
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

Alignments in rendering are unclear

Post 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 3938 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 3938 times
User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 261
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Re: Alignments in rendering are unclear

Post 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.
SoShootMe
Filter Inserter
Filter Inserter
Posts: 517
Joined: Mon Aug 03, 2020 4:16 pm
Contact:

Re: Alignments in rendering are unclear

Post 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"?
curiosity
Filter Inserter
Filter Inserter
Posts: 484
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Alignments in rendering are unclear

Post 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.
User avatar
BrainGamer_
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Sun Nov 14, 2021 9:52 pm
Contact:

Re: Alignments in rendering are unclear

Post 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?
User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 261
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Re: Alignments in rendering are unclear

Post 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.
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Alignments in rendering are unclear

Post 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 1054 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.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
curiosity
Filter Inserter
Filter Inserter
Posts: 484
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Alignments in rendering are unclear

Post 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.
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Alignments in rendering are unclear

Post 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.".
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 “Documentation Improvement Requests”