Graphics::drawText

From RAGE Multiplayer Wiki
Revision as of 19:43, 24 September 2017 by Andrew (talk | contribs) (→‎Fonts)

Syntax

mp.game.graphics.drawText(text, fontId, colourRGBA, scaleX, scaleY, outline, x, y[, z]);

Required Arguments

  • text: String: text to show
  • fontId: Int: font id
  • colourRGBA: Array: Color of the text plus alpha
  • scaleX: Float: X scale of the text (1.0 is a good value)
  • scaleY: Float: Y scale (1.0 is a good value)
  • outline: Bool: Text has borders or not
  • x: Float: X position in the screen (0.0 to 1.0)
  • y: Float: Y position in the screen (0.0 to 1.0)
  • z: Float: unknown (optional)

Return value

Unknown

Example

Client-Side
mp.events.add('render', () => {

    if (player_inWelcomeScreen) {

        mp.game.graphics.drawText("Text at the top of the screen", 7, [255, 255, 255, 185], 1.2, 1.2, true, 0.5, 0.005);
    }
});

Fonts

See also