DashboardItemPropertyValue
Inherits DashboardItem
This DashboardItem
will show the value of the provided property. Depending on the type of the property, the DisplayString
will have to be adapted. See the documentation for the DisplayString
for more information.
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The String that is being displayed. It must either be empty (in which case only the value itself will be displayed), or it must contain extact one or more instances of {}, which will be replaced with the value(s) of the property during rendering. For scalar types, there has to be exactly one instance of {}, for vector types, there need to be as many {} as there are components in the vector, for example two {} for vec2 types, three for vec3 types, etc. For more information on how to structure the formatting string, see the documentation at https://en.cppreference.com/w/cpp/utility/format/spec. |
|
Value of type ‘String’ |
Yes |
|
This value is the name of the font that is used. It can either refer to an internal name registered previously, or it can refer to a path that is used. |
|
Value of type ‘String’ |
Yes |
|
This value determines the size of the font that is used to render the distance. |
|
Value of type ‘Double’ |
Yes |
|
The URI of the property that is displayed in this dashboard item. |
|
Value of type ‘String’ |
Yes |
Inherited members from DashboardItem
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The unique identifier for this DashboardItem. |
|
An identifier string. May not contain ‘.’, spaces, newlines, or tabs |
No |
|
Determines the type of the DashbordItem that should be created. |
|
Value of type ‘String’ |
No |
|
If this value is set to ‘true’ this dashboard item is shown in the dashboard. Otherwise it will be hidden. |
|
Value of type ‘Boolean’ |
Yes |
|
The name for the DashboardItem that is used when showing it in the user interface. |
|
Value of type ‘String’ |
Yes |
Asset Examples
Int
This example adds a dashboard item that shows the state of a integer point value property.
1local Item = {
2 Identifier = "DashboardItemPropertyValue_Example_Int",
3 Type = "DashboardItemPropertyValue",
4 URI = "LuaConsole.HistoryLength",
5 DisplayString = "Lua Console History Length: {}"
6}
7
8asset.onInitialize(function()
9 openspace.dashboard.addDashboardItem(Item)
10end)
11
12asset.onDeinitialize(function()
13 openspace.dashboard.removeDashboardItem(Item)
14end)
Bool
This example adds a dashboard item that shows the state of a boolean property.
1local Item = {
2 Identifier = "DashboardItemPropertyValue_Example_Bool",
3 Type = "DashboardItemPropertyValue",
4 URI = "NavigationHandler.OrbitalNavigator.Friction.RotationalFriction",
5 DisplayString = "Rotational Friction is: {}"
6}
7
8asset.onInitialize(function()
9 openspace.dashboard.addDashboardItem(Item)
10end)
11
12asset.onDeinitialize(function()
13 openspace.dashboard.removeDashboardItem(Item)
14end)
Vec4
This example adds a dashboard item that shows the state of a 4-vector value property.
1local Item = {
2 Identifier = "DashboardItemPropertyValue_Example_Vec4",
3 Type = "DashboardItemPropertyValue",
4 URI = "RenderEngine.EnabledFontColor",
5 DisplayString = "Font Color (enabled): ({}, {}, {}, {})"
6}
7
8asset.onInitialize(function()
9 openspace.dashboard.addDashboardItem(Item)
10end)
11
12asset.onDeinitialize(function()
13 openspace.dashboard.removeDashboardItem(Item)
14end)
Float
This example adds a dashboard item that shows the state of a floating point value property.
1local Item = {
2 Identifier = "DashboardItemPropertyValue_Example_Float",
3 Type = "DashboardItemPropertyValue",
4 URI = "RenderEngine.Gamma",
5 DisplayString = "Gamma Correction: {}"
6}
7
8asset.onInitialize(function()
9 openspace.dashboard.addDashboardItem(Item)
10end)
11
12asset.onDeinitialize(function()
13 openspace.dashboard.removeDashboardItem(Item)
14end)
Vec3
This example adds a dashboard item that shows the state of a 3-vector value property.
1local Item = {
2 Identifier = "DashboardItemPropertyValue_Example_Vec3",
3 Type = "DashboardItemPropertyValue",
4 URI = "RenderEngine.GlobalRotation",
5 DisplayString = "Global Rotation: ({}, {}, {})"
6}
7
8asset.onInitialize(function()
9 openspace.dashboard.addDashboardItem(Item)
10end)
11
12asset.onDeinitialize(function()
13 openspace.dashboard.removeDashboardItem(Item)
14end)