Files
sbox-public/engine/Sandbox.Engine/Resources/Textures/Bitmap/Bitmap.Text.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

16 lines
378 B
C#

using Sandbox.UI;
namespace Sandbox;
public partial class Bitmap
{
/// <summary>
/// Draws text onto this bitmap
/// </summary>
public void DrawText( TextRendering.Scope scope, Rect rect, TextFlag flags = TextFlag.Center )
{
using var block = new TextRendering.TextBlock( scope, new Vector2( 0, 0 ), flags, FontSmooth.Always );
block.Render( _canvas, rect );
}
}