当前位置:网站首页>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();
}
}边栏推荐
- 给网站套上Cloudflare(以腾讯云为例)
- typescript60-泛型工具类型(readonly)
- Using printf function in STM32
- TRACE32——SMP多核调试
- Database table insert data
- Technical Analysis Mode (7) Playing the Gap
- Redis
- In the anaconda Promat interface, import torch is passed, and the error is reported in the jupyter notebook (only provide ideas and understanding!)
- Mysql主从延迟的原因和解决方案
- typescript63-索引签名类型
猜你喜欢

Shiny02---Shiny exception solution

typescript68-索引查询类型(查询多个)

环网冗余式CAN/光纤转换器 CAN总线转光纤转换器中继集线器hub光端机

给网站套上Cloudflare(以腾讯云为例)

Falsely bamboo brother today and found a localization of API to use tools

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

Put Cloudflare on the website (take Tencent Cloud as an example)

Using printf function in STM32

2022 Fusion Welding and Thermal Cutting Operation Certificate Exam Questions and Mock Exams

IO进程线程->进程间的通信->day7
随机推荐
Japan Sanitary Equipment Industry Association: Japan's warm water shower toilet seat shipments reached 100 million sets
线程池的创建及参数设置详解
DNSlog外带数据注入
TRACE32——Go.direct
工作3年,回想刚入门和现在的今昔对比,笑谈一下自己的测试生涯
3555. 二叉树
RK3568 environment installation
Week 8 Document Clustering(文本聚类)
[instancetype type Objective-C]
TRACE32——外设寄存器查看与修改
binary search tree problem
MAYA大炮建模
Promise (3) async/await
Task flow scheduling tool AirFlow,, 220804,,
【LeetCode】235.二叉搜索树的最近公共祖先
17-VMware Horizon 2203 虚拟桌面-Win10 手动桌面池浮动(十七)
LaTeX Notes
2022 crane driver (limited bridge crane) exam question bank and simulation test
RNote108---显示R程序的运行进度
A small problem with mysql using the in function