当前位置:网站首页>08_ UE4 advanced_ Start end pause menu UI
08_ UE4 advanced_ Start end pause menu UI
2022-07-26 20:55:00 【Ruthless reading machine】
Attach numbers to the progress bar , To display the value
Drag a text block and put it in the corresponding position , And change the anchor

Create a binding for text ( I have created this , And renamed )

Binding function content

compile , effect

Similarly, the current hp value

Similarly, display mp value

One of them needs to be repaired bug, That is, we should always check whether the blood volume is reduced to a negative value .
stay damage Incident , modify ,recent-damage>0,true Is to assign the result to recent,false Will be recent Directly set to 0.

New demand : When the character's blood becomes 0, We want the game to pause or end .
So use 0 Set up hprecent when , We want to pause the game .

This pause effect is too rigid .
We need to let players lose control first , Freeze the screen in a few seconds .
When hp by 0, The speed and speed of the character are established 0,0.2s after , Game pause ( In the later stage, the animation of falling to the ground will be added )

Increase demand : Add one after the game pauses ui, Show gameover
establish ui Control blueprint

Pull in a border, Adjust the position and anchor
Set up border The background of


Put a text , Write gameover, Adjust the font size

Put in a button

Drag a text into the button , Content is to exit the game
Create functions for buttons
Add button click event



Start after the game pauses ui

Although there is this ui, But we didn't get control of the mouse . Now take control .
Test success .
Now realize the game pause ui

Continue to add events with game keys

After clicking , Eliminate all ui Control , Then show hp and mp Of ui, And then continue to play , Game control changes from mouse to game character .

Press p key , Generate pause game ui, And get the control of the mouse

Test success .
------------------------------------------------------------------------------------------------------------------------------
The start menu of the game
programme 1: Open the game , Show the start game menu , Then click start game to enter the game .
shortcoming : When we click exe, You need to load the whole main map immediately , The bigger the map , The slower the loading speed . If the map is big , The screen will be black for a long time , To see our start menu .
programme 2: First load a small level , Then click start game , Enter the main level .
First, create a new game level .

Rename it to start_menu, This is a completely blank map .

Create start menu ui The blueprint

The click event of the start game button is

Double click in start_menu checkpoint , Then open the level blueprint , Editing .

When the level starts , Start menu generation .

Run this level , Find out hpbar Of ui It's already running
This is because there is nothing at this level , But by default, little white people are loaded .
The little white man's game start event was created hpbar.

therefore , We will create hpbar Put the code of into the blueprint of the main level .

Test success .
边栏推荐
- 如何查看你使用的pytorch是否为GPU版本
- How to check whether the pytorch you are using is a GPU version
- Establishment of APP automation testing framework (VIII) -- establishment of ATX server2 multi device cluster environment
- 09_ue4进阶_进入下一关并保留血量
- 如何组装一个注册中心?
- 20220726
- QT signal and slot connection (loose coupling)
- 7.25 simulation summary
- Build Prometheus automatic monitoring and alarm system from scratch
- Auto. JS rotation Icon
猜你喜欢
随机推荐
A super simple neural network code with 5 coordinates for one layer node training
Numpy中ndarray的常见操作
884. 两句话中的不常见单词-哈希表
如何查看你使用的pytorch是否为GPU版本
Transaction rollback and record exception information at the same time
How to upload and download files
BGP的路由黑洞和防环
Installation and configuration of [basic services] [database] Clickhouse
LeetCode_ Backtracking_ Medium_ 216. Combined sum III
QT基础第一天 (1)QT,GUI(图形用户接口)开发
连接池快速入门
营销与销售文件管理以及工作流程解决方案
创建一个自身类的静态对象变量,究竟会如何执行?
Can the training software test be employed
传惠普/戴尔/微软/亚马逊考虑将部分硬件生产线转到大陆以外
Build Prometheus automatic monitoring and alarm system from scratch
It is said that HP / Dell / Microsoft / Amazon are considering transferring some hardware production lines outside the mainland
让华为吃了败诉的CNEX Labs到底有何来头?
LeetCode链表问题——19.删除链表的倒数第N个节点(一题一文学会链表)
[wechat applet] zero basics | applet syntax









