October 2016
Intermediate to advanced
452 pages
9h 47m
English
While creating buttons is all well and fine, at the moment, any UI element you add to the player's screen just sits there without anything happening even if a user clicks on it. We don't have any event handlers attached to the Slate elements at the moment, so events such as mouse clicks don't actually cause anything to happen.
This recipe shows you how to attach functions to these events so that we can run custom code when they occur.
GameMode subclass called AClickEventGameMode.private members to the class:private: TSharedPtr<SVerticalBox> Widget; TSharedPtr<STextBlock> ButtonLabel;
public functions, noting the override for BeginPlay() ...Read now
Unlock full access