本文整理汇总了C++中FSlateWindowElementList::QueueDeferredPainting方法的典型用法代码示例。如果您正苦于以下问题:C++ FSlateWindowElementList::QueueDeferredPainting方法的具体用法?C++ FSlateWindowElementList::QueueDeferredPainting怎么用?C++ FSlateWindowElementList::QueueDeferredPainting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FSlateWindowElementList
的用法示例。
在下文中一共展示了FSlateWindowElementList::QueueDeferredPainting方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPaint
int32 SMenuAnchor::OnPaint( const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyClippingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled ) const
{
FArrangedChildren ArrangedChildren( EVisibility::Visible );
ArrangeChildren( AllottedGeometry, ArrangedChildren );
// There may be zero elements in this array if our child collapsed/hidden
if ( ArrangedChildren.Num() > 0 )
{
const FArrangedWidget& FirstChild = ArrangedChildren[0];
// In the case where the user doesn't provide content to the menu anchor, the null widget
// wont appear in the visible set of arranged children, so only immediately paint the first child,
// if it's visible and matches the first slot content.
const bool bHasArrangedAnchorContent = FirstChild.Widget == Children[0].GetWidget();
if ( bHasArrangedAnchorContent )
{
const FSlateRect ChildClippingRect = AllottedGeometry.GetClippingRect().IntersectionWith(MyClippingRect);
LayerId = FirstChild.Widget->Paint(Args.WithNewParent(this), FirstChild.Geometry, ChildClippingRect, OutDrawElements, LayerId + 1, InWidgetStyle, ShouldBeEnabled(bParentEnabled));
}
const bool bIsOpen = IsOpen();
if ( bIsOpen )
{
// In the case where the anchor content is present and visible, it's the 1 index child, in the case
// where the anchor content is invisible, it's the 0 index child.
FArrangedWidget* PopupChild = nullptr;
if ( bHasArrangedAnchorContent && ArrangedChildren.Num() > 1 )
{
PopupChild = &ArrangedChildren[1];
}
else if ( !bHasArrangedAnchorContent && ArrangedChildren.Num() == 1 )
{
PopupChild = &ArrangedChildren[0];
}
if ( PopupChild != nullptr )
{
OutDrawElements.QueueDeferredPainting(
FSlateWindowElementList::FDeferredPaint(PopupChild->Widget, Args, PopupChild->Geometry, MyClippingRect, InWidgetStyle, bParentEnabled));
}
}
}
return LayerId;
}
示例2: OnPaint
int32 SPopup::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyClippingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const
{
FArrangedChildren ArrangedChildren(EVisibility::Visible);
this->ArrangeChildren(AllottedGeometry, ArrangedChildren);
// There may be zero elements in this array if our child collapsed/hidden
if (ArrangedChildren.Num() > 0)
{
check(ArrangedChildren.Num() == 1);
FArrangedWidget& TheChild = ArrangedChildren[0];
FWidgetStyle CompoundedWidgetStyle = FWidgetStyle(InWidgetStyle)
.BlendColorAndOpacityTint(ColorAndOpacity.Get())
.SetForegroundColor(GetForegroundColor());
// An SPopup just queues up its children to be painted after everything in this window is done painting.
OutDrawElements.QueueDeferredPainting(
FSlateWindowElementList::FDeferredPaint(TheChild.Widget, Args.WithNewParent(this), TheChild.Geometry, MyClippingRect, CompoundedWidgetStyle, ShouldBeEnabled(bParentEnabled))
);
}
return LayerId;
}