From Spherical
Jump to: navigation, search

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


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.


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


//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


  • 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