当前位置:网站首页>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();
}
}
边栏推荐
- 数据库多表关联插入数据
- 在anaconda Promat界面import torch通过,在jupyter notebook中报错的问题(仅提供思路理解!)
- Hong Kong International Jewellery Show and Hong Kong International Diamond, Gem and Pearl Show kick off
- Falsely bamboo brother today and found a localization of API to use tools
- Vulnhub靶机:HA_ NARAK
- typescript67-索引查询类型
- Advanced Redis
- Hash 这些知识你也应该知道
- Mysql master-slave delay reasons and solutions
- 文本特征化方法总结
猜你喜欢
今天虚竹哥又发现了一款好用的国产化API工具
Falsely bamboo brother today and found a localization of API to use tools
binary search tree problem
合工大苍穹战队视觉组培训Day9——相机标定
typescript63-索引签名类型
Flink Learning 11: Flink Program Parallelism
400 times performance improvement 丨 swap valuation optimization case calculation
typescript67-索引查询类型
TRACE32——Break
MAYA船的建模
随机推荐
TCP sticky packet unpacking problem + solution
不能比较或排序 text、ntext 和 image 数据类型
算法拾遗十五补链表相关面试题
Technical Analysis Mode (7) Playing the Gap
Invalid operator for data type.The operator is add and the type is text.
typescript61-泛型工具类型(pick)
[上海]招聘.Net高级软件工程师&BI数据仓库工程师(急)
【网友真实投稿】为女友放弃国企舒适圈,转行软件测试12k*13薪
MySQL:order by排序查询,group by分组查询
MySQL:基础部分
Week 8 Document Clustering
TRACE32——Break
专用机终端安装软件后报IP冲突
Rapid Medical超小体积且唯一可调的取栓器获得FDA核准
线程池的创建及参数设置详解
typescript64-映射类型
RK3568环境安装
TRACE32——List源代码查看
Week 8 Document Clustering(文本聚类)
MySQL: join query | inner join, outer join