本文整理汇总了C++中FWidgetStyle::BlendColorAndOpacityTint方法的典型用法代码示例。如果您正苦于以下问题:C++ FWidgetStyle::BlendColorAndOpacityTint方法的具体用法?C++ FWidgetStyle::BlendColorAndOpacityTint怎么用?C++ FWidgetStyle::BlendColorAndOpacityTint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FWidgetStyle
的用法示例。
在下文中一共展示了FWidgetStyle::BlendColorAndOpacityTint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPaint
int32 SGraphPanel::OnPaint( const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyClippingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled ) const
{
#if SLATE_HD_STATS
SCOPE_CYCLE_COUNTER( STAT_SlateOnPaint_SGraphPanel );
#endif
CachedAllottedGeometryScaledSize = AllottedGeometry.Size * AllottedGeometry.Scale;
//Style used for objects that are the same between revisions
FWidgetStyle FadedStyle = InWidgetStyle;
FadedStyle.BlendColorAndOpacityTint(FLinearColor(0.45f,0.45f,0.45f,0.45f));
// First paint the background
const UEditorExperimentalSettings& Options = *GetDefault<UEditorExperimentalSettings>();
const FSlateBrush* BackgroundImage = FEditorStyle::GetBrush(TEXT("Graph.Panel.SolidBackground"));
PaintBackgroundAsLines(BackgroundImage, AllottedGeometry, MyClippingRect, OutDrawElements, LayerId);
const float ZoomFactor = AllottedGeometry.Scale * GetZoomAmount();
FArrangedChildren ArrangedChildren(EVisibility::Visible);
ArrangeChildNodes(AllottedGeometry, ArrangedChildren);
// Determine some 'global' settings based on current LOD
const bool bDrawShadowsThisFrame = GetCurrentLOD() > EGraphRenderingLOD::LowestDetail;
// Because we paint multiple children, we must track the maximum layer id that they produced in case one of our parents
// wants to an overlay for all of its contents.
// Save LayerId for comment boxes to ensure they always appear below nodes & wires
const int32 CommentNodeShadowLayerId = LayerId++;
const int32 CommentNodeLayerId = LayerId++;
// Save a LayerId for wires, which appear below nodes but above comments
// We will draw them later, along with the arrows which appear above nodes.
const int32 WireLayerId = LayerId++;
const int32 NodeShadowsLayerId = LayerId;
const int32 NodeLayerId = NodeShadowsLayerId + 1;
int32 MaxLayerId = NodeLayerId;
const FVector2D NodeShadowSize = GetDefault<UGraphEditorSettings>()->GetShadowDeltaSize();
const UEdGraphSchema* Schema = GraphObj->GetSchema();
// Draw the child nodes
{
// When drawing a marquee, need a preview of what the selection will be.
const FGraphPanelSelectionSet* SelectionToVisualize = &(SelectionManager.SelectedNodes);
FGraphPanelSelectionSet SelectionPreview;
if ( Marquee.IsValid() )
{
ApplyMarqueeSelection(Marquee, SelectionManager.SelectedNodes, SelectionPreview);
SelectionToVisualize = &SelectionPreview;
}
// Context for rendering node infos
FKismetNodeInfoContext Context(GraphObj);
TArray<FGraphDiffControl::FNodeMatch> NodeMatches;
for (int32 ChildIndex = 0; ChildIndex < ArrangedChildren.Num(); ++ChildIndex)
{
FArrangedWidget& CurWidget = ArrangedChildren[ChildIndex];
TSharedRef<SGraphNode> ChildNode = StaticCastSharedRef<SGraphNode>(CurWidget.Widget);
// Examine node to see what layers we should be drawing in
int32 ShadowLayerId = NodeShadowsLayerId;
int32 ChildLayerId = NodeLayerId;
// If a comment node, draw in the dedicated comment slots
{
UObject* NodeObj = ChildNode->GetObjectBeingDisplayed();
if (NodeObj && NodeObj->IsA(UEdGraphNode_Comment::StaticClass()))
{
ShadowLayerId = CommentNodeShadowLayerId;
ChildLayerId = CommentNodeLayerId;
}
}
const bool bNodeIsVisible = FSlateRect::DoRectanglesIntersect( CurWidget.Geometry.GetClippingRect(), MyClippingRect );
if (bNodeIsVisible)
{
const bool bSelected = SelectionToVisualize->Contains( StaticCastSharedRef<SNodePanel::SNode>(CurWidget.Widget)->GetObjectBeingDisplayed() );
// Handle Node renaming once the node is visible
if( bSelected && ChildNode->IsRenamePending() )
{
ChildNode->ApplyRename();
}
// Draw the node's shadow.
if (bDrawShadowsThisFrame || bSelected)
{
const FSlateBrush* ShadowBrush = ChildNode->GetShadowBrush(bSelected);
FSlateDrawElement::MakeBox(
OutDrawElements,
ShadowLayerId,
CurWidget.Geometry.ToInflatedPaintGeometry(NodeShadowSize),
ShadowBrush,
//.........这里部分代码省略.........