Sprites won't accept size input?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 232
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Sprites won't accept size input?

Post by Therenas »

I'm currently trying to get a GuiElement sprite to accept my style directions for height and width. When doing this with sprite-buttons, my size directions get through, like in this example:

Code: Select all

table.add{type="sprite-button", name="button_" .. id, sprite="item/" .. icon}
table["button_" .. id].style.width = 34
table["button_" .. id].style.height = 34
It displays in 34x34, as specified. When I try to do the same with a normal sprite: (both need to be named button_ for other uses, don't let that confuse you)

Code: Select all

table.add{type="sprite", name="button_" .. id, sprite="item/" .. icon}
table["button_" .. id].style.width = 34
table["button_" .. id].style.height = 34
It doesn't work, the sprite displays in a very small size, maybe 5x5. What am I doing wrong here?

User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 232
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Re: Sprites won't accept size input?

Post by Therenas »

Alright I just found out that when viewed on a 1080p monitor, all is fine. Previously I viewed it on my 4K screen. I assume, to fix this, it has something to do with the style.scaleable attribute, but I tried it out for a bit and couldn't work out what that really does, can anyone help? Thanks

Bilka
Factorio Staff
Factorio Staff
Posts: 3123
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Sprites won't accept size input?

Post by Bilka »

According to 63353 setting scaleable to false should do the job.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 232
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Re: Sprites won't accept size input?

Post by Therenas »

Just got the chance to try it out, sadly it doesn't seem to change anything.

Post Reply

Return to “Modding help”