using Sandbox.UI; namespace Sandbox; public partial class Bitmap { /// /// Draws text onto this bitmap /// 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 ); } }