当前位置:网站首页>U++ 创建UI
U++ 创建UI
2022-08-05 06:50:00 【是秃头的兔子呀】
.h:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/HUD.h"
#include "MyHUD.generated.h"
/**
*
*/
UCLASS()
class FLOATINGCUBE_API AMyHUD : public AHUD
{
GENERATED_BODY()
public:
virtual void BeginPlay() override;
AMyHUD();
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TSubclassOf<UUserWidget> userWidget;
UPROPERTY()
UUserWidget* refWidget;
};
.cpp:
// Fill out your copyright notice in the Description page of Project Settings.
#include "MyHUD.h"
#include "Blueprint/UserWidget.h"
AMyHUD::AMyHUD() {
}
void AMyHUD::BeginPlay() {
refWidget = CreateWidget<UUserWidget>(GetWorld(), userWidget);
if (refWidget != nullptr) {
refWidget->AddToViewport();
}
}边栏推荐
- "Automatic Data Collection Based on R Language"--Chapter 3 XML and JSON
- It turns out that Maya Arnold can also render high-quality works!Awesome Tips
- 环网冗余式CAN/光纤转换器 CAN总线转光纤转换器中继集线器hub光端机
- [Tool Configuration] Summary of Common Uses of VSCode
- 不太会讲爱,其实已经偷偷幸福很久啦----我们的故事
- Flink学习12:DataStreaming API
- UDP组(多)播
- After working for 3 years, I recalled the comparison between the past and the present when I first started, and joked about my testing career
- GAN生成动漫头像Pytorch
- typescript59-泛型工具类型(partial )
猜你喜欢
随机推荐
Flink Learning 12: DataStreaming API
691. 立方体IV
A small problem with mysql using the in function
【工具配置篇】VSCode 常用使用总结
Shiny04---Application of DT and progress bar in shiny
【Go】IM系统Centrifugo
MySQL: JDBC programming
The NDK compiler so libraries
UDP broadcast
typescript68-索引查询类型(查询多个)
TRACE32——SMP多核调试
1、Citrix XenDesktop 2203之AD域系统安装(一)
Re regular expressions
Rapid Medical超小体积且唯一可调的取栓器获得FDA核准
UDP group (multi)cast
任务流调度工具AirFlow,,220804,,
今天虚竹哥又发现了一款好用的国产化API工具
Japan Sanitary Equipment Industry Association: Japan's warm water shower toilet seat shipments reached 100 million sets
400 times performance improvement 丨 swap valuation optimization case calculation
基于快速行进平方法的水面无人船路径规划









