- Home /
How can I fill UI sprite with gradient animation?
I want to achieve that kind of thing in Unity:
I'd write a shader with two textures, the radar visual and a gradient texture. Or write the whole gradient as a formula. then, based on an additional value, pixels from the gradient get multiplied and clamped and then multiplied by the radar texture.
Would it be hard to write such a shader? I don't have experience with shaders at all
I don't know whether I am correct or not but I think this also can be achieved with Image component also. For that, you must have the gradient image which you need to fill that.
The hierarchy would be something like:
Canvas ( with Rendering mode set to World Space Canvas) if required Child 1: Contains Image component with only outer.
Child1's child: contains 2D Rect $$anonymous$$ask
Child of 2D Rect mask: this will the image with the fill values 0 to 1. Now this will contain the complete gradient.
Note: this will not achieve the same effect, but can sort of work for that.
Your answer
Follow this Question
Related Questions
Images getting distorted -SOLVED 2 Answers
How do I scale the Xmax value of a RectTransform 3 Answers
How do I add a "pointer" to my UI menu? 1 Answer
Difficulties with world space canvas interaction 1 Answer
Instantiated UI objects with image components not appearing, rest of object works fine. 0 Answers