[0.17.13] sprite-button ignore icon_horizontal_align
Posted: Fri Mar 15, 2019 7:30 pm
It seems like there's problem with the mod api ability to create buttons.
Example:
This creates a button where the icon is centered despite the style having the setting: icon_horizontal_align = "left"
This is not the same as the real map preview button which has the icon on the left.
I would like to be able to have the icon and the caption left aligned but the icon before the caption, not overlapping.
I can't find any other setting that can do the job, and trying to nest an image in a flow in a button does not work with automatic ui-scaling, it doesn't seem to be possible to get the positioning correct at multiple ui scales.
Example:
Code: Select all
/c game.player.gui.center.add{type="sprite-button", sprite="item.iron-plate", name = "a2", caption ="a2", style="map_generator_preview_button"}
This is not the same as the real map preview button which has the icon on the left.
I would like to be able to have the icon and the caption left aligned but the icon before the caption, not overlapping.
I can't find any other setting that can do the job, and trying to nest an image in a flow in a button does not work with automatic ui-scaling, it doesn't seem to be possible to get the positioning correct at multiple ui scales.