本文整理汇总了C++中FVector2D::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ FVector2D::Set方法的具体用法?C++ FVector2D::Set怎么用?C++ FVector2D::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FVector2D
的用法示例。
在下文中一共展示了FVector2D::Set方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPaint
int32 SSplitter::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 );
int32 MaxLayerId = PaintArrangedChildren( Args, ArrangedChildren, MyClippingRect, OutDrawElements, LayerId, InWidgetStyle, bParentEnabled );
const FSlateBrush* NormalHandleBrush = &Style->HandleNormalBrush;
// Draw the splitter above any children
MaxLayerId += 1;
for( int32 ChildIndex = 0; ChildIndex < ArrangedChildren.Num(); ++ChildIndex )
{
const FGeometry& GeometryAfterSplitter = ArrangedChildren[ FMath::Clamp(ChildIndex + 1, 0, ArrangedChildren.Num()-1) ].Geometry;
const float HalfHitDetectionSplitterHandleSize = ( HitDetectionSplitterHandleSize / 2 );
const float HalfPhysicalSplitterHandleSize = ( PhysicalSplitterHandleSize / 2 );
FVector2D HandleSize;
FVector2D HandlePosition;
if ( Orientation == Orient_Horizontal )
{
HandleSize.Set( PhysicalSplitterHandleSize, GeometryAfterSplitter.Size.Y );
HandlePosition.Set( -(HalfHitDetectionSplitterHandleSize + HalfPhysicalSplitterHandleSize), 0 );
}
else
{
HandleSize.Set( GeometryAfterSplitter.Size.X, PhysicalSplitterHandleSize );
HandlePosition.Set( 0, -(HalfHitDetectionSplitterHandleSize + HalfPhysicalSplitterHandleSize) );
}
if (HoveredHandleIndex != ChildIndex)
{
FSlateDrawElement::MakeBox(
OutDrawElements,
MaxLayerId,
GeometryAfterSplitter.ToPaintGeometry( HandlePosition, HandleSize, 1.0f ),
NormalHandleBrush,
MyClippingRect,
ShouldBeEnabled( bParentEnabled ),
InWidgetStyle.GetColorAndOpacityTint() * NormalHandleBrush->TintColor.GetSpecifiedColor()
);
}
else
{
FSlateDrawElement::MakeBox(
OutDrawElements,
MaxLayerId,
GeometryAfterSplitter.ToPaintGeometry( HandlePosition, HandleSize, 1.0f ),
&Style->HandleHighlightBrush,
MyClippingRect,
ShouldBeEnabled( bParentEnabled ),
InWidgetStyle.GetColorAndOpacityTint() * Style->HandleHighlightBrush.TintColor.GetSpecifiedColor()
);
}
}
return MaxLayerId;
}