本文整理汇总了C++中UTexture2D::GetFName方法的典型用法代码示例。如果您正苦于以下问题:C++ UTexture2D::GetFName方法的具体用法?C++ UTexture2D::GetFName怎么用?C++ UTexture2D::GetFName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UTexture2D
的用法示例。
在下文中一共展示了UTexture2D::GetFName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BroadcastStatusCallback
//.........这里部分代码省略.........
Status.StatusType == FLiveStreamingStatus::EStatusType::WebCamStarted ||
Status.StatusType == FLiveStreamingStatus::EStatusType::ChatConnected )
{
State = SNotificationItem::CS_Success;
}
Notification->SetCompletionState( State );
}
// If the web cam just turned on, then we'll go ahead and show it
if( Status.StatusType == FLiveStreamingStatus::EStatusType::WebCamTextureReady )
{
bool bIsImageFlippedHorizontally = false;
bool bIsImageFlippedVertically = false;
UTexture2D* WebCamTexture = LiveStreamer->GetWebCamTexture( bIsImageFlippedHorizontally, bIsImageFlippedVertically );
if( ensure( WebCamTexture != nullptr ) )
{
IMainFrameModule& MainFrameModule = FModuleManager::LoadModuleChecked<IMainFrameModule>( TEXT( "MainFrame" ) );
check( MainFrameModule.IsWindowInitialized() );
auto RootWindow = MainFrameModule.GetParentWindow();
check( RootWindow.IsValid() );
// Allow the user to customize the image mirroring, too!
const auto& Settings = *GetDefault< UEditorLiveStreamingSettings >();
if( Settings.bMirrorWebCamImage )
{
bIsImageFlippedHorizontally = !bIsImageFlippedHorizontally;
}
// How many pixels from the edge of the main frame window to where the broadcast status window appears
const int WindowBorderPadding = 50;
// @todo livestream: Currently this window is not created as "topmost". We don't really want it to be OS-topmost, but we do want it to be the most
// topmost "regular" window in our application (not on top of tooltips, etc.)
// Create a window that will show the web cam video feed
BroadcastStatusWindow = SNew( SWindow )
.Title( LOCTEXT( "StreamingWindowTitle", "Web Camera" ) )
.ClientSize( FVector2D( WebCamTexture->GetSizeX(), WebCamTexture->GetSizeY() ) )
.ScreenPosition( FVector2D(
RootWindow->GetRectInScreen().Right - WebCamTexture->GetSizeX() - WindowBorderPadding,
RootWindow->GetRectInScreen().Top + WindowBorderPadding ) )
// @todo livestream: Ideally the user could freely resize the window, but it gets a bit tricky to preserve the web cam aspect. Plus, we don't really like how letterboxing/columnboxing looks with this.
.SizingRule( ESizingRule::FixedSize )
.AutoCenter( EAutoCenter::None )
.bDragAnywhere( true )
.SupportsMaximize( true )
.SupportsMinimize( true )
.FocusWhenFirstShown( false )
.ActivateWhenFirstShown( false )
.SaneWindowPlacement( false );
WebCamDynamicImageBrush = MakeShareable( new FSlateDynamicImageBrush(
WebCamTexture,
FVector2D( WebCamTexture->GetSizeX(), WebCamTexture->GetSizeY() ),
WebCamTexture->GetFName() ) );
// If the web cam image is coming in flipped, we'll apply mirroring to the Slate brush
if( bIsImageFlippedHorizontally && bIsImageFlippedVertically )
{
WebCamDynamicImageBrush->Mirroring = ESlateBrushMirrorType::Both;
}
else if( bIsImageFlippedHorizontally )
{
WebCamDynamicImageBrush->Mirroring = ESlateBrushMirrorType::Horizontal;
}
else if( bIsImageFlippedVertically )
{
WebCamDynamicImageBrush->Mirroring = ESlateBrushMirrorType::Vertical;
}
// @todo livestream: Currently if the user closes the window, the camera is deactivated and it doesn't turn back on unless the broadcast is restarted. We could allow the camera to be reactivated though.
BroadcastStatusWindow->SetOnWindowClosed(
FOnWindowClosed::CreateStatic( []( const TSharedRef<SWindow>& Window, FEditorLiveStreaming* This )
{
// User closed the broadcast status window, so go ahead and shut down the web cam
This->LiveStreamer->StopWebCam();
This->BroadcastStatusWindow.Reset();
This->WebCamDynamicImageBrush.Reset();
},
this ) );
BroadcastStatusWindow->SetContent(
SNew( SImage )
.Image( WebCamDynamicImageBrush.Get() )
);
FSlateApplication::Get().AddWindowAsNativeChild(
BroadcastStatusWindow.ToSharedRef(),
RootWindow.ToSharedRef() );
}
}
else if( Status.StatusType == FLiveStreamingStatus::EStatusType::WebCamTextureNotReady )
{
CloseBroadcastStatusWindow();
}
}