Fonts

Of course in any game you want to be able to write text to the display. Agate provides a painless way of loading fonts:

  1. FontSurface font = new FontSurface("Arial", 12);

The above line of code creates a font object using 12-point Arial.

Drawing text to the screen is simple, using the DrawText function

  1. font.DrawText(10, 20, "This is my text");

FontSurfaces also have the same Alpha, Color, ScaleWidth, and ScaleHeight properties that Surfaces and Sprites have.