RenderableLabel
Inherits Renderable
Renders a single text label in 3D space. The label is rendered as a billboard, that is, it is always oriented to face the camera.
The label can be rendered with a fade-in effect based on the distance from the camera.
Members
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
This determines the blending mode that is applied to the renderable. |
|
In list { Normal, Additive } |
Yes |
|
The label text color. |
|
Value of type ‘Color3’ |
Yes |
|
Decides if the object should be dimmed (i.e. faded out) when the camera is in the sunny part of an atmosphere. |
|
Value of type ‘Boolean’ |
Yes |
|
Determines whether this object will be visible or not. |
|
Value of type ‘Boolean’ |
Yes |
|
Enable/Disable the Fade-in effect. |
|
Value of type ‘Boolean’ |
Yes |
|
The distance range in which the labels should be fully opaque, specified in the chosen unit. The distance from the position of the label to the camera. |
|
Greater or equal to: {0,0} |
Yes |
|
Distance unit for fade-in/-out distance calculations. Defaults to “au”. |
|
In list { m, Km, Mm, Gm, Tm, Pm, au, pc, Kpc, Mpc, Gpc, Gly } |
Yes |
|
The distances over which the fading takes place, given in the specified unit. The first value is the distance before the closest distance and the second the one after the furthest distance. For example, with the unit Parsec (pc), a value of {1, 2} will make the label being fully faded out 1 Parsec before the closest distance and 2 Parsec away from the furthest distance. |
|
Greater or equal to: {0,0} |
Yes |
|
The font size (in points) for the label. |
|
Greater than: 0 |
Yes |
|
The minimum and maximum size (in pixels) of the label. |
|
Value of type ‘Vector2 |
Yes |
|
This value determines the opacity of this renderable. A value of 0 means completely transparent. |
|
In range: ( 0, 1) |
Yes |
|
Label orientation rendering mode. |
|
In list { Camera View Direction, Camera Position Normal } |
Yes |
|
A value that specifies if the renderable should be rendered in the Background, Opaque, Pre-/PostDeferredTransparency, Overlay, or Sticker rendering step. |
|
In list { Background, Opaque, PreDeferredTransparent, Overlay, PostDeferredTransparent, Sticker } |
Yes |
|
Scales the size of the label, exponentially. The value is used as the exponent in a 10^x computation to scale the label size. |
|
Greater or equal to: 0 |
Yes |
|
A single tag or a list of tags that this renderable will respond to when setting properties. |
|
Value of type ‘Table’, or Value of type ‘String’ |
Yes |
|
The text that will be displayed on screen. |
|
Value of type ‘String’ |
Yes |
|
Transformation matrix to be applied to the label. |
|
Value of type ‘Matrix4x4 |
Yes |
|
The type of the renderable. |
|
Value of type ‘String’ |
Yes |
Inherited members from Renderable
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
Decides if the object should be dimmed (i.e. faded out) when the camera is in the sunny part of an atmosphere. |
|
Value of type ‘Boolean’ |
Yes |
|
Determines whether this object will be visible or not. |
|
Value of type ‘Boolean’ |
Yes |
|
This value determines the opacity of this renderable. A value of 0 means completely transparent. |
|
In range: ( 0, 1) |
Yes |
|
A value that specifies if the renderable should be rendered in the Background, Opaque, Pre-/PostDeferredTransparency, Overlay, or Sticker rendering step. |
|
In list { Background, Opaque, PreDeferredTransparent, Overlay, PostDeferredTransparent, Sticker } |
Yes |
|
A single tag or a list of tags that this renderable will respond to when setting properties. |
|
Value of type ‘Table’, or Value of type ‘String’ |
Yes |
|
The type of the renderable. |
|
Value of type ‘String’ |
Yes |
Asset Examples
1local transforms = asset.require("./transforms")
2
3
4
5local CeresLabel = {
6 Identifier = "CeresLabel",
7 Parent = transforms.CeresPosition.Identifier,
8 Renderable = {
9 Type = "RenderableLabel",
10 Enabled = asset.enabled,
11 Text = "Ceres",
12 FontSize = 70.0,
13 Size = 8.66,
14 MinMaxSize = { 1, 100 },
15 BlendMode = "Additive",
16 OrientationOption = "Camera View Direction"
17 },
18 Tag = { "solarsystem_labels" },
19 GUI = {
20 Name = "Ceres Label",
21 Path = "/Solar System/Dwarf Planets/Ceres",
22 Focusable = false,
23 Description = "Label for Ceres, visible at the solarsystem overview zoom level"
24 }
25}
26
27
28asset.onInitialize(function()
29 openspace.addSceneGraphNode(CeresLabel)
30end)
31
32asset.onDeinitialize(function()
33 openspace.removeSceneGraphNode(CeresLabel)
34end)
35
36asset.export(CeresLabel)
37
38
39
40asset.meta = {
41 Name = "Ceres Label",
42 Description = "Label for Ceres",
43 Author = "OpenSpace Team",
44 URL = "https://openspaceproject.com",
45 License = "MIT license"
46}