Get widget size in shader editor?
I have a procedural round box that I want to use for the texture on the widget. The widget will be able to scramble and I want the shader to adjust to the size of the widget. How do I get the size of the widget through the editor shader?
asked Jun 02 '19 at 04:35 PM in Using UE4
Hm, you can't get it (afaik) but you can pipe the data in through a parameter. You'd need to create a Dynamic Material Instance with a parameter and update the material when the widget changes size. You may need to call Force Layout Prepass just after updating widget size but before getting Desired Size to ensure you're not fetching stale data.
I'm assuming you need more from this than just a border that autoscales as there's a much better solution to this that fiddling with a material. Leaving a link just in case - Setting Image States:
Follow this question
Once you sign in you will be able to subscribe for any updates here