# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/pizza-pursuit-4-managing-and-displaying-the-score-for-time-trial-in-verse
# Local doc: epic-docs/documentation/en-us/fortnite/pizza-pursuit-4-managing-and-displaying-the-score-for-time-trial-in-verse.md
# Section: Creating the UI
score_manager := class:
<# Since we won't recreate the canvas during the score manager lifetime, do it once anytime an object of this type is created.>
block:
set Canvas = canvas:
Slots := array:
canvas_slot:
Anchors := anchors{Minimum := vector2{X := 0.0, Y := 0.25}, Maximum := vector2{X := 0.0, Y := 0.25} }
Offsets := margin{Top := 0.0, Left := 25.0, Right := 0.0, Bottom := 0.0}
Alignment := vector2{X := 0.0, Y := 0.0}
SizeToContent := true
Widget := stack_box:
Orientation := orientation.Vertical
Slots := array:
stack_box_slot:
HorizontalAlignment := horizontal_alignment.Left
Widget := TotalGameScoreWidget
stack_box_slot:
HorizontalAlignment := horizontal_alignment.Left
Widget := PendingScoreWidget
stack_box_slot:
HorizontalAlignment := horizontal_alignment.Left
Widget := PickupLevelWidget
AddScoreManagerToUI<public>() : void =
if (PlayerUI := MaybePlayerUI?):
PlayerUI.AddWidget(Canvas)
UpdateUI()
<# Adds PendingPickupPoints to TotalPickupPoints and resets PendingPickupPoints to 0.
Verse Library
verse
05 Creating The Ui
Defines a class that initializes a HUD canvas with score widgets and provides methods to update game score and pickup level displays.
extracted-snippets/documentation/en-us/fortnite/pizza-pursuit-4-managing-and-displaying-the-score-for-time-trial-in-verse/05-creating-the-ui.verse
Sign in free to read the full source 🌴
This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.