Label::Label: Difference between revisions
m (Mcfloy moved page TextLabel::TextLabel to Label::Label) |
MrPancakers (talk | contribs) (Updated with an example, added Label definitions and added some descriptions on parameters) |
||
| Line 1: | Line 1: | ||
Creates a label in your world. | |||
==Syntax== | ==Syntax== | ||
| Line 15: | Line 15: | ||
===Parameters=== | ===Parameters=== | ||
*'''text''': {{RageType|String}} | *'''<span style="font-weight:bold; color:red;">*</span>text''': {{RageType|String}} | ||
*'''position''': {{RageType|Vector3}} | *'''<span style="font-weight:bold; color:red;">*</span>position''': {{RageType|Vector3}} | ||
*'''los''': {{RageType|Boolean}} | *'''los''': {{RageType|Boolean}} - Line of Sight (Text will hide if blocked by an entity). | ||
*'''font''': {{RageType|Number}} | *'''font''': {{RageType|Number}} ([[Fonts_and_Colors#DrawText_Fonts|Font Types]]) | ||
*'''drawDistance''': {{RageType|Number}} | *'''drawDistance''': {{RageType|Number}} | ||
*'''color''': {{RageType|[Number, Number, Number, Number]}} | *'''color''': {{RageType|[Number, Number, Number, Number]}} | ||
*'''dimension''': {{RageType|dimension}} | *'''dimension''': {{RageType|dimension}} | ||
<span style="font-weight:bold; color:red;">*</span> = 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> | |||
== See Also == | |||
{{Label_definition}} | |||
Revision as of 07:19, 31 May 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,
});