mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-14 17:29:23 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
39 lines
979 B
C#
39 lines
979 B
C#
|
|
namespace Sandbox.UI;
|
|
|
|
/// <summary>
|
|
/// Describes panel's position and size for rendering operations.
|
|
/// </summary>
|
|
public readonly struct RenderState
|
|
{
|
|
/// <summary>
|
|
/// Position of the panel on the X axis. This can be a negative value!
|
|
/// </summary>
|
|
public float X { readonly get; init; }
|
|
|
|
/// <summary>
|
|
/// Position of the panel on the Y axis. This can be a negative value!
|
|
/// </summary>
|
|
public float Y { readonly get; init; }
|
|
|
|
/// <summary>
|
|
/// Width of the panel.
|
|
/// </summary>
|
|
public float Width { readonly get; init; }
|
|
|
|
/// <summary>
|
|
/// Height of the panel.
|
|
/// </summary>
|
|
public float Height { readonly get; init; }
|
|
|
|
/// <summary>
|
|
/// Render Opacity Overrides
|
|
/// </summary>
|
|
internal float RenderOpacity { readonly get; init; }
|
|
|
|
/// <summary>
|
|
/// Allows easy cast to a <see cref="Rect"/> for usage in rendering functions.
|
|
/// </summary>
|
|
public static implicit operator Rect( RenderState rs ) => new( rs.X, rs.Y, rs.Width, rs.Height );
|
|
}
|