Legacy:Font/drawZoomedText

From Spherical
< Legacy:Font
Revision as of 21:43, 24 June 2013 by Apollolux (talk | contribs) (added navbox)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Draw (write) a line of text on the screen using the specified font, zoomed in at the specified scale factor.

Usage

Font.drawText(x, y, size, text);


  • x Integer. The x position on the screen where the text starts drawing.
  • y Integer. The y position of the text on the screen.
  • size Number. Scale the font by size times. 1 is normal size.
  • text String. The text to display.

Examples

var font = GetSystemFont();
font.drawZoomedText(10, 10, 1.5, "This text is zoomed in.");

FlipScreen();
GetKey();

//Load the font to use
//Draw it, at one and a half its normal size

//Now display it on the screen
//Now wait for user interaction

Notes

  • Using \n for new lines doesn't work with this function. drawText() is meant purely for drawing single line of text.
  • The line width is infinite, so you can easily go past the screen width if your line is too long.
  • If you're going to use 1 as a scale, you might as well use regular Font.drawText(). Unless you're calculating the size (like in graphical animation effects).

See also

API:Font/navbox