Code/SbTween/Examples/SbeScreenTween.cs

A small example component that animates a ScreenPanel. On start it tweens the panel's opacity to 0 over 1 second and its size to 1.4 over 1 second, both set to loop indefinitely with a YoYo loop.

Native Interop
using Sandbox;
using SbTween;

namespace SbTween.Examples;

public sealed class SbeScreenTween : Component
{
	[Property] public ScreenPanel SP;

	protected override void OnStart()
	{
		SP.TweenOpacity(0,1).SetLoops( -1, LoopType.YoYo ).Play();
		SP.TweenSize(1.4f, 1).SetLoops( -1, LoopType.YoYo ).Play();
	}
}