Creating a sprite-button with a caption renders the caption behind the sprite.
Expectation is that the caption is always on top. This was the case for 1.1.110.
1.1.110:
/c game.player.gui.screen.add({
type = "sprite-button",
caption = "AAA"
}).sprite = "utility/close_white"
2.0.12:
/c game.player.gui.screen.add({
type = "sprite-button",
caption = "AAA"
}).sprite = "utility/close"
[2.0.12] Caption of sprite-button behind sprite
Re: [2.0.12] Caption of sprite-button behind sprite
yes, can confirm that behavior has changed, it worked fine in 1.1 but in 2.0 (2.0.12 tested) it seems to be behind the sprite:
<- top-left button had the sprite removed to show the text again
<- top-left button had the sprite removed to show the text again
Re: [2.0.12] Caption of sprite-button behind sprite
Thanks for the report. I've fixed this for the next release however the way it's fixed might cause other issues. The issue was: in 2.0 the custom sprite button widget got merged with a bunch of other "draws sprite" widgets and none of them (that I can tell) cared about the caption part and so drew it first (and it would always be empty for everything else).
I've changed it so the caption part draws last, but this might have unforeseen consequences in other parts of the GUI. At least, I couldn't find any issues. But this might come back to bite me in the next release - lets hope not.
I've changed it so the caption part draws last, but this might have unforeseen consequences in other parts of the GUI. At least, I couldn't find any issues. But this might come back to bite me in the next release - lets hope not.
If you want to get ahold of me I'm almost always on Discord.
Re: [2.0.12] Caption of sprite-button behind sprite
nice, thank you for the quick work. Will check as soon as it's available! Thanks again! And I'm sure it will not have any side-effects whatsoever
Works perfectly, from what I can see so far!
Works perfectly, from what I can see so far!