Hi. I created a minimal sample code.
“ui_input_mode.All”, the button will be displayed.
“ui_input_mode.None”, the button is not displayed.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/UI }
using { /Fortnite.com/UI }
using { /UnrealEngine.com/Temporary/SpatialMath }
layout_test_device := class(creative_device):
@editable MyButton : button_device = button_device{}
TextForMyUI<localizes> : message = "Center"
OnBegin<override>()<suspends> : void =
MyButton.InteractedWithEvent.Subscribe(HandleButtonInteraction)
HandleButtonInteraction(Agent : agent) : void =
if:
InPlayer := player[Agent]
PlayerUI := GetPlayerUI[InPlayer]
then:
PlayerUI.AddWidget(
CreateMyUI(),
player_ui_slot:
InputMode := ui_input_mode.None #NG
#InputMode := ui_input_mode.All #OK
)
CreateMyUI() : canvas =
MyCanvas : canvas = canvas:
Slots := array:
canvas_slot:
Anchors := anchors:
Minimum := vector2{X := 0.5, Y := 0.5}
Maximum := vector2{X := 0.5, Y := 0.5}
Offsets := margin{Top := 0.0, Left := 0.0, Right := 0.0, Bottom := 0.0}
Alignment := vector2{X := 0.5, Y := 0.5}
SizeToContent := true
Widget := button_loud{DefaultText := TextForMyUI}
return MyCanvas