Graphics::drawText: Difference between revisions

From RAGE Multiplayer Wiki
Line 28: Line 28:


==Fonts==
==Fonts==
[[File:Fonts.jpg]]
 
<span style="font-size:130%; line-height: 1.31em;">'''ChaletLondon - ID: 0'''</span>
<gallery>
Image:120px-chalet-london-nineteen-seventy-upper.png
Image:120px-chalet-london-nineteen-seventy-lower.png
Image:120px-chalet-london-nineteen-seventy-character.png
</gallery><br>
 
----
 
<span style="font-size:130%; line-height: 1.31em;">'''HouseScript - ID: 1'''</span>
<gallery>
Image:120px-sign-painter-house-script-upper.png
Image:120px-sign-painter-house-script-lower.png
Image:120px-sign-painter-house-script-character.png
</gallery><br>
 
----
 
<span style="font-size:130%; line-height: 1.31em;">'''Monospace - ID: 2'''</span>
<gallery>
Image:120px-Excalibur_Monospace-upper.png
Image:120px-Excalibur_Monospace-lower.png
Image:120px-Excalibur_Monospace-character.png
</gallery><br>
 
----
 
<span style="font-size:130%; line-height: 1.31em;">'''CharletComprimeColonge - ID: 4'''</span>
<gallery>
Image:120px-chalet-comprime-cologne-seventy-upper.png
Image:120px-chalet-comprime-cologne-seventy-lower.png
Image:120px-chalet-comprime-cologne-seventy-character.png
</gallery><br>
 
----
 
<span style="font-size:130%; line-height: 1.31em;">'''Pricedown - ID: 7'''</span>
<gallery>
Image:120px-Pricedown-upper.png
Image:120px-Pricedown-lower.png
Image:120px-Pricedown-character.png
</gallery>


==See also==
==See also==
{{Graphics_s_function_c}}
{{Graphics_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]

Revision as of 11:57, 30 November 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: Include Z parameter when rendering to a 3D space (change X and Y to world co-ordinates)

Return value

Unknown

Example

Client-Side
mp.events.add('render', () => {
    // Draw to screen.
    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);

    // Draw to world.
    mp.game.graphics.drawText("Text in the world", 7, [255, 255, 255, 185], 1.2, 1.2, true, -1234, 1337, 15);
});

Fonts

ChaletLondon - ID: 0



HouseScript - ID: 1



Monospace - ID: 2



CharletComprimeColonge - ID: 4



Pricedown - ID: 7

See also