Home

Awesome

UI Tweening Libary for UE4/UMG

Create simple tweens for UMG widgets from C++.

UBUITween::Create( SomeWidget, 0.2f )
	.FromTranslation( FVector2D( -100, 0 ) )
	.FromOpacity( 0.2f )
	.ToTranslation( FVector2D( 20, 10 ) )
	.ToOpacity( 1.0f )
	.Begin();

Usage

The plugin module registers itself to tick automatically even during game-world pause.

// Make UWidget MyWidget fade in from the left
const float TweenDuration = 0.7f;
const float StartDelay = 0.3f;
UBUITween::Create( MyWidget, TweenDuration, StartDelay )
	.FromTranslation( FVector2D( -100, 0 ) )
	.FromOpacity( 0.2f )
	.ToReset()
	.Easing( EBUIEasingType::OutCubic )
	.Begin();

Parameters available:

PropertyFromTo
TranslationFromTranslation( FVector2D)ToTranslation( FVector2D )
ScaleFromScale( FVector2D )ToScale( FVector2D )
RotationFromRotation( float )ToRotation( float )
OpacityFromOpacity( float )ToOpacity( float )
ColorFromColor( FLinearColor )ToColor( FLinearColor )
VisibilityFromVisibility( ESlateVisibility )ToVisibility( ESlateVisibility )
Canvas PositionFromCanvasPosition( FVector2D )ToCanvasPosition( FVector2D )
SizeBox Max HeightFromMaxDesiredHeight( float )ToMaxDesiredHeight( float )
Slot PaddingFromPadding( FMargin )ToPadding( FMargin )

Other helper functions:

Callbacks

UBUITween::Create( MyWidget, 0.5f )
	.FromRotation( -90 )
	.ToRotation( 45 )
	.OnComplete( FBUITweenSignature::CreateLambda([]( UWidget* Owner ) {
		// Do some logic on complete
	} ) )
	.Begin();

For the full API, check the source code.

Caveats

License

CC0

Contact

If you find it useful, drop me a line @_benui on Twitter

benui.ca