Download

Need help creating complex UI widgets with Slate

I have a couple of relatively complex UI components I want to build. I imagine it’s going to require the use of Slate rather than being totally achievable in UMG, but I’ve never used Slate before, so I’m wondering if anyone can tell me (1) whether what I want to achieve is possible, and (2) how I might go about doing it (not looking for the actual solutions, just a point in the right direction).

Essentially the two controls I want to create are similar to the curve and gradient editors in Photoshop (and similar things in many other applications).

For the curve control I want the player to be able to add points to a curve that runs 0->1 on both axes. Would be great if I can include bezier handles on the points (which the Photoshop curve editor doesn’t have). So the player can define a custom curve and I need to then be able to extract data from this curve later on.

For the gradient control, I want the player to be able to add as many stops along the gradient as they want, setting a colour and position. Again, I then want to be able to read different colours from the resultant gradient later on.

So, is this viable in Slate? Can anyone point me in the right direction for something like this?



#include "Runtime/Engine/Classes/Curves/CurveFloat.h"
#include "Runtime/Engine/Classes/Curves/CurveLinearColor.h"


UPROPERTY(Category = "Test", EditAnywhere) **FRuntimeFloatCurve** FloatCurveTest;

UPROPERTY(Category = "Test", EditAnywhere) **FRuntimeCurveLinearColor** ColorCurveTest;


Use Widget Reflector to see how slate widgets for those structs were made.