[UE4][slua] PrintString打印函数使用方法

蓝图中使用的【打印字符串】功能如下图,如何在lua脚本中使用呢?

C++代码:

void UKismetSystemLibrary::PrintString(const UObject* WorldContextObject, const FString& InString, bool bPrintToScreen, bool bPrintToLog, FLinearColor TextColor, float Duration)

lua代码:

-- By Ning+ 2021.12.24
-- 导入模块,这个模块中包含PrintString函数
local KismetSystemLibrary = import('KismetSystemLibrary')
-- 这里需要输入6个入参,比蓝图中多一个self:GetWorld() 相当于 const UObject* WorldContextObject
KismetSystemLibrary.PrintString(self:GetWorld(),"Hello Ning+",true,true,FLinearColor(0.0, 0.66, 1.0, 1.0),2.0)

猜你喜欢

转载自blog.csdn.net/o0pk2008/article/details/122119486
今日推荐