Font.drawZoomedText
From Spheriki
Draw scaled text using the font.
Contents |
[edit]
Usage
font.drawZoomedText(x, y, scale, text);
- font Sphere Font object. The font to draw the text with.
- x number. X coordinate of the top-left corner of the zoomed text.
- y number. Y coordinate of the top-left corner of the zoomed text.
- scale number. The scaling factor. 1.0 = normal size, 0.5 = half size, 2.0 = double size and so on.
- text string. The text to draw scaled.
[edit]
Examples
This will grab some attention.
var font = GetSystemFont(); font.drawZoomedText(0, 0, 4, "HELLO WORLD!"); FlipScreen(); GetKey();
[edit]
Notes
- The text is drawn with (x, y) as the top-left corner. To have zooming centered, use Font.getHeight(), Font.getStringHeight() and Font.getStringWidth(), and use those dimensions to calculate your desired coordinates for centering.
[edit]
See also
- Sphere Font object
- FlipScreen()
- GetKey()
- GetSystemFont()

