So i’m messing around with drawing rectangles and text to the screen. The rects are pretty straightforward but the text is trickier.
Heres an example of what i’ve got so far:
private void DrawText(/*Text text*/) {
float textx = Screen.Resolution.Width / 2f;
float texty = Screen.Resolution.Height / 2f;
DrawRect(.5f,.5f,.02f,.02f,250,50,50,200);
BeginTextCommandDisplayText("STRING");
AddTextComponentString("text1");
SetTextScale(1f, .5f);
SetTextCentre(true);
EndTextCommandDisplayText(.5f, .5f);
Text text = new Text("text2", new PointF(textx, texty), .5f);
text.Alignment = Alignment.Center;
text.Draw();
}
So the text ends up being off by quite a bit. Is there a simpler way to draw text? Is there a good way to draw text relative to a rect? And what does the text scale relate to? Like if i have a rect with a height of 0.1, what what scale would go with that?
Anyone who has figured this stuff out and want to share, it would be appreciated, thanks!