c++menuunreal-engine4

How to add SWidgetSwitcher and get/set current widget index in Unreal Engine 4?


I'm trying to make a simple menu widget with Slate. I'm able to add canvas, buttons etc like SNew(SCanvas) but I am stuck with SNew(SWidgetSwitcher), on how to use this and set the widget index. I'm new to this and havn't found much info on Google, so:
How to I add an SWidgetSwitcher and get/set current widget index in Unreal Engine 4?


Solution

  • SNew(SWidgetSwitcher)
    .WidgetIndex(this, &SMyUIWidget::GetCurrentTabIndex)
    

    This might help you: https://nerivec.github.io/old-ue4-wiki/pages/slate-tabs.html