96 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			96 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
namespace 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="ITransform2D"/> changes.
 | 
						|
    /// </summary>
 | 
						|
    Event<ITransform2D, RotationChangedArguments> OnRotationChanged { get; }
 | 
						|
 | 
						|
    /// <summary>
 | 
						|
    /// Event triggered when any of the properties of the <see cref="ITransform2D"/> gets updated.
 | 
						|
    /// </summary>
 | 
						|
    Event<ITransform2D> OnTransformUpdated { get; }
 | 
						|
 | 
						|
    /// <summary>
 | 
						|
    /// The <see cref="Vector2D"/> pointing upwards in world space.
 | 
						|
    /// </summary>
 | 
						|
    Vector2D Up { get; }
 | 
						|
 | 
						|
    /// <summary>
 | 
						|
    /// The <see cref="Vector2D"/> pointing upwards in world space.
 | 
						|
    /// </summary>
 | 
						|
    Vector2D Down { get; }
 | 
						|
 | 
						|
    /// <summary>
 | 
						|
    /// The <see cref="Vector2D"/> pointing upwards in world space.
 | 
						|
    /// </summary>
 | 
						|
    Vector2D Left { get; }
 | 
						|
 | 
						|
    /// <summary>
 | 
						|
    /// The <see cref="Vector2D"/> pointing upwards in world space.
 | 
						|
    /// </summary>
 | 
						|
    Vector2D Right { 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);
 | 
						|
}
 |