GraphicsAPI reference
Interface IFont
Namespace: MicroEngine.Graphics
Assembly: MicroEngine.Text.dll
Guide: Graphics
Anything that measures and draws text at one size: the built-in BitmapFont (at scale 1) and a ScalableFont at a size (At). UI widgets and layout code take an IFont, so the same code serves pixel-art and HD text.
public interface IFontExtension Methods
FontExtensions.DrawCentered(IFont, IRenderer, string, Vector2, Color), FontExtensions.DrawShadowed(IFont, IRenderer, string, Vector2, Color, Color, Vector2?), FontExtensions.MeasureWidth(IFont, string), FontExtensions.Wrap(IFont, string, float)
Properties
LineHeight
Distance between the tops of two lines, in canvas pixels.
float LineHeight { get; }Property Value
Methods
Draw(IRenderer, string, Vector2, Color)
Draws text with its top-left at position, in color.
void Draw(IRenderer renderer, string text, Vector2 position, Color color)Parameters
renderer IRenderer
text string
position Vector2
color Color
Measure(string)
Size of text in canvas pixels: the widest line by the height of its lines. ā\nā starts a new line.
Vector2 Measure(string text)Parameters
text string