Page 1 of 1

Sprites won't accept size input?

Posted: Wed Dec 12, 2018 3:37 pm
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?

Re: Sprites won't accept size input?

Posted: Fri Dec 14, 2018 11:10 am
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

Re: Sprites won't accept size input?

Posted: Fri Dec 14, 2018 11:16 am
by Bilka
According to 63353 setting scaleable to false should do the job.

Re: Sprites won't accept size input?

Posted: Mon Dec 17, 2018 4:35 pm
by Therenas
Just got the chance to try it out, sadly it doesn't seem to change anything.