I’m using the SColorTheme classes as a template for building my own drag and drop widgets, but I’m having a problem with the image that follows your cursor after a drag is started.
Everything works fine with it except for the alpha, which just reads as being solid. I’m using the same image as in another widget, which displays it just fine, so I’m wondering if there is a flag I need to turn on to get the alpha recognized in the decorator.
Here’s the code that builds up the decorator:
TSharedPtr<SWidget> FNodeDragDrop::GetDefaultDecorator() const
{
if(IconBeingDragged != nullptr)
{
return SNew(SBox)
.WidthOverride(32.f)
.HeightOverride(32.f)
[
SNew(SImage).Image(IconBeingDragged)
];
}
return SNew(SBorder)
.Cursor(EMouseCursor::GrabHandClosed)
[
SNew(SColorBlock)
.Color(FLinearColor::Green)
];
}
IconBeingDragged is declared in the FNodeDragDrop class as:
const FSlateBrush* IconBeingDragged;
And the value that is passed to IconBeingDragged is eventually tracked back to a style sheet and declared as:
UPROPERTY(EditAnywhere, Category = EquationEditorWidgetStyle) FSlateBrush IconAdd;
Any ideas on where I’m going wrong with setting up the alpha for this particular widget?