- Documentation
- Client functions
- setNametagStyle
Function
setNametagStyle
Sets the look of the built-in nametags above other players' heads for the local player. Fields as in setPlayerNametagStyle: enabled, distance, showDistance, scale, color, background; pass only the ones to change.
Syntax
bool setNametagStyle(table style)Arguments
styletable- The fields to change.
Returns
true on success; false for a bad field.
Example
setNametagStyle({
distance = 30,
color = tocolor(255, 255, 255, 255),
background = false,
})
See also
getNametagStyleReturns the current look of the built-in nametags for the local player (a table with fields as insetNametagStyle).setNametagsEnabledTurns the built-in nametags above other players' heads on or off for the local player. A shortcut forsetNametagStyle({ enabled = ... }); useful when a resource draws its own nametags.setPlayerNametagStyleSets the look of the built-in nametags above other players' heads as seen by this player (or everyone:root). Pass only the fields to change; the rest stay. Fields:enabled(bool,falsehides the built-in nametags, e.g. when a resource draws its own withdxDrawText),distance(metres, 0 = no limit),showDistance(bool, the "12 m" suffix after the nickname),scale(0.4–4, text size),color(a colour fromtocolororfalse= default colour),background(a background colour fromtocolororfalse= no background). A single player's colour, text and hiding (setPlayerNametagColor,setPlayerNametagText,setPlayerNametagShowing) take precedence over the style. After reconnecting set the style again.