Add option to use Point sampling when drawing textures and sprites in UI via Brushes
This commit is contained in:
@@ -14,6 +14,12 @@ namespace FlaxEngine.GUI
|
||||
[HideInEditor]
|
||||
public GPUTexture Texture;
|
||||
|
||||
/// <summary>
|
||||
/// The texture sampling filter mode.
|
||||
/// </summary>
|
||||
[ExpandGroups, Tooltip("The texture sampling filter mode.")]
|
||||
public BrushFilter Filter = BrushFilter.Linear;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GPUTextureBrush"/> class.
|
||||
/// </summary>
|
||||
@@ -36,7 +42,10 @@ namespace FlaxEngine.GUI
|
||||
/// <inheritdoc />
|
||||
public void Draw(Rectangle rect, Color color)
|
||||
{
|
||||
Render2D.DrawTexture(Texture, rect, color);
|
||||
if (Filter == BrushFilter.Point)
|
||||
Render2D.DrawTexturePoint(Texture, rect, color);
|
||||
else
|
||||
Render2D.DrawTexture(Texture, rect, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user