[2.0.12] Caption of sprite-button behind sprite

This subforum contains all the issues which we already resolved.
r3nt5ch3r
Inserter
Inserter
Posts: 27
Joined: Mon Apr 29, 2024 12:54 pm
Contact:

[2.0.12] Caption of sprite-button behind sprite

Post by r3nt5ch3r »

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"
grafik.png
grafik.png (8 KiB) Viewed 798 times

2.0.12:
/c game.player.gui.screen.add({
type = "sprite-button",
caption = "AAA"
}).sprite = "utility/close"
grafik.png
grafik.png (7.36 KiB) Viewed 798 times

Wichu
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Nov 26, 2020 9:51 pm
Contact:

Re: [2.0.12] Caption of sprite-button behind sprite

Post by Wichu »

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:
10-30-2024, 00-40-55.png
10-30-2024, 00-40-55.png (9.65 KiB) Viewed 753 times
<- top-left button had the sprite removed to show the text again

Rseding91
Factorio Staff
Factorio Staff
Posts: 14138
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.12] Caption of sprite-button behind sprite

Post by Rseding91 »

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.
If you want to get ahold of me I'm almost always on Discord.

Wichu
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Nov 26, 2020 9:51 pm
Contact:

Re: [2.0.12] Caption of sprite-button behind sprite

Post by Wichu »

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!
10-30-2024, 20-26-39.png
10-30-2024, 20-26-39.png (10.33 KiB) Viewed 633 times

Post Reply

Return to “Resolved Problems and Bugs”