当前位置:网站首页>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();
}
}边栏推荐
- Bluetooth gap protocol
- PCI Pharma Services Announces Multi-Million Dollar Expansion of UK Manufacturing Facility to Meet Growing Demand for Global High Potency Drug Manufacturing Services to Support Oncology Treatment
- Technical Analysis Mode (7) Playing the Gap
- 线程池的创建及参数设置详解
- typescript67-索引查询类型
- mysql使用in函数的一个小问题
- 2022.7.29好题选讲(计数专题)
- TRACE32——Go.direct
- 【instancetype类型 Objective-C】
- re正则表达式
猜你喜欢

Database table insert data

Task flow scheduling tool AirFlow,, 220804,,

Flink Learning 10: Use idea to write WordCount and package and run

DNSlog外带数据注入

二叉搜索树问题

性能提升400倍丨外汇掉期估值计算优化案例

2022 crane driver (limited bridge crane) exam question bank and simulation test

Week 8 Document Clustering

TRACE32——Break

Modeling of the MAYA ship
随机推荐
Week 8 Document Clustering(文本聚类)
数据库多表关联插入数据
RNote108---Display the running progress of the R program
17-VMware Horizon 2203 虚拟桌面-Win10 手动桌面池浮动(十七)
UDP group (multi)cast
693. 行程排序
Redis进阶
17-VMware Horizon 2203 virtual desktop-Win10 manual desktop pool floating (seventeen)
Day9 of Hegong Daqiong team vision team training - camera calibration
MySQL: join query | inner join, outer join
UDP组(多)播
typescript68-索引查询类型(查询多个)
原来使Maya Arnold也能渲染出高质量作品!超赞小技巧
【网友真实投稿】为女友放弃国企舒适圈,转行软件测试12k*13薪
IO process thread -> communication between processes -> day7
TCP sticky packet unpacking problem + solution
Does Libpq support read-write separation configuration?
Shiny02---Shiny exception solution
【动态类型检测 Objective-C】
After the firewall iptable rule is enabled, the system network becomes slow