71 lines
2.6 KiB
C#
71 lines
2.6 KiB
C#
namespace Syntriax.Engine.Core;
|
|
|
|
/// <summary>
|
|
/// Represents the transformation properties of an object such as position, scale, and rotation in 2D space.
|
|
/// </summary>
|
|
public interface ITransform2D : IBehaviour
|
|
{
|
|
/// <summary>
|
|
/// Event triggered when the <see cref="Position"/> of the <see cref="ITransform2D"/> changes.
|
|
/// </summary>
|
|
Event<ITransform2D, PositionChangedArguments> OnPositionChanged { get; }
|
|
|
|
/// <summary>
|
|
/// Event triggered when the <see cref="Scale"/> of the <see cref="ITransform2D"/> changes.
|
|
/// </summary>
|
|
Event<ITransform2D, ScaleChangedArguments> OnScaleChanged { get; }
|
|
|
|
/// <summary>
|
|
/// Event triggered when the <see cref="Rotation"/> of the <see cref="ITransform"/> changes.
|
|
/// </summary>
|
|
Event<ITransform2D, RotationChangedArguments> OnRotationChanged { get; }
|
|
|
|
/// <summary>
|
|
/// The world position of the <see cref="ITransform2D"/> in 2D space.
|
|
/// </summary>
|
|
Vector2D Position { get; set; }
|
|
|
|
/// <summary>
|
|
/// The world scale of the <see cref="ITransform2D"/>.
|
|
/// </summary>
|
|
Vector2D Scale { get; set; }
|
|
|
|
/// <summary>
|
|
/// The world rotation of the <see cref="ITransform2D"/> in degrees.
|
|
/// </summary>
|
|
float Rotation { get; set; }
|
|
|
|
/// <summary>
|
|
/// The local position of the <see cref="ITransform2D"/> in 2D space.
|
|
/// </summary>
|
|
Vector2D LocalPosition { get; set; }
|
|
|
|
/// <summary>
|
|
/// The local scale of the <see cref="ITransform2D"/>.
|
|
/// </summary>
|
|
Vector2D LocalScale { get; set; }
|
|
|
|
/// <summary>
|
|
/// The local rotation of the <see cref="ITransform2D"/> in degrees.
|
|
/// </summary>
|
|
float LocalRotation { get; set; }
|
|
|
|
/// <summary>
|
|
/// Arguments for the event triggered when the <see cref="ITransform2D"/>'s rotation changes.
|
|
/// </summary>
|
|
/// <param name="PreviousPosition">The previous <see cref="Position"/> of the <see cref="ITransform2D"/>.</param>
|
|
readonly record struct PositionChangedArguments(Vector2D PreviousPosition);
|
|
|
|
/// <summary>
|
|
/// Arguments for the event triggered when the <see cref="ITransform2D"/>'s rotation changes.
|
|
/// </summary>
|
|
/// <param name="PreviousScale">The previous <see cref="Scale"/> of the <see cref="ITransform2D"/>.</param>
|
|
readonly record struct ScaleChangedArguments(Vector2D PreviousScale);
|
|
|
|
/// <summary>
|
|
/// Arguments for the event triggered when the <see cref="ITransform2D"/>'s rotation changes.
|
|
/// </summary>
|
|
/// <param name="PreviousRotation">The previous <see cref="Rotation"/> of the <see cref="ITransform2D"/>.</param>
|
|
readonly record struct RotationChangedArguments(float PreviousRotation);
|
|
}
|