大佬们 如何做到点击UI按钮 UI和鼠标都隐藏
ue4吧
全部回复
仅看楼主
level 1
iksing🌊 楼主
我是这样做的 但是错了 问题出在哪里[泪] 刚入坑 蓝图不太会 勿喷
2020年08月27日 09点08分 1
level 7
ui里面直接用remove from parent就能删除ui了
2020年08月27日 13点08分 2
但是鼠标还在。。
2020年08月29日 02点08分
@iksing🌊 隐藏鼠标你不是有个set show mouse cursor嘛
2020年08月29日 09点08分
@iksing🌊 如果是不想让鼠标点一下再消失的话,可以在show mouse cursor前面加个set input mode game only
2020年11月27日 05点11分
level 1
先在编辑器里创建UI和一个按钮 按钮名称和代码一致并且把为变量的勾选取消
.h
protected:
virtual void NativeConstruct()override;
public:
UPROPERTY()
class UButton*BTN_0
UFUNCTION()
void HIdeCursorAndUI();
.cpp
void 类名::NativeConstruct(){
BTN_0->Onclicked.AddDynamic(this,&类名::HIdeCursorAndUI)
}
void 类名::HIdeCursorAndUI(){
GetWorld()->GetFirstPlayerController()->bShowMouseCursor=false;
RemoveFormParent();
}
2022年01月21日 10点01分 3
1