Does anyone else find Verse UI really slow?

Hello everyone!

Its good to see I’m not the only one who is having this issue and I’ve come up with a solution. I should warn everyone that I have not extensively tested this yet and I could be missing something.

The solution:

If you add your UI to the player canvas at the start of the game, you can set its visibility to collapsed. This actually makes opening the UI instantaneous. When adding the UI to the screen however, you need to ensure you have the InputMode set to none. You do not want to consume input on this UI!

if (InPlayerUI:= GetPlayerUI[InPlayer])
{
    InPlayerUI.AddWidget(ShopItemStack, 
     player_ui_slot{InputMode:=ui_input_mode.None, ZOrder:=1});

    Print("AddUI");
}

This does create a problem however. What if you want to have interactive UI? I’ve figured that out too.

Create a dummy canvas of some kind that will be added to the screen when you want to use your UI. This dummy will be empty and will consume input. When adding this to the screen however, you will want to set its visibility to hidden. If you forget to do this, your UI will not be interactable and will have an invisible canvas over top.

ShowUI():void=
{
    if (InPlayerUI:= GetPlayerUI[OwningPlayer?])
    {
        InPlayerUI.AddWidget(DummyWidget, 
         player_ui_slot{InputMode:=ui_input_mode.All, ZOrder:=0})

        DummyWidget.SetVisibility(widget_visibility.Hidden);
        ShopItemStack.SetVisibility(widget_visibility.Visible);
    }
}

Note: I don’t believe ZOrder has any impact on this and is just there as a artefact of my testing.

1 Like