Hi ,
I have drawn material simple using blueprint to bring my custom textured material in button. But I want to do the same thing in C++. How to draw buttons with custom shape in C++ ?
This is my sample code for creating a button
+ SOverlay::Slot().Padding(FMargin(GameButtonLeftMargin, GameButtonTopMargin + 100, GameButtonRightMargin, GameButtonBottomMargin - 100))
[
SNew(SHorizontalBox).Visibility(EVisibility::Visible)
+ SHorizontalBox::Slot()
[
SAssignNew(GameButton, SButton)
.Cursor(EMouseCursor::Default)
// .OnClicked(this, &SDDFileTree::RefreshButtonPressed)
.ButtonColorAndOpacity(FColor::FromHex(GamebuttonColor))
[
//Colored Background
SAssignNew(GameButtonText, STextBlock)
.Text(FString("Options"))
.Font(GamebuttonTextFont)
/*.Font(FSlateFontInfo(FPaths::EngineContentDir() / TEXT("Slate/Fonts/Roboto-Bold.ttf"), 16))*/
.ColorAndOpacity(FColor::FromHex(GamebuttonTextColor))
// .HighlightColor(FColor::FromHex("#B7D5FFFF"))
.ShadowColorAndOpacity(FLinearColor::Black)
.ShadowOffset(FIntPoint(1, -1))
]
]
]