Verse Library verse

01 Verse Device Code

Connects volume triggers to a custom UMg widget, dynamically updating UI text and materials in player zones.

extracted-snippets/community/learning/tutorials/07ay/fortnite-using-verse-fields-in-a-umg-user-widget/01-verse-device-code.verse

# Source URL: https://dev.epicgames.com/community/learning/tutorials/07ay/fortnite-using-verse-fields-in-a-umg-user-widget
# Local doc:  epic-docs/community/learning/tutorials/07ay/fortnite-using-verse-fields-in-a-umg-user-widget.md
# Section:    Verse Device Code
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/UI }

verse_fields_example := class(creative_device):
    # Volume editables
    @editable 
    Style1Volume : volume_device = volume_device{}

    @editable 
    Style2Volume : volume_device = volume_device{}

    @editable 
    AddWidgetVolume : volume_device = volume_device{}
    
    # Messages
    Style1Message<localizes> : message = "Style 1!"
    Style2Message<localizes> : message = "Style 2!"

    # Variables
    var MyWidget:UW_FieldsTest = UW_FieldsTest{}
    var Style1Material:MI_Style1ProgressBar = MI_Style1ProgressBar{}
    var Style2Material:MI_Style2ProgressBar = MI_Style2ProgressBar{}
    var VerseProgressValue : float = 0.0

    # Runs when the device is started in a running game
    OnBegin<override>()<suspends>:void=

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.

Sign in with Discord

Comments

    Sign in to vote, comment, or suggest an edit. Sign in