Struct PluginWorldLabel
- Namespace
- AcDream.Plugin.Abstractions
- Assembly
- AcDream.Plugin.Abstractions.dll
One line of text hung in the world over an object, drawn at a constant screen size wherever the object goes.
public readonly record struct PluginWorldLabel : IEquatable<PluginWorldLabel>
- Implements
- Inherited Members
Constructors
PluginWorldLabel(uint, string, Vector4, float, int, float, bool)
One line of text hung in the world over an object, drawn at a constant screen size wherever the object goes.
public PluginWorldLabel(uint ObjectId, string Text, Vector4 Color, float HeightOffset = 0, int Line = 0, float MaxRange = 60, bool Outline = true)
Parameters
ObjectIduintThe object the label follows, by the id the server gave it. A label with a zero id is dropped.
TextstringWhat the label says. A label with no text, or with more than MaximumTextLength characters, is dropped. Text is drawn on one line as given; it is not wrapped.
ColorVector4The text colour, red, green, blue and alpha each from 0 to 1. A label whose colour has a component that is not a finite number is dropped.
HeightOffsetfloatMetres added to the host's own measure of the object's height, so a label can sit a little above the head, or below it with a negative value. The host works the object's height out itself; a plugin never has to.
LineintWhich line this is over the object, counting up from zero at the object's head. Two labels on one object with lines 0 and 1 stack, the second above the first, without either plugin knowing the font's size.
MaxRangefloatHow far from the camera, in metres, the label is still drawn. It fades out over the last fifth of that distance. Must be a positive finite number, or the label is dropped.
OutlineboolTrue to draw the text with a dark outline so it stays readable over a bright sky or a light wall.
Properties
Color
The text colour, red, green, blue and alpha each from 0 to 1. A label whose colour has a component that is not a finite number is dropped.
public Vector4 Color { get; init; }
Property Value
HeightOffset
Metres added to the host's own measure of the object's height, so a label can sit a little above the head, or below it with a negative value. The host works the object's height out itself; a plugin never has to.
public float HeightOffset { get; init; }
Property Value
Line
Which line this is over the object, counting up from zero at the object's head. Two labels on one object with lines 0 and 1 stack, the second above the first, without either plugin knowing the font's size.
public int Line { get; init; }
Property Value
MaxRange
How far from the camera, in metres, the label is still drawn. It fades out over the last fifth of that distance. Must be a positive finite number, or the label is dropped.
public float MaxRange { get; init; }
Property Value
ObjectId
The object the label follows, by the id the server gave it. A label with a zero id is dropped.
public uint ObjectId { get; init; }
Property Value
Outline
True to draw the text with a dark outline so it stays readable over a bright sky or a light wall.
public bool Outline { get; init; }
Property Value
Text
What the label says. A label with no text, or with more than MaximumTextLength characters, is dropped. Text is drawn on one line as given; it is not wrapped.
public string Text { get; init; }