Page 1 of 1

[bug?] luaguielement textfield and style.horizontal_align

Posted: Tue May 21, 2019 7:13 am
by adamius
My test code shows that textfield ignores style.horizontal_align.

Is this correct / expected behavior?

Re: luaguielement textfield and style.horizontal_align

Posted: Tue May 21, 2019 9:03 am
by Choumiko
Works for me:

Code: Select all

style.horizontal_align = "center"
Screenshot from 2019-05-21 11-00-27.png
Screenshot from 2019-05-21 11-00-27.png (3.05 KiB) Viewed 931 times
Did you assign anything invalid?

Re: luaguielement textfield and style.horizontal_align

Posted: Tue May 21, 2019 12:33 pm
by adamius
Try aligning it left. Make the amount of text longer than what fits.

Different examples:

/c local t = game.players[1].gui.left.add{name="sometextfield",text="L12345678901234567890C123456789012344567890R",type="textfield"} ; t.style.horizontal_align="left"; t.style.width=1000

/c local t = game.players[1].gui.left.add{name="somebutton",caption="L12345678901234567890C123456789012344567890R",type="button"} ; t.style.horizontal_align="left"; t.style.width=1000

horizontal_align works fine on buttons but not textfields.