YoYo Games Wiki

draw_text(x,y,string)

From YoYoGames Wiki

Description

This function allows you to draw text directly on the screen in the current color.

Arguments

  • x (real): Horizontal position (in pixels) on screen
  • y (real): Vertical position (in pixels) on screen
  • string (string): The thing you want displayed on screen

Explanation

This function allows you to draw text directly on the screen in the current color (unlike show_message which pops up a message box). The x and y positions needn't be specific, they can be relative to an object, also, the 'string' can be a variable.

Examples

draw_text(obj_player.x-10,obj_player.y-10,score);

Or, in conjunction with view_xview and view_yview to make text that follows you around in Views:

draw_text(view_xview,view_yview,"Sonic Room")

Remarks

Content from GMKB, was used to expand this article. The content was contributed by nickydude.