resizing tech sprites

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
quenenni
Inserter
Inserter
Posts: 21
Joined: Fri Apr 14, 2017 2:16 am
Contact:

resizing tech sprites

Post by quenenni »

Hello,

I'm looking for a way to manage the size of the technology sprites I'm showing in my Gui.
My mod can show the sprites for all the recipes and techs.
For the recipes, the default size is good, but for the techs, they are more than twice the size.

I tried to add a 'maximum_height' on the sprite element, it works, but the image is not scaled.

I can't create a css class (data:extend) for every tech because it's vey unpractical and also I won't know all the images of all the techs added by other mods.

Anyone has an idea how to do that?

The other thing.. but I have the feeling I already know the answer as the possibilities with lua and a Gui are very limited.. is it possible to focus on / select an element (textbox) when opening the Gui?

Thanks.

Ps: I'm really sorry if I posted in the wrong section.. I must admit that I took nearly an hour to check the different sections and read some stuff, and I'm more confused than before.
I must say that this forum isn't the most well structured forum I've seen (and I really didn't know where to post this).

quenenni
Inserter
Inserter
Posts: 21
Joined: Fri Apr 14, 2017 2:16 am
Contact:

Re: resizing tech sprites

Post by quenenni »

I finally found a solution.

Code: Select all

left_table.add{type = "sprite-button", name = "wimrna_left_tech_sprite_"..key, style = "slot_button_style", sprite = "technology/"..key}
The trick was to use sprite-button instead of just sprite.

the style = "slot_button_style", I found it in another mod.
But used, not defined. So it's a predefined class used by the game.

Anyone knows where I can find a list of theses predefined style classes?

Post Reply

Return to “Modding discussion”