Skip to content

知识点记录

  • Adding the Widget to the Viewport
    cpp
      GEngine->GameViewport->AddViewportWidgetContent(
    		SNew(MyWidgetPtr.ToSharedRef())
    	);
  • 创建
    cpp
    GEngine->GameViewport->AddViewportWidgetContent(
    	SNew(SWeakWidget)
    	.PossiblyNullContent(MyWidgetClass)
    );
  • 创建并赋值
    cpp
    GEngine->GameViewport->AddViewportWidgetContent(
    		SAssignNew(MyWidgetPtr, SWeakWidget)
    		.PossiblyNullContent(MyWidgetClass)
    	);

参考 References