I’m trying to make a custom UMG widget for a plugin I have. It’s pretty simple I have a text box and a dynamic number of buttons. What I’m looking for is a way to style portions of the UMG widget. EX) change the font and style of the Textblock in the title, the button style for each button, the background etc. I know that you need to have UPROPERTY(EditAnywhere) for a member variable to be editable and visible in the editor. But I don’t want to jsut copy the existing fields that come from a TextBlock or a button or a border and put it into my custom widget if I don’t have to. I want to use the existing ones somehow.
I tried to put a UTextBlock* in the header file to be accessible by the blueprint but that didn’t give me access to the details. I just really don’t want to copy and paste everything and do it multiple times for the different parts of the Widget. Otherwise i’ll need like 2 different Text styles one for the button text and another for the Title text. It just seems like I’m not doing it right.
This is an example of what I currently have.
This is what I have for my header file currently.
UCLASS()
class VN_MIDDLEMAN_API UVN_DialogAreaWidget : public UWidget
{
GENERATED_BODY()
public:
virtual void SynchronizeProperties() override;
UFUNCTION(BlueprintCallable, Category="Appearance")
virtual void SetDialog(FText dialog);
UFUNCTION(BlueprintCallable, Category="Appearance")
virtual void SetDialogOptions(TMap<FString,FText> DialogOptions);
#if WITH_EDITOR
virtual const FText GetPaletteCategory() override;
#endif
UPROPERTY(EditAnywhere)
FTextBlockStyle textBlockStyle; //Sets the style for the header.
UPROPERTY(EditAnywhere)
FSlateFontInfo Font; //Sets the font for the header.
/*
//I tried to do this so I didnt need to copy the text attributes and make my own.
UPROPERTY()
class UTextBlock* TextBlock;
*/
protected:
virtual TSharedRef<SWidget> RebuildWidget() override;
virtual void ReleaseSlateResources(bool bReleaseChildren) override;
TMap<FString, FText> m_DialogOptions;
TSharedPtr<class IVN_DialogWidgetInterface> m_pDialogWidget;
};