本文整理汇总了C++中FGeometry::ToInflatedPaintGeometry方法的典型用法代码示例。如果您正苦于以下问题:C++ FGeometry::ToInflatedPaintGeometry方法的具体用法?C++ FGeometry::ToInflatedPaintGeometry怎么用?C++ FGeometry::ToInflatedPaintGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FGeometry
的用法示例。
在下文中一共展示了FGeometry::ToInflatedPaintGeometry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPaint
int32 SProgressBar::OnPaint( const FGeometry& AllottedGeometry, const FSlateRect& MyClippingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled ) const
{
// Used to track the layer ID we will return.
int32 RetLayerId = LayerId;
bool bEnabled = ShouldBeEnabled( bParentEnabled );
const ESlateDrawEffect::Type DrawEffects = bEnabled ? ESlateDrawEffect::None : ESlateDrawEffect::DisabledEffect;
const FColor FillColorAndOpacitySRGB( InWidgetStyle.GetColorAndOpacityTint() * FillColorAndOpacity.Get().GetColor(InWidgetStyle) * FillImage->GetTint( InWidgetStyle ) );
const FColor ColorAndOpacitySRGB = InWidgetStyle.GetColorAndOpacityTint();
TOptional<float> ProgressFraction = Percent.Get();
// Paint inside the border only.
FPaintGeometry ForegroundPaintGeometry = AllottedGeometry.ToInflatedPaintGeometry( -BorderPadding.Get() );
const FSlateRect ForegroundClippingRect = ForegroundPaintGeometry.ToSlateRect().IntersectionWith( MyClippingRect );
FSlateDrawElement::MakeBox(
OutDrawElements,
RetLayerId++,
AllottedGeometry.ToPaintGeometry(),
BackgroundImage,
MyClippingRect,
DrawEffects,
InWidgetStyle.GetColorAndOpacityTint() * BackgroundImage->GetTint( InWidgetStyle )
);
if( ProgressFraction.IsSet() )
{
const float ClampedFraction = FMath::Clamp( ProgressFraction.GetValue(), 0.0f, 1.0f );
// Draw Fill
FSlateDrawElement::MakeBox(
OutDrawElements,
RetLayerId++,
AllottedGeometry.ToPaintGeometry(
FVector2D::ZeroVector,
FVector2D( AllottedGeometry.Size.X * ( ClampedFraction ) , AllottedGeometry.Size.Y )),
FillImage,
ForegroundClippingRect,
DrawEffects,
FillColorAndOpacitySRGB
);
}
else
{
// Draw Marquee
const float MarqueeAnimOffset = MarqueeImage->ImageSize.X * CurveSequence.GetLerpLooping();
const float MarqueeImageSize = MarqueeImage->ImageSize.X;
FSlateDrawElement::MakeBox(
OutDrawElements,
RetLayerId++,
AllottedGeometry.ToPaintGeometry(
FVector2D( MarqueeAnimOffset - MarqueeImageSize, 0.0f ),
FVector2D( AllottedGeometry.Size.X + MarqueeImageSize, AllottedGeometry.Size.Y )),
MarqueeImage,
ForegroundClippingRect,
DrawEffects,
ColorAndOpacitySRGB
);
}
return RetLayerId - 1;
}