Page 1 of 1

Allow adding label inside sprite-button

Posted: Fri Mar 24, 2017 7:04 pm
by Mooncat
Request:
Add an optional string parameter "label" for adding string inside GUIElement sprite-button.
So we can make something like the item count buttons in vanilla Factorio if we enter a number in "label":
SpriteButtonWithNumber.png
SpriteButtonWithNumber.png (2.8 KiB) Viewed 1105 times

(I keep thinking I have made this request, but I couldn't find the post after some advanced searches.)
I have tried making the item count buttons in my mod before, but it didn't end well.
First, I have add nested label style inside the sprite button style, but either I have set the wrong values, or this simply isn't support, the label wasn't shown properly.
Second, the label blocked mouse interaction of the button. It's the main reason why I stopped doing it. :lol:

Re: Allow adding label inside sprite-button

Posted: Fri Mar 24, 2017 7:39 pm
by daniel34
Mooncat wrote:I keep thinking I have made this request, but I couldn't find the post after some advanced searches.
You might have seen this related one: quantity on sprite button [Modding help]

Re: Allow adding label inside sprite-button

Posted: Sat Mar 25, 2017 12:14 am
by Mooncat
daniel34 wrote:
Mooncat wrote:I keep thinking I have made this request, but I couldn't find the post after some advanced searches.
You might have seen this related one: quantity on sprite button [Modding help]
Oh, yes! That's exactly what I want. Thanks!
Tho it is still not solved yet. :P