Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Ugur on April 03, 2014, 07:28:43 AM
-
Hello there,
before i hack my own, i wondered, will you add gradient sprites support anytime soon?
I saw this package on the asset store: https://www.assetstore.unity3d.com/#/content/10397
but it doesn't work with a recent ngui version.
That's also why i'm asking really, i prefer such things to come with ngui where possible rather than me adding them and that then breaking with the next ngui update =)
-
I won't be adding gradient support to sprites. You can create a custom widget if you need that -- it would be pretty easy. Easiest thing to do is to derive from UITexture and change the OnFill function to specify 4 different colors instead of just 1.
-
Bummer you're not considering adding gradient support for sprites. May i ask why that is?
And hm, UITexture? Those are bad in so many ways :I
-
I'd rather not clutter the inspector with parameters for a feature that most people won't find useful. Gradients are extremely easy to accomplish by using a sliced sprite with source texture dimensions as low as 3x3 pixels, and that's what most people choose to do. Doing it via code would allow the colors to be change-able on the fly, but it's a very niche feature -- I see very little use for it.
-
I think it depends a lot on your UI type/style and how many separate images you want to have in your atlas =)
Me personally, i prefer to have as few images in the atlas as possible so the atlas image is as small as possible in most projects.
For many things one can create all sorts of shapes by just having a few base shape images in the atlas and combining them to different other stuff.
Adding support for gradient sprites would enhance that flexibility a lot.
As you said it, right now one would have to have one image for each gradient if one goes the way of storing the gradient in the atlas, and yeah, that's not just not ideal when for some things one wants to have many gradient combinations be possible but also when one wants to change the gradients' setup at runtime.