Label::Label: Difference between revisions
MrPancakers (talk | contribs) (Updated with an example, added Label definitions and added some descriptions on parameters) |
|||
| Line 35: | Line 35: | ||
}); | }); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Labels also supports multiple lines of text, this can be achieved using "\n". | |||
== See Also == | == See Also == | ||
{{Label_definition}} | {{Label_definition}} | ||
Revision as of 18:16, 7 July 2018
Creates a label in your world.
Syntax
Shared
mp.labels.new(text, position,
{
los: los,
font: font,
drawDistance: drawDistance,
color: color,
dimension: dimension
});
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"
mp.labels.new("Welcome to Los Santos", new mp.Vector3(-431.88, 1146.86, 327),
{
los: true,
font: 1,
drawDistance: 100,
});
Labels also supports multiple lines of text, this can be achieved using "\n".