本文整理汇总了C++中FVector2D::InitFromString方法的典型用法代码示例。如果您正苦于以下问题:C++ FVector2D::InitFromString方法的具体用法?C++ FVector2D::InitFromString怎么用?C++ FVector2D::InitFromString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FVector2D
的用法示例。
在下文中一共展示了FVector2D::InitFromString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTypeSpecificLayoutString
TSharedRef<SWidget> FLevelViewportLayout2x2::MakeViewportLayout(const FString& LayoutString)
{
FString SpecificLayoutString = GetTypeSpecificLayoutString(LayoutString);
TSharedPtr< SLevelViewport > ViewportWidgetTL;
TSharedPtr< SLevelViewport > ViewportWidgetTR;
TSharedPtr< SLevelViewport > ViewportWidgetBL;
TSharedPtr< SLevelViewport > ViewportWidgetBR;
FString TopLeftKey, BottomLeftKey, TopRightKey, BottomRightKey;
TArray<FVector2D> SplitterPercentages;
if (!SpecificLayoutString.IsEmpty())
{
// The Layout String only holds the unique ID of the Additional Layout Configs to use
const FString& IniSection = FLayoutSaveRestore::GetAdditionalLayoutConfigIni();
TopLeftKey = SpecificLayoutString + TEXT(".Viewport0");
BottomLeftKey = SpecificLayoutString + TEXT(".Viewport1");
TopRightKey = SpecificLayoutString + TEXT(".Viewport2");
BottomRightKey = SpecificLayoutString + TEXT(".Viewport3");
for (int32 i = 0; i < 4; ++i)
{
FString PercentageString;
FVector2D NewPercentage = ViewportLayout2x2Defs::DefaultSplitterPercentages;
if(GConfig->GetString(*IniSection, *(SpecificLayoutString + FString::Printf(TEXT(".Percentages%i"), i)), PercentageString, GEditorUserSettingsIni))
{
NewPercentage.InitFromString(PercentageString);
}
SplitterPercentages.Add(NewPercentage);
}
}
SplitterWidget =
SNew( SSplitter2x2 )
.TopLeft()
[
SAssignNew( ViewportWidgetTL, SLevelViewport )
.ViewportType( LVT_OrthoYZ ) // Side
.ParentLayout( AsShared() )
.ParentLevelEditor( ParentLevelEditor )
.ConfigKey( TopLeftKey )
]
.BottomLeft()
[
SAssignNew( ViewportWidgetBL, SLevelViewport )
.ViewportType( LVT_Perspective ) // Persp
.Realtime( true )
.ParentLayout( AsShared() )
.ParentLevelEditor( ParentLevelEditor )
.ConfigKey( BottomLeftKey )
]
.TopRight()
[
SAssignNew( ViewportWidgetTR, SLevelViewport )
.ViewportType( LVT_OrthoXZ ) // Front
.ParentLayout( AsShared() )
.ParentLevelEditor( ParentLevelEditor )
.ConfigKey( TopRightKey )
]
.BottomRight()
[
SAssignNew( ViewportWidgetBR, SLevelViewport )
.ViewportType( LVT_OrthoXY ) // Top
.ParentLayout( AsShared() )
.ParentLevelEditor( ParentLevelEditor )
.ConfigKey( BottomRightKey )
];
Viewports.Add( ViewportWidgetTL );
Viewports.Add( ViewportWidgetBL );
Viewports.Add( ViewportWidgetTR );
Viewports.Add( ViewportWidgetBR );
// Make newly-created perspective viewports active by default
GCurrentLevelEditingViewportClient = &ViewportWidgetBL->GetLevelViewportClient();
if (SplitterPercentages.Num() > 0)
{
SplitterWidget->SetSplitterPercentages(SplitterPercentages);
}
InitCommonLayoutFromString(SpecificLayoutString);
return SplitterWidget.ToSharedRef();
}