Перейти к содержанию

Label::Label

Материал из RAGE MP Wiki Archive

Creates a label in your world.

Syntax

Shared

<syntaxhighlight lang="javascript"> mp.labels.new(text, position, {

   los: los,
   font: font,
   drawDistance: drawDistance,
   color: color,
   dimension: dimension

}); </syntaxhighlight>

Parameters

  • *text: String
  • *position: Vector3
  • los: Boolean - Line of Sight (Text will hide if blocked by an entity).
  • font: Number (Font Types)
  • drawDistance: Number
  • color: [Number, Number, Number, Number]
  • dimension: dimension

* = Required

Example

Creates a label with the text "Welcome to Los Santos" <syntaxhighlight lang="javascript"> mp.labels.new("Welcome to Los Santos", new mp.Vector3(-431.88, 1146.86, 327),

   {
       los: true,
       font: 1,
       drawDistance: 100,
   });

</syntaxhighlight>

Labels also supports multiple lines of text, this can be achieved using "\n".

See Also