手順
Widget Blueprint の作成
手順1
コンテンツドロワー内で右クリックして「User Interface > Widget Blueprint」を選択する。

手順2
「User Widget」を選択してファイル名を設定する。

手順3
ルートに Canvas Panel を設置し、その直下などに UEFN Text Block を追加する。

バインディング
手順4
下の「View Bindings」から「Add Viewmodel」を押す。

手順5
「Device – Message View Model」を選択して右下の「Select」を押す。

手順6
ヒエラルキー内の UEFN Text Block を選択している状態で下の「View Bindings」から「Add Widget {ウィジェット名}」を押す。

手順7
チェックボックスの右側のウィジェット名のボタンを押して「Text」を選択し、右下の「Select」を押す。

手順8
「No field selected」となっている部分を押して「MVVM_UEFN_HUDMessage > Text」を選択し、右下の「Select」を押す。

手順9
左上の「Compile」を押し、その左の保存ボタンも押す。

HUD Message Device の設置と設定
手順10
コンテンツドロワーを開き、「Fortnite > Devices > UI」にある HUD Message Device をレベル上にドラッグ & ドロップする。

手順11
レベル上の HUD Message Device を選択して「Details > User Options > HUD Widget」に先ほど作成した Widget Blueprint をアサインする。

手順12
必要に応じて HUD Message Device の「Placement」や「Screen Anchor」等のアンカーに関する設定も行う。

Verse での処理の作成
手順13
Verse Explorer のプロジェクト名を右クリックして「Add new Verse file to project」を選択する。

手順14
左上で「Verse Device」を選択して「Device Name」を設定し、右下の「Create」を押す。

手順15
以下のような、hud_message_device にテキストを設定して表示する処理を記述して保存する。
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
sample_device := class(creative_device):
@editable
HudMessageDevice:hud_message_device= hud_message_device{}
OnBegin<override>()<suspends>:void =
HudMessageDevice.Show(StringToMessage("Hello World"))
StringToMessage<localizes>(StringValue:string):message = "{StringValue}"
手順16
UEFN に戻り、上の「Verse」から「Build Verse Code」を押す。

手順17
コンテンツドロワー内に出現した Verse のデバイスをレベル上にドラッグ & ドロップして「@editable」を付けたメンバ変数にレベル上の HUD Message Device をアサインする。

デバッグ
手順18
上の「Launch Session」か「Push Changes」を押して Fortnite に切り替える。

手順19
ゲームをスタートして Verse で設定したテキストが表示される事を確認する。
