当前位置: 首页>>代码示例>>C++>>正文


C++ FVector2D::InitFromString方法代码示例

本文整理汇总了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();
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:89,代码来源:LevelViewportLayout2x2.cpp


注:本文中的FVector2D::InitFromString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。