// Create a property name widget for a float value TSharedPtrPropertyNameWidget = CreatePropertyNameWidget("FloatValue"); // Add the widget to a UI panel MyPanel->AddSlot() .AutoHeight() .HAlign(HAlign_Left) .VAlign(VAlign_Top) [ PropertyNameWidget.ToSharedRef() ];
// Create a property name widget for a boolean value TSharedPtrThis example creates a property name widget for a boolean value called "bIsEnabled". The widget is then customized by setting its foreground color and font. Finally, the widget is added to a UI panel using the AddSlot function. The package library for this function is the Unreal Engine library, which is a collection of C++ classes and functions that are used to create games and applications in the Unreal Engine.PropertyNameWidget = CreatePropertyNameWidget("bIsEnabled"); // Set some properties on the widget PropertyNameWidget->SetForegroundColor(FLinearColor::Green); PropertyNameWidget->SetFont(FSlateFontInfo("Arial", 12)); // Add the widget to a UI panel MyPanel->AddSlot() .AutoHeight() .HAlign(HAlign_Left) .VAlign(VAlign_Top) [ PropertyNameWidget.ToSharedRef() ];