Gosu::Font
A Font can be used to draw text on a Window object very flexibly.
Fonts are ideal for small texts that change regularly.
For large, static texts you should use Gosu::Image#from_text.
Constructors
Load a font from the system fonts or a file.
height: the height of the font, in pixels.
name: the name of a system font, or a path to a TrueType Font (TTF) file. A path must contain at least one '/' or '.' character to distinguish it from a system font.
Instance methods
Overrides the image for a character.
NOTE: For any given character, this method MUST NOT be called more than once, and MUST NOT be called if a string containing the character has already been drawn.
Like #draw_text, but supports the following markup tags: bold, italic, and <c=rrggbb>colors</c>.
Like #draw_text_rel, but supports the following markup tags: bold, italic, and <c=rrggbb>colors</c>.
Draws a single line of text with its top left corner at (x, y).
SEE: #draw_text_rel
SEE: Gosu::Image.from_text
NOTE: https://github.com/gosu/gosu/wiki/Basic-Concepts#drawing-with-colours Drawing with colors, explained in the Gosu Wiki
NOTE: https://github.com/gosu/gosu/wiki/Basic-Concepts#z-ordering Z-ordering explained in the Gosu Wiki
Draws a single line of text relative to (x, y).
The text is aligned to the drawing location according to the rel_x and rel_y parameters: a value of 0.0 corresponds to top and left, while 1.0 corresponds to bottom and right. A value of 0.5 naturally corresponds to the center of the text.
All real numbers are valid alignment values and will be interpolated (or extrapolated) accordingly.
SEE: #draw_text
NOTE: https://github.com/gosu/gosu/wiki/Basic-Concepts#drawing-with-colours Drawing with colors, explained in the Gosu Wiki
NOTE: https://github.com/gosu/gosu/wiki/Basic-Concepts#z-ordering Z-ordering explained in the Gosu Wiki