Next: Particles, Previous: Lines and Shapes, Up: Graphics [Contents][Index]
Printing text to the screen is quite easy:
(draw-text "Hello, world" (vec2 100.0 100.0))
Chickadee loads and renders bitmap fonts in the Angel Code format. A default font named “Good Neighbors” is built-in to Chickadee and is used for all text rendering operations where a font is not specified, as is the case in the above example.
The following procedures can be found in the (chickadee render
font)
module:
Load the Angel Code font (in either XML or FNT format) in file and return a new font object.
Return #t
if obj is a font object.
Return the name of font.
Return the line height of font.
Return the line height of font.
Return #t
if font is a bold font.
Return #t
if font is an italicized font.
[#:font] [#:origin] [#:scale] [#:rotation] [#:blend-mode]
[#:start 0] [#:end (string-length text)
]
Draw the string text with the first character starting at position using font. If font is not specified, a built-in font is used.
(draw-text "Hello, world!" (vec2 128.0 128.0))
To render a substring of text, use the start and end arguments.
Refer to draw-sprite
(see Sprites) for information about
the other arguments.