Page 1 of 1

What are the loaded graphic paths? [SOLVED]

Posted: Thu Sep 21, 2017 8:23 am
by RiQ
Hi,

as the topic states, I would like to know what are the path strings to graphics which I can access in control.lua.

For example one I have found is:

Code: Select all

myGuiElement.sprite = "item/"..itemProto.name
Additionally I'm curious if there are separate graphics for sprites with stack amount number, or how would I go on implementing custom GUI slot element with stack numbers? Is there maybe a possibility to add some foreground layer sprite on the GUI element?

All information and help is appreciated, thanks in advance!

EDIT:

I made the problem more complicated than needed. Turns out I could throw label as a child of sprite-button and then disable it, so it wont interrupt mouse actions. Also I confirmed the sprite path syntax:
- Sprite identifier can either point to custom definition from the data, or have form "<type>/<id>", type can be (item, entity, recipe and technology), for example button.sprite = "item/iron-plate"

Re: What are the loaded graphic paths?

Posted: Thu Sep 21, 2017 12:03 pm
by darkfrei
Did you read this topic?
[GUIDE] How to style buttons with images on them.
viewtopic.php?f=34&t=24007

Re: What are the loaded graphic paths?

Posted: Thu Sep 21, 2017 12:18 pm
by RiQ
darkfrei wrote:Did you read this topic?
[GUIDE] How to style buttons with images on them.
viewtopic.php?f=34&t=24007
Yeah I skimmed it through several times, but I'll give it one try more with more thought put in. Thanks.