Page 1 of 1
Add the ability to unset sprites on GUI elements
Posted: Tue Aug 13, 2019 1:28 pm
by Therenas
Currently, you can set a sprite to a supported GUI element anytime you like, you don't have to set it when creating the element. You can't however unset it after it's been set. Setting it to nil gives an error and setting it to an empty string doesn't do anything. I'd like to be able to unset the sprite without recreating the whole element, preferably by setting it to nil, but whatever works.
Re: Add the ability to unset sprites on GUI elements
Posted: Tue Aug 13, 2019 5:53 pm
by Therax
As a note, writing nil to a sprite or sprite-button gives an error. Writing empty string to a sprite clears the element, but writing empty string to a sprite-button does nothing.
Re: Add the ability to unset sprites on GUI elements
Posted: Tue Aug 13, 2019 7:12 pm
by Therenas
Therax wrote: ↑Tue Aug 13, 2019 5:53 pm
As a note, writing nil to a sprite or sprite-button gives an error. Writing empty string to a sprite clears the element, but writing empty string to a sprite-button does nothing.
Yes exactly. What's even worse is that when you set it to an empty string, the sprite will still be shown visually, but reading .sprite will return the empty string, which is obviously not the sprite that's displayed.