I want to move widgets around in the VerticalBox in-game, but it doesn’t offer that functionality that I know of, so I created my own class base on it. I tried programming the functionality, but it doesn’t seem to work:
I seem to have it working now. Not sure if this could have been done easier with something already existing, but here’s the code if someone has a need for it.
VerticalDynamic.h
#pragma once
#include "Runtime/UMG/Public/UMG.h"
#include "Runtime/UMG/Public/UMGStyle.h"
#include "Components/PanelWidget.h"
#include "Runtime/UMG/Public/Components/VerticalBox.h"
#include "VerticalDynamic.generated.h"
class UVerticalDynamicSlot;
UCLASS()
class I_AM_HUMAN_API UVerticalDynamic : public UVerticalBox
{
GENERATED_UCLASS_BODY()
public:
/*Switch places of widgets*/
UFUNCTION(BlueprintCallable, Category = "Panel")
void SwitchWidgets(UWidget* Content1, UWidget* Content2);
};
If you are creating new functionality for the editor / projects, you can submit this code as a Pull Request (https://github.com/EpicGames/UnrealEngine/compare?expand=1) where it will be reviewed by developers and could be added into the engine.
I have never really used GitHub beyond downloading codebases. If I upload it should I include it as a change to VerticalBox or as the new class VerticalDynamic?