C++,在UE4中写Hello World!!
来源:互联网 发布:英语口语听力训练软件 编辑:程序博客网 时间:2024/05/17 09:28
IDE : Visual Studio2017
UE版本:4.17.2
首相创建C++项目
在项目浏览器中打开默认的模式,(如果没有去右下角视口选项)
这时候会启动Visual Studio
然后在CPP中写入代码
// Fill out your copyright notice in the Description page of Project Settings.#include "FPSProjectGameModeBase.h"#include "Engine.h"void AFPSProjectGameModeBase::StartPlay(){ Super::StartPlay(); if (GEngine) { // 显示调试信息五秒。 // -1“键”值(首个参数)说明我们无需更新或刷新此消息。 GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT(" Hello World !!!")); }}
然后在.h中写入代码
// Fill out your copyright notice in the Description page of Project Settings.#pragma once#include "CoreMinimal.h"#include "GameFramework/GameModeBase.h"#include "FPSProjectGameModeBase.generated.h"/** * */UCLASS()class FPSPROJECT_API AFPSProjectGameModeBase : public AGameModeBase{ GENERATED_BODY() virtual void StartPlay() override;};
右键生成一下
回到编辑器,把游戏模式修改成我们刚写的
然后启动项目
总结:
其实就是一段输出代码就好
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT(" Hello World !!!"));
然后要包含头文件include
阅读全文
0 0
- C++,在UE4中写Hello World!!
- 在iPod touch上写"hello world"
- 写一个hello world驱动 不能在超时函数中打印 包括makefile
- asm 写hello world
- CMAKE 写hello world
- 汇编语言 写 Hello World
- c++写hello world
- Eclispe写Hello world
- 在窗口中输出hello world
- 在docker容器中运行hello world!
- 在ROS中运行Hello world!
- UE4 Hello World 创建第一个UE4工程
- 6个变态的C语言写的Hello World
- 6个变态的C语言写的Hello World
- 6个变态的C语言写的Hello World
- 6个变态的C语言写的Hello World
- 6个变态的C语言写的Hello World
- 6个变态的C语言写的Hello World
- 如何在Java的Filter中注入Service???
- MapReduce工作原理图文详解
- 第一次作业
- no2 神经网络
- weblogic服务器部署的程序,如何直接通过IP访问(即URL中去掉工程名)
- C++,在UE4中写Hello World!!
- SQL 语句的多表查询方式
- printf()中的数据类型%h后为什么要加上d才能表示短整型
- Django小结
- React-native 问题集锦
- luogu p2066 机器分配
- angularJs得MVC简单理解
- 处理服务器参数中有数组参数(AFN框架)
- centos7安装mongodb并添加服务启动