Graphics::drawText: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "==Syntax== <syntaxhighlight lang="javascript">mp.game.graphics.drawText(text, fontId, colourRGBA, scaleX, scaleY, outline, x, y[, z]);</syntaxhighlight> === Required Arguments...")
 
mNo edit summary
Line 26: Line 26:
</syntaxhighlight>
</syntaxhighlight>
</div>
</div>
==Fonts==
[https://sun9-4.userapi.com/c840631/v840631125/9d5b/z7BT93WVDrI.jpg Picture]
==See also==
==See also==
{{Graphics_s_function_c}}
{{Graphics_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]

Revision as of 19:39, 24 September 2017

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

Picture

See also