Allowed for the text to set a text origin.

This commit is contained in:
Michel Fedde 2021-05-02 14:48:29 +02:00
parent 51f8dfd522
commit 17e76a9dd4
6 changed files with 56 additions and 38 deletions

View file

@ -23,6 +23,14 @@ namespace SM2D.Drawing
Transform.Size = new CVector2(1);
}
public void SetHeight(float desiredHeight)
{
if (!Font.WasCompiled) Font.Compile();
float factor = desiredHeight / Font.Height;
Transform.Size.Set(factor);
}
/// <inheritdoc />
protected override void DrawContext(ref DrawContext context)
{