Label::font: Difference between revisions

From RAGE Multiplayer Wiki
(Created page)
 
m (Replaced HTML with template)
Line 4: Line 4:


== Syntax ==
== Syntax ==
<pre>
Number label.font
</pre>


<syntaxhighlight lang="javascript">
label.font = fontID;
</syntaxhighlight>
*'''fontID''' - {{RageType|Number}} ([[Fonts_and_Colors#DrawText_Fonts|Font Types]])
*'''fontID''' - {{RageType|Number}} ([[Fonts_and_Colors#DrawText_Fonts|Font Types]])


Line 13: Line 13:
Updates the font of the label through the command /labelfont
Updates the font of the label through the command /labelfont


<div class="header" style="background-color: #408DAE; color: #FFFFFF; border: 2px solid #408DAE;">
{{ServersideCode|
<div style="margin: 10px 10px 10px 10px;"><b>Server-Side</b></div>
<pre>
<syntaxhighlight lang="javascript">
let startLabel = mp.labels.new("Use /labelfont to update the color of this label.", new mp.Vector3(-431.88, 1146.86, 327),
let startLabel = mp.labels.new("Use /labelfont to update the color of this label.", new mp.Vector3(-431.88, 1146.86, 327),
{
{
Line 27: Line 26:
     player.outputChatBox(`You have updated the font of the label to Font ID: ${fontID}`);
     player.outputChatBox(`You have updated the font of the label to Font ID: ${fontID}`);
});
});
</syntaxhighlight>
</pre>
</div>
}}


== See Also ==
== See Also ==
{{Label_definition}}
{{Label_definition}}

Revision as of 12:33, 26 October 2018

Shared

Update the font type of the selected label

Syntax

Number label.font

Examples

Updates the font of the label through the command /labelfont

Server-Side
let startLabel = mp.labels.new("Use /labelfont to update the color of this label.", new mp.Vector3(-431.88, 1146.86, 327),
{
    los: false,
    font: 1,
    drawDistance: 100,
});

mp.events.addCommand("labelfont", (player, _, fontID) => {
    startLabel.font = parseInt(fontID);
    player.outputChatBox(`You have updated the font of the label to Font ID: ${fontID}`);
});

See Also