You're breathtaking!

This commit is contained in:
Wojtek Figat
2020-12-07 23:40:54 +01:00
commit 6fb9eee74c
5143 changed files with 1153594 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
namespace FlaxEngine.GUI
{
/// <summary>
/// Implementation of <see cref="IBrush"/> for <see cref="FlaxEngine.Texture"/>.
/// </summary>
/// <seealso cref="IBrush" />
public sealed class TextureBrush : IBrush
{
/// <summary>
/// The texture.
/// </summary>
[ExpandGroups, Tooltip("The texture asset.")]
public Texture Texture;
/// <summary>
/// Initializes a new instance of the <see cref="TextureBrush"/> class.
/// </summary>
public TextureBrush()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="TextureBrush"/> struct.
/// </summary>
/// <param name="texture">The texture.</param>
public TextureBrush(Texture texture)
{
Texture = texture;
}
/// <inheritdoc />
public Vector2 Size => Texture?.Size ?? Vector2.Zero;
/// <inheritdoc />
public void Draw(Rectangle rect, Color color)
{
Render2D.DrawTexture(Texture, rect, color);
}
}
}