unreal slate 创建 window

	testWindow = SNew(SWindow)
.Title(LOCTEXT("Asset Window", "Asset Window"))
.ClientSize(FVector2D(30, 20))
.SupportsMaximize(false)
.SupportsMinimize(false)
.SizingRule(ESizingRule::Autosized)
.AutoCenter(EAutoCenter::None)
.IsInitiallyMaximized(false)
.bDragAnywhere(true)
[
textBlock.ToSharedRef()
]; TSharedPtr<SWindow> TopWindow = FSlateApplication::Get().GetActiveTopLevelWindow();
if (TopWindow.IsValid())
{
//Add as Native
FSlateApplication::Get().AddWindowAsNativeChild(testWindow.ToSharedRef(), TopWindow.ToSharedRef(), true);
}
else
{ //Default in case no top window
FSlateApplication::Get().AddWindow(testWindow.ToSharedRef());
} GEngine->GameViewport->AddViewportWidgetContent(SNew(SWeakWidget).PossiblyNullContent(testWindow.ToSharedRef()));

  代码片段。备用。

上一篇:jquery/js实现一个网页同时调用多个倒计时(最新的)


下一篇:sql语句查询月份的数据