VerseIsland
Feed Learn Leaderboard Guides Reference Explore Search Docs Verse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Verse Library › Audio
Browse Verse Library

Library

Devices 634
  • Devices171
  • Triggers & Logic118
  • UI & HUD40
  • Audio39
  • Items & Inventory29
  • Events27
  • Scoring & Objectives25
  • Spawning19
  • Classes & Interfaces18
  • Game Modes17
  • Props & Meshes14
  • Variables & Mutability12
  • Player Management11
  • Modules & Structure10
  • Round Flow8
  • Animation6
  • Concurrency6
  • Functions6
  • Getting Started6
  • Teams & Classes6
  • NPCs & AI5
  • Tutorials5
  • VFX & Particles5
  • Arrays & Maps4
  • Cameras4
  • Debugging4
  • Control Flow3
  • Cinematics2
  • Other2
  • Persistence2
  • Scene Graph2
  • Structs & Enums2
  • Building1
  • Physics1
  • Publishing & Islands1
  • Syntax & Types1
  • Vehicles1
  • Weapons1
Verse Language 257
  • Control Flow35
  • Functions26
  • Arrays & Maps25
  • Classes & Interfaces22
  • Variables & Mutability22
  • Concurrency21
  • Syntax & Types18
  • Modules & Structure12
  • Debugging8
  • Devices8
  • Events7
  • Player Management6
  • Structs & Enums6
  • Triggers & Logic6
  • Game Modes5
  • Failure & Options4
  • Scene Graph4
  • UI & HUD4
  • Getting Started3
  • Round Flow3
  • Spawning3
  • VFX & Particles3
  • Reference2
  • Animation1
  • Best Practices1
  • Other1
  • Props & Meshes1
Materials/VFX 154
  • Triggers & Logic27
  • UI & HUD17
  • Devices16
  • VFX & Particles14
  • Props & Meshes11
  • Scoring & Objectives9
  • Game Modes7
  • Items & Inventory7
  • Functions6
  • Arrays & Maps5
  • Animation3
  • Cinematics3
  • Classes & Interfaces3
  • Control Flow3
  • Events3
  • Modules & Structure3
  • Round Flow3
  • Spawning3
  • Getting Started2
  • Scene Graph2
  • Variables & Mutability2
  • Concurrency1
  • Persistence1
  • Player Management1
  • Structs & Enums1
  • Syntax & Types1
General 153
  • Devices22
  • Events20
  • Triggers & Logic20
  • Classes & Interfaces10
  • Variables & Mutability8
  • Round Flow6
  • Scoring & Objectives6
  • UI & HUD6
  • Functions5
  • Player Management5
  • Game Modes4
  • Getting Started4
  • Props & Meshes4
  • Control Flow3
  • Syntax & Types3
  • VFX & Particles3
  • Arrays & Maps2
  • Best Practices2
  • NPCs & AI2
  • Other2
  • Physics2
  • Scene Graph2
  • Spawning2
  • Structs & Enums2
  • Tutorials2
  • Building1
  • Cameras1
  • Cinematics1
  • Failure & Options1
  • Items & Inventory1
  • Teams & Classes1
Player 133
  • Player Management22
  • Teams & Classes19
  • Classes & Interfaces12
  • Devices11
  • Events9
  • Persistence7
  • Triggers & Logic7
  • Arrays & Maps6
  • Functions4
  • Game Modes4
  • Items & Inventory4
  • Round Flow4
  • Debugging3
  • Getting Started3
  • Modules & Structure3
  • Concurrency2
  • Control Flow2
  • Scoring & Objectives2
  • Spawning2
  • Structs & Enums2
  • Physics1
  • Props & Meshes1
  • UI & HUD1
  • Variables & Mutability1
  • Weapons1
Building & Props 131
  • Variables & Mutability15
  • Props & Meshes14
  • Triggers & Logic12
  • Classes & Interfaces10
  • Devices10
  • UI & HUD10
  • Events7
  • Teams & Classes7
  • Animation5
  • Building5
  • Functions5
  • VFX & Particles5
  • Structs & Enums4
  • Control Flow3
  • Game Modes3
  • Items & Inventory3
  • Round Flow3
  • Scene Graph3
  • Arrays & Maps2
  • Concurrency2
  • Reference2
  • Modules & Structure1
NPCs & AI 76
  • NPCs & AI35
  • Spawning7
  • Animation5
  • Variables & Mutability5
  • Classes & Interfaces3
  • Debugging3
  • UI & HUD3
  • Audio2
  • Concurrency2
  • Game Modes2
  • Props & Meshes2
  • Triggers & Logic2
  • Devices1
  • Functions1
  • Getting Started1
  • Reference1
  • VFX & Particles1
Spawning 73
  • Spawning31
  • Events7
  • Concurrency6
  • Player Management6
  • Vehicles5
  • Props & Meshes4
  • Devices3
  • Scene Graph3
  • Items & Inventory2
  • Teams & Classes2
  • Control Flow1
  • Publishing & Islands1
  • Reference1
  • Scoring & Objectives1
Cinematics 71
  • Cameras19
  • Cinematics15
  • Devices11
  • Audio5
  • Animation4
  • Triggers & Logic4
  • Functions2
  • Game Modes2
  • UI & HUD2
  • Classes & Interfaces1
  • Concurrency1
  • Control Flow1
  • Items & Inventory1
  • Modules & Structure1
  • Scene Graph1
  • Templates1
UI 57
  • UI & HUD35
  • Devices5
  • Scoring & Objectives4
  • Classes & Interfaces3
  • Round Flow2
  • Scene Graph2
  • Arrays & Maps1
  • Props & Meshes1
  • Structs & Enums1
  • Templates1
  • Triggers & Logic1
  • Variables & Mutability1
Scene Graph 40
  • Scene Graph9
  • Items & Inventory8
  • Classes & Interfaces3
  • Events3
  • Props & Meshes3
  • Functions2
  • Arrays & Maps1
  • Building1
  • Control Flow1
  • Debugging1
  • Modules & Structure1
  • Player Management1
  • Reference1
  • Structs & Enums1
  • Syntax & Types1
  • Triggers & Logic1
  • UI & HUD1
  • VFX & Particles1
Vehicles 38
  • Spawning11
  • Devices7
  • Vehicles7
  • Props & Meshes4
  • Functions2
  • Game Modes2
  • Failure & Options1
  • Items & Inventory1
  • Reference1
  • Teams & Classes1
  • Tutorials1
Tutorials 37
  • Game Modes6
  • Triggers & Logic5
  • Classes & Interfaces4
  • Events4
  • Props & Meshes3
  • Building2
  • Devices2
  • Items & Inventory2
  • Scoring & Objectives2
  • Animation1
  • Arrays & Maps1
  • Cameras1
  • Concurrency1
  • Physics1
  • Player Management1
  • Structs & Enums1
Weapons 30
  • Game Modes6
  • Weapons6
  • Devices5
  • Items & Inventory3
  • Scoring & Objectives3
  • Spawning2
  • Teams & Classes2
  • Best Practices1
  • Functions1
  • Triggers & Logic1
Items 28
  • Items & Inventory23
  • Devices2
  • Triggers & Logic2
  • Spawning1
Assets 20
  • Modules & Structure6
  • Arrays & Maps3
  • Functions3
  • Scene Graph2
  • Best Practices1
  • Devices1
  • Events1
  • Failure & Options1
  • Physics1
  • Variables & Mutability1
Animation 19
  • Animation10
  • Variables & Mutability4
  • Devices1
  • Player Management1
  • Props & Meshes1
  • Scene Graph1
  • Syntax & Types1
Release Notes 17
  • Classes & Interfaces5
  • Modules & Structure3
  • Concurrency2
  • Control Flow2
  • Variables & Mutability2
  • Debugging1
  • Devices1
  • Items & Inventory1
Input & Controls 16
  • Functions4
  • UI & HUD3
  • Control Flow2
  • Animation1
  • Arrays & Maps1
  • Cinematics1
  • Debugging1
  • Devices1
  • Events1
  • Items & Inventory1
Publishing 8
  • Control Flow5
  • Arrays & Maps1
  • Devices1
  • Syntax & Types1
Audio 7
  • Audio5
  • UI & HUD2
Landscape 7
  • Other4
  • VFX & Particles2
  • Scene Graph1
Persistence 6
  • Structs & Enums2
  • Items & Inventory1
  • Persistence1
  • Publishing & Islands1
  • Variables & Mutability1
Physics 5
  • Functions2
  • Classes & Interfaces1
  • Devices1
  • Syntax & Types1
Creator Economy 3
  • Publishing & Islands2
  • Modules & Structure1
Discovery 3
  • Devices1
  • NPCs & AI1
  • Structs & Enums1
Editor & Project 3
  • Other1
  • Props & Meshes1
  • Tutorials1

Customisable Security Keypad With SFX

Module — 2 files
These files compile together (same module folder).
ez_ui_keypad_v2.verse
<#

   A customisable security keypad connected to a barrier device but 
   could be rewritten to affect anything you want such as chests, doors
   or even NPCs. These placeholder visuals are freely available from my
   Instagram Threads page at this link: https://www.threads.net/@kryyative/post/CzXCZ_ENBc3

#>


using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

#imports
using { /UnrealEngine.com/Temporary/UI }
using { /Fortnite.com/UI }
using { /Verse.org/Colors }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Verse.org/Assets }
using {EZUI}

EZ_KeypadManager := class () 
{
    EZ_LinkedCreativeDevice<public> : ez_ui_keypad_v2       # a backreference to the device that created this EZUI class
    EZ_LinkedPlayer<public> : player                        # the player linked to this instance of the EZUI class
    EZ_UI_ID<public> : int                                  # used to control what UI is initialised by the class

    EZ_RequiredPIN_000to999<public> : string                # the valid PIN
    EZ_BarrierDevice<public> : barrier_device               # the device controlled by the keypad
    EZ_AccessGrantedSFX<public> : audio_player_device       # correct PIN sfx
    EZ_AccessDeniedSFX<public> : audio_player_device        # incorrect PIN sfx

    var IsInitialized<private> : logic = false              # a lock to prevent recreating the canvas after the first execution of Initialize()
    var MainCanvas<private> : canvas = canvas{}             # the canvas that holds all the screen elements and will be added to the PlayerUI
    var InputCount : int = 0
    var InputPINArray : []?int = array{false,false,false}   #input PIN values

    EZUI_Position_Horizonal<public> : type{_X:float where 0.000000 <= _X, _X <= 1.000000} = 0.5
    EZUI_Position_Vertical<public> : type{_X:float where 0.000000 <= _X, _X <= 1.000000} = 0.5

    #Interactive UI components
    WidgetUIButton1:button_quiet=button_quiet{}
    WidgetUIButton2:button_quiet=button_quiet{}
    WidgetUIButton3:button_quiet=button_quiet{}
    WidgetUIButton4:button_quiet=button_quiet{}
    WidgetUIButton5:button_quiet=button_quiet{}
    WidgetUIButton6:button_quiet=button_quiet{}
    WidgetUIButton7:button_quiet=button_quiet{}
    WidgetUIButton8:button_quiet=button_quiet{}
    WidgetUIButton9:button_quiet=button_quiet{}
    WidgetUIButtonCancel:button_quiet=button_quiet{}
    WidgetUIButton0:button_quiet=button_quiet{}
    WidgetUIButtonAccept:button_quiet=button_quiet{}

    #Custom Visual UI components
    <# 
        Design your visible UI widgets here which use imported custom visuals

        This is only used if you enable the "UseCustomArt" tickbox on the properties but you will 
        need to define the imported assets where by their path andfilename under the DefaultImage 
        and set the DesiredSize to match the image dimensions.

        refer to https://dev.epicgames.com/documentation/en-us/uefn/exposing-assets-to-verse-in-unreal-editor-for-fortnite
        for info on how to import custom textures required for texture_blocks. 
    #>

    # graphics layer which contains visual elements of the UI
    GfxLayerWidget<private> : canvas = canvas{Slots := array{}}

    # the default keypad gfx widget
    Intial_KeyPadGfxWidget<private> : texture_block = texture_block
    {
        DefaultImage := Textures.KeypadTemplatePNG
        DefaultDesiredSize := vector2{X := 250.0, Y := 400.0}
    }

    # 1st PIN entered gfx
    FirstPIN_KeyPadGfxWidget<private> : texture_block = texture_block
    {
        DefaultImage := Textures.KeypadTemplate_PIN1PNG
        DefaultDesiredSize := vector2{X := 250.0, Y := 400.0}
    }

    # 2nd PIN entered gfx
    SecondPIN_KeyPadGfxWidget<private> : texture_block = texture_block
    {
        DefaultImage := Textures.KeypadTemplate_PIN2PNG
        DefaultDesiredSize := vector2{X := 250.0, Y := 400.0}
    }

    # 3rd PIN entered gfx
    ThirdPIN_KeyPadGfxWidget<private> : texture_block = texture_block
    {
        DefaultImage := Textures.KeypadTemplate_PIN3PNG
        DefaultDesiredSize := vector2{X := 250.0, Y := 400.0}
    }

    # PIN accepted gfx
    Accepted_KeyPadGfxWidget<private> : texture_block = texture_block
    {
        DefaultImage := Textures.KeypadTemplate_AcceptedPNG
        DefaultDesiredSize := vector2{X := 250.0, Y := 400.0}
    }

    # PIN denied gfx
    Denied_KeyPadGfxWidget<private> : texture_block = texture_block
    {
        DefaultImage := Textures.KeypadTemplate_DeniedPNG
        DefaultDesiredSize := vector2{X := 250.0, Y := 400.0}
    }

    # debugging color block
    DebugBlock<private> : color_block = color_block
    {
        DefaultColor := color{R := 1.0, G := 0.0, B := 0.0}
        DefaultOpacity := 0.75
    }

    # some common UI presets
    DefaultKeyPadding : margin = margin{ Top := 10.0, Left := 10.0, Bottom := 10.0, Right := 10.0 }
    NoPadding : margin = margin{ Top := 0.0, Left := 0.0, Bottom := 0.0, Right := 0.0 }
    CentreAlignment : vector2 = vector2{X := 0.5, Y := 0.5}

    # do all the things
    Ini<public>() : void =
        if (IsInitialized?): 
            return

        if(EZ_UI_ID = 1): # just a hold-over from multi-UI style support

            # subscribe keypad
            WidgetUIButton1.OnClick().Subscribe(OnUIButtonClick)
            WidgetUIButton2.OnClick().Subscribe(OnUIButtonClick)
            WidgetUIButton3.OnClick().Subscribe(OnUIButtonClick)
            WidgetUIButton4.OnClick().Subscribe(OnUIButtonClick)
            WidgetUIButton5.OnClick().Subscribe(OnUIButtonClick)
            WidgetUIButton6.OnClick().Subscribe(OnUIButtonClick)
            WidgetUIButton7.OnClick().Subscribe(OnUIButtonClick)
            WidgetUIButton8.OnClick().Subscribe(OnUIButtonClick)
            WidgetUIButton9.OnClick().Subscribe(OnUIButtonClick)
            WidgetUIButtonCancel.OnClick().Subscribe(OnUIButtonClick)
            WidgetUIButton0.OnClick().Subscribe(OnUIButtonClick)
            WidgetUIButtonAccept.OnClick().Subscribe(OnUIButtonClick)

            KeyPad_1() # builds the main canvas

            # adds the initial keypad gfx to the gfx layer
            GfxLayerWidget.AddWidget
            (
                canvas_slot:
                    Anchors := anchors{Minimum := vector2{X := EZUI_Position_Horizonal , Y := EZUI_Position_Vertical}, Maximum := vector2{X := EZUI_Position_Horizonal, Y := EZUI_Position_Vertical}}
                    Offsets := margin{Top := 0.0, Left := 0.0, Right := 0.0, Bottom := -120.0}
                    Alignment := CentreAlignment
                    ZOrder := 0
                    SizeToContent := true
                            
                    # keypad gfx
                    Widget := overlay:
                        Slots := array:
                            overlay_slot:
                                HorizontalAlignment := horizontal_alignment.Center
                                VerticalAlignment := vertical_alignment.Center
                                Widget := Intial_KeyPadGfxWidget
    
    
            )
        
       
    #.........................


    # registers the main canvas  to the Linked player
    AddUI<public>() : void =
        if (PlayerUI := GetPlayerUI[EZ_LinkedPlayer]):
            PlayerUI.AddWidget(GetMainCanvas(), player_ui_slot{InputMode := ui_input_mode.All}) #all canvas and content interactions active

    #.........................

    # Exposes the class Canvas to public
    GetMainCanvas<public>() : canvas = MainCanvas

    #.........................

    # main canvas with the interaction layer added
    KeyPad_1 <public>() : void =
        set MainCanvas = canvas
        {
            Slots := array
                {
                    # keys 1 - 3
                    Keys1to3Slot := canvas_slot:
                        Anchors := anchors{Minimum := vector2{X := EZUI_Position_Horizonal , Y := EZUI_Position_Vertical}, Maximum := vector2{X := EZUI_Position_Horizonal, Y := EZUI_Position_Vertical}}
                        Offsets := margin{Top := -70.0, Left := 0.0, Right := 0.0, Bottom := -70.0}
                        Alignment := CentreAlignment
                        ZOrder := 1
                        SizeToContent := true
    
                        Widget := overlay:
                            Slots := array:
                                overlay_slot:
                                    Padding:= NoPadding
                                    Widget := stack_box:
                                        Orientation := orientation.Horizontal
                                        Slots := array:
                                            stack_box_slot:
                                                Padding:= DefaultKeyPadding 
                                                Widget := WidgetUIButton1

                                            stack_box_slot:
                                                Padding:= DefaultKeyPadding 
                                                Widget := WidgetUIButton2

                                            stack_box_slot:
                                                Padding:= DefaultKeyPadding 
                                                Widget := WidgetUIButton3
                    # keys 4 - 6
                    Keys4to6Slot := canvas_slot:
                        Anchors := anchors{Minimum := vector2{X := EZUI_Position_Horizonal , Y := EZUI_Position_Vertical}, Maximum := vector2{X := EZUI_Position_Horizonal, Y := EZUI_Position_Vertical}}
                        Offsets := margin{Top := 0.0, Left := 0.0, Right := 0.0, Bottom := 0.0}
                        Alignment := CentreAlignment
                        ZOrder := 1
                        SizeToContent := true
                    
                        Widget := overlay:
                            Slots := array:
                                    overlay_slot:
                                        Padding:= NoPadding
                                        Widget := stack_box:
                                            Orientation := orientation.Horizontal
                                            Slots := array:
                                                stack_box_slot:
                                                    Padding:= DefaultKeyPadding 
                                                    Widget := WidgetUIButton4
                    
                                                stack_box_slot:
                                                    Padding:= DefaultKeyPadding 
                                                    Widget := WidgetUIButton5
                    
                                                stack_box_slot:
                                                    Padding:= DefaultKeyPadding 
                                                    Widget := WidgetUIButton6

                    # keys 7 - 9
                    Keys7to9Slot := canvas_slot:
                        Anchors := anchors{Minimum := vector2{X := EZUI_Position_Horizonal , Y := EZUI_Position_Vertical}, Maximum := vector2{X := EZUI_Position_Horizonal, Y := EZUI_Position_Vertical}}
                        Offsets := margin{Top := 70.0, Left := 0.0, Right := 0.0, Bottom := 70.0}
                        Alignment := CentreAlignment
                        ZOrder := 1
                        SizeToContent := true
                        
                        Widget := overlay:
                            Slots := array:
                                overlay_slot:
                                    Padding:= NoPadding
                                    Widget := stack_box:
                                        Orientation := orientation.Horizontal
                                        Slots := array:
                                            stack_box_slot:
                                                Padding:= DefaultKeyPadding 
                                                Widget := WidgetUIButton7
                        
                                            stack_box_slot:
                                                Padding:= DefaultKeyPadding 
                                                Widget := WidgetUIButton8
                        
                                            stack_box_slot:
                                                Padding:= DefaultKeyPadding 
                                                Widget := WidgetUIButton9

                    # key cancel,0, accept
                    KeysCancelZeroAcceptSlot := canvas_slot:
                        Anchors := anchors{Minimum := vector2{X := EZUI_Position_Horizonal , Y := EZUI_Position_Vertical}, Maximum := vector2{X := EZUI_Position_Horizonal, Y := EZUI_Position_Vertical}}
                        Offsets := margin{Top := 140.0, Left := 0.0, Right := 0.0, Bottom := 140.0}
                        Alignment := CentreAlignment
                        ZOrder := 1
                        SizeToContent := true
                    
                        Widget := overlay:
                            Slots := array:
                                overlay_slot:
                                    Padding:= NoPadding
                                    Widget := stack_box:
                                        Orientation := orientation.Horizontal
                                        Slots := array:
                                            stack_box_slot:
                                                Padding:= DefaultKeyPadding 
                                                Widget := WidgetUIButtonCancel
                    
                                            stack_box_slot:
                                                Padding:= DefaultKeyPadding 
                                                Widget := WidgetUIButton0
                    
                                            stack_box_slot:
                                                Padding:= DefaultKeyPadding 
                                                Widget := WidgetUIButtonAccept

                    # gfx layer
                    GfxLayer := canvas_slot:

                        Anchors := anchors{Minimum := vector2{X := EZUI_Position_Horizonal , Y := EZUI_Position_Vertical}, Maximum := vector2{X := EZUI_Position_Horizonal, Y := EZUI_Position_Vertical}}
                        Offsets := margin{Top := 0.0, Left := 0.0, Right := 0.0, Bottom := 0.0}
                        Alignment := CentreAlignment
                        ZOrder := 0
                        SizeToContent := false            
                        Widget := GfxLayerWidget


                }
            }

            # initial gfx
            Intial_KeyPadGfxWidget.SetDesiredSize(vector2{X := 250.0, Y := 400.0})
            GfxLayerWidget.AddWidget(canvas_slot
            {
                Offsets := margin{Top := 0.0, Left := 0.0, Right := 0.0, Bottom := -120.0}
                Alignment := CentreAlignment
                ZOrder := 0
                        
                # keypad gfx
                Widget := Intial_KeyPadGfxWidget
            } )

            #Print("[EZUI] RefreshGFXSlot: Added Widget")
        
            set IsInitialized = true # Lock the inialization state to prevent from running this function again

    #.........................

    # maps the button widgets to values
    OnUIButtonClick (InputEvent : widget_message) : void=
        InteractingPlayer := InputEvent.Player
        KeyWidget := InputEvent.Source
        var InputValue : int = 0

        # key value bindings
        if (KeyWidget = WidgetUIButton0):
            set InputValue = 0
        if (KeyWidget = WidgetUIButton1):
            set InputValue = 1
        if (KeyWidget = WidgetUIButton2):
            set InputValue = 2
        if (KeyWidget = WidgetUIButton3):
            set InputValue = 3
        if (KeyWidget = WidgetUIButton4):
            set InputValue = 4
        if (KeyWidget = WidgetUIButton5):
            set InputValue = 5
        if (KeyWidget = WidgetUIButton6):
            set InputValue = 6
        if (KeyWidget = WidgetUIButton7):
            set InputValue = 7
        if (KeyWidget = WidgetUIButton8):
            set InputValue = 8
        if (KeyWidget = WidgetUIButton9):
            set InputValue = 9
        if (KeyWidget = WidgetUIButtonCancel):
            set InputValue = 10
        if (KeyWidget = WidgetUIButtonAccept):
            set InputValue = 11
        
        UpdatePIN(InputValue,EZ_LinkedPlayer)

    #.........................

    # keeps track of and handles the numbers input
    UpdatePIN( KeyInput : int, InteractingPlayer : player) : void=
        
            if (KeyInput = 10):
                spawn{PINResult(0)} # close without PIN check
                set InputCount = 0
                return
    
            if (KeyInput = 11):
                spawn{PINResult(1)} #close and check PIN
                set InputCount = 0
                return
            
            if (InputCount = 3):
                return
            
            if (InputCount = 0):
                InsertIntoPINArray(KeyInput)
                RefreshGFXSlot(Intial_KeyPadGfxWidget,FirstPIN_KeyPadGfxWidget)
                set InputCount = 1
                #Print("Input Count = {InputCount}")
                return
    
            else if (InputCount = 1):
                    InsertIntoPINArray(KeyInput)
                    RefreshGFXSlot(FirstPIN_KeyPadGfxWidget,SecondPIN_KeyPadGfxWidget)
                    set InputCount = 2
                    #Print("Input Count = {InputCount}")
                    return
            else:
                if (InputCount = 2):
                    InsertIntoPINArray(KeyInput)
                    RefreshGFXSlot(SecondPIN_KeyPadGfxWidget,ThirdPIN_KeyPadGfxWidget)
                    set InputCount = 3
    
            #Print("Input Count = {InputCount}")

    #.........................

     # clear UI
    ClearAllUI <public>(): void = 
    {
        if (PlayerUI := GetPlayerUI[EZ_LinkedPlayer]) {
            PlayerUI.RemoveWidget(GetMainCanvas())
        }
    }

    #.........................

    # key inpits are inserted into an array
    InsertIntoPINArray(KeyValue : int) : void=
            for (i := 0..InputPINArray.Length -1 ): #iterate
                
                # find the first empty index
                if (InputPINArray[i] = false):
                    #Print("Found Empty Slot @ Index " + "{i}")
                    
                    # fill the emoty index
                    OptKeyValue := option{KeyValue}
                        if(set InputPINArray[i] = OptKeyValue) {}
                            #Print("Added {KeyValue} @ Index " + "{i}")
                            return

    #.........................

    # converts the contents of the PINArray into a string to be compared with RequiredPIN_000to999
    PINArrayToString() : string =
    {
        var i0 : int = 0
        var i1 : int = 0
        var i2 : int = 0
        if (NewPIN0 := InputPINArray[0]?) { set i0 = NewPIN0 }
        if (NewPIN1 := InputPINArray[1]?) { set i0 = NewPIN1 }
        if (NewPIN2 := InputPINArray[2]?) { set i0 = NewPIN2 }

        return "{i0}{i1}{i2}"
    }
      

    #.........................

    # the function used to update the UI visuals
    RefreshGFXSlot(CurrentGfxWidget : texture_block, NewGfxWidget : texture_block) : void =
        GfxLayerWidget.RemoveWidget(CurrentGfxWidget)
        #Print("[EZUI] RefreshGFXSlot: Removed Widget")

        NewGfxWidget.SetDesiredSize(vector2{X := 250.0, Y := 400.0})

        GfxLayerWidget.AddWidget(canvas_slot
        {
            Offsets := margin{Top := 0.0, Left := 0.0, Right := 0.0, Bottom := -120.0}
            Alignment := CentreAlignment
            ZOrder := 0
                        
            # keypad gfx
            Widget := NewGfxWidget
        })

        #Print("[EZUI] RefreshGFXSlot: Added Widget")

    #.........................

    # handles all of sfx and visuals for a PIN Result then closes the UI
    PINResult(CloseType : int)<suspends>:void=

            # close type defines exiting the UI or attempting to enter the PIN
            if (CloseType = 1):
                EnteredPIN := PINArrayToString()
                #Print("DEBUG: PIN Entered is {EnteredPIN}")
    
                if (EnteredPIN = EZ_RequiredPIN_000to999):
                    EZ_AccessGrantedSFX.Play()
                    EZ_BarrierDevice.Disable()
                    RefreshGFXSlot(ThirdPIN_KeyPadGfxWidget,Accepted_KeyPadGfxWidget)
                    #Print("DEBUG: Correct PIN")

                    Sleep(1.0) # wait a moment to see the PIN result

                    RefreshGFXSlot(Accepted_KeyPadGfxWidget,Intial_KeyPadGfxWidget) # reset gfx

                else:
                    EZ_AccessDeniedSFX.Play()
                    EZ_BarrierDevice.Enable()
                    RefreshGFXSlot(ThirdPIN_KeyPadGfxWidget,Denied_KeyPadGfxWidget)
                    #Print("DEBUG : Wrong PIN")
    
                    Sleep(1.0) # wait a moment to see the PIN result

                    RefreshGFXSlot(Denied_KeyPadGfxWidget,Intial_KeyPadGfxWidget) # reset gfx
    
            #clear PIN inputs
            for (i := 0..InputPINArray.Length - 1):
                if (set InputPINArray[i] = false) {} 
    
            ClearAllUI()
    #.........................
   

} # END EZ_KeypadManager ------------------------------------------------------------------------------------------------------------------------------------

ez_ui_keypad_v2 := class(creative_device):

    @editable ShowUITrigger : trigger_device = trigger_device {}

    @editable RequiredPIN_000to999 : string = "009" # between 000 and 999 only
    
    @editable BarrierDevice : barrier_device = barrier_device{}
    @editable AccessGrantedSFX : audio_player_device = audio_player_device{}
    @editable AccessDeniedSFX : audio_player_device = audio_player_device{}

    @editable var UI_Position_Horizonal : type{_X:float where 0.000000 <= _X, _X <= 1.000000} = 0.5
    @editable var UI_Position_Vertical : type{_X:float where 0.000000 <= _X, _X <= 1.000000} = 0.5

    # UI regisitration
    var PlayerToUIMap : [player]EZ_KeypadManager = map{} #[playerdata]/ez_ui class


    OnBegin<override>()<suspends> : void =
        ShowUITrigger.TriggeredEvent.Subscribe(OpenUI)

    # all the steps needed to open the Pop Up
    OpenUI<private>(MaybePlayer : ?agent) : void = 
    {
    
        # check that the event was triggered by a player and stop if it wasn't
        Result := EZUI.IsAPlayer(MaybePlayer,Self)
        if (Result = false):
            return
        #.........................

        # pop-up templates selected by a UI ID number
        var UI_ID : int = 1 #just one texture based UI 

        #.........................

        if(PlayerAgent := MaybePlayer?): #set the typing to agent from ?agent
 
            # Verify if an Linked pop-up manager already exists and uses it, if not, create a new one
            if ( InteractingPlayer := player[PlayerAgent] ) 
            {   
                var OptPlayerUI :?EZ_KeypadManager = false

                if (ThisPlayerUI := PlayerToUIMap[InteractingPlayer])
                { set OptPlayerUI = option{ThisPlayerUI} }

                else if (ThisPlayerUI := set PlayerToUIMap[InteractingPlayer] = EZ_KeypadManager

                            #everything that is passed to the EZ manager
                            { 
                                EZ_LinkedCreativeDevice := Self, 
                                EZ_LinkedPlayer := InteractingPlayer,
                                EZ_UI_ID := UI_ID,

                                EZ_RequiredPIN_000to999 := RequiredPIN_000to999,
                                EZ_BarrierDevice := BarrierDevice,
                                EZ_AccessGrantedSFX := AccessGrantedSFX,
                                EZ_AccessDeniedSFX := AccessDeniedSFX,

                                EZUI_Position_Horizonal := UI_Position_Horizonal,
                                EZUI_Position_Vertical := UI_Position_Vertical

                            }
                        ) 

                    
                { ThisPlayerUI.Ini(), set OptPlayerUI = option{ThisPlayerUI} }
        
                # Try to open the Interface for the player
                if (PlayerUI := OptPlayerUI?):
                    PlayerUI.AddUI()
                else 
                    { Print("Error when getting saved or creating ThisPlayerUI") }
            }
        #.........................
    }


<#
    a special thamks to: 
        Mayapple
        SprinterMax
        Daigorō
        CUDL_DreamyFox
        UEFN Discord community

    ****************************************************************************************
    Made with EZUI, please follow @kryyative on Instagram Threads and @KryyssX on X (Twitter)
    for more useful Snippets, UEFN & UE5 news,tutorials and community spotlights!
    ****************************************************************************************

    If you found EZUI useful please include the text above in your credits to show your support
    for my work and encourage others to use EZUI for their projects. Thank you! ^_^
#>
file_2.verse
<#
   This module needs to be used for any EZUI scripts and 
   contains premade features for the framework. Call these
   functions with "EZUI.<function>" from your scripts after
   importing them with "using {EZUI}"
#>

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

#imports
using { /UnrealEngine.com/Temporary/UI }
using { /Fortnite.com/UI }
using { /Verse.org/Colors }
using { /Fortnite.com/Playspaces }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Verse.org/Assets }


EZUI<public> := module:

    # Toolkit ---------------------------------------------------------------------------------------

    # converts string to message
    TextToMsg<public><localizes> (t : string) : message = "{t}" 

    # comverts int to message
    IntToMsg<public><localizes>(i : int) : message = "{i}"

    # defines a custom typing for opacity which requires constraints
    opacity_range<public> := type{_X:float where 0.000000 <= _X, _X <= 1.000000}

    # defines a custom typing for anchors which requires constraints
    anchor_range<public> := type{_X:float where 0.000000 <= _X, _X <= 1.000000}

    <#
        EZUI.IsAPlayer
        used to determine if a TriggerEvent is from a player, or to check if the 
        input is a player, to allow for a UI to bereferenced
    #>
    IsAPlayer<public>(MaybeAgent : ?agent, VerseDevice : creative_device) : logic =

        if(not MaybeAgent?):
            Print("EZUI: Not an Agent")
            return false

        if(MaybePlayer := MaybeAgent?):
            for (k -> v : VerseDevice.GetPlayspace().GetPlayers()):
                if (v = player[MaybePlayer]):
                    Print("EZUI: Is a Player")
                    return true
        
        Print("EZUI: Not a Player")
        return false
        





    # VFX library ---------------------------------------------------------------------------------

    <#
        EZUI.FlickerVF
        Used to create a flickering effect on UI elements for a defined
        duration and then ending with one of four ways:
            1 - visible
            2 = invisible
            3 = invisible and collapsed
            4 = removed
    
    #>
    FlickerVFX <public> (ThisWidget : widget, Duration : float, VFXEnd : int, LinkedPlayer : player)<suspends> : void =
        var Countdown : float = (Duration * 10)
        
        loop:
                ThisWidget.SetVisibility(widget_visibility.Hidden)
                Sleep(0.05)
                ThisWidget.SetVisibility(widget_visibility.Visible)
                Sleep(0.05)
                set Countdown = Countdown - 1.0
        
                if(Countdown = 0.0):

                    if (VFXEnd = 1):
                        ThisWidget.SetVisibility(widget_visibility.Visible)
                        
                    if (VFXEnd = 2):
                        ThisWidget.SetVisibility(widget_visibility.Hidden)
                    
                    if (VFXEnd = 3):
                        ThisWidget.SetVisibility(widget_visibility.Collapsed) 

                    if (VFXEnd = 4):
                        if (PlayerUI := GetPlayerUI[LinkedPlayer]):
                            PlayerUI.RemoveWidget(ThisWidget)           
                       
                    break

<#
    a special thamks to: 
        Mayapple
        SprinterMax
        Daigorō
        UEFN Discord community

    ****************************************************************************************
    Made with EZUI, please follow @kryyative on Instagram Threads and @KryyssX on X (Twitter)
    for more useful Snippets, UEFN & UE5 news,tutorials and community spotlights!
    ****************************************************************************************

    If you found EZUI useful please include the text above in your credits to show your support
    for my work and encourage others to use EZUI for their projects. Thank you! ^_^
#>
Sign in to download module

Copy-paste each file above is always free.

Comments

    Sign in to vote, comment, or suggest an edit. Sign in
    📄
    Source
    @float
    Epic Games Community
    @float

    Created by a member of the Epic Games community. Rights remain with the original author, under Epic's community content terms. Terms ↗

    View original Sources & licensing
    Request removal
    Last updated Jun 23, 2026
    Verse module (2 files)
    Build failed · 6 errors

    Download the full module (zip) from the code panel above.

    Keep exploring
    Related topics
    • Fortnite Ezui Customizable Options Screen Ui
    • Fortnite Ezui Customisable Fadein Out Screen Fx Ui
    • Fortnite Fully Customizable Ui Button Verse Device Devices
    • Fortnite Ezui Popup With Custom Art Fnc Graphics Support Per Player Ui Ui
    • Fortnite Custom Afk Device Devices

    Related

    Open in graph →

    Related topics

    • Fortnite Ezui Customizable Options Screen
    • Fortnite Ezui Customisable Fadein Out Screen Fx
    • Fortnite Fully Customizable Ui Button Verse Device
    • Fortnite Ezui Popup With Custom Art Fnc Graphics Support Per Player Ui
    • Fortnite Custom Afk Device
    VerseIsland · an archipelago of Verse & UEFN knowledge
    🗺️ Island atlas Learn Guides History About & Press Sources & Licensing Status

    Not affiliated with Epic Games. Fortnite, UEFN, Unreal Engine, and Verse are trademarks of Epic Games, Inc. Content is attributed to its source — see Sources & Licensing.

    🦜

    Scout · your island guide

    The Isle of Verse