DashboardItemSimulationIncrement
Inherits DashboardItem
This DashboardItem
shows how fast the in-game time progresses. The display string for the RegularFormat
is used when the current simulation increment is not changing, the TransitionFormat
is used if the simulation increment is currently interpolating to a new value.
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
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 format string used to format the text if the target delta time is the same as the current delta time. This format gets three parameters in this order: The target delta value, the target delta unit, and the string ‘Paused’ if the delta time is paused or the empty string otherwise. More information about how to make use of the format string, see the documentation at https://en.cppreference.com/w/cpp/utility/format/spec. |
|
Value of type ‘String’ |
Yes |
|
If the simplification is disabled, this time unit is used as a destination to convert the seconds into. |
|
In list { Nanosecond, Microsecond, Millisecond, Second, Minute, Hour, Day, Month, Year } |
Yes |
|
If this value is enabled, the time is displayed in nuanced units, such as minutes, hours, days, years, etc. If this value is disabled, it is always displayed in seconds. |
|
Value of type ‘Boolean’ |
Yes |
|
Format string used to format the text used while in a delta time transition, that is if the current delta time is being interpolated to reach a target delta time. This format gets five parameters in this order: The target delta time value, the target delta time unit, the string ‘Paused’ if the delta time is paused or the empty string otherwise, the current delta time value, and the current delta time unit. More information about how to make use of the format string, see the documentation at https://en.cppreference.com/w/cpp/utility/format/spec. |
|
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
Nanoseconds
This example adds a dashboard item that shows the current simulation increment always expressed in nanoseconds.
1local Item = {
2 Identifier = "DashboardItemSimulationIncrement_Example_NoDecoration",
3 Type = "DashboardItemSimulationIncrement",
4 RequestedUnit = "Nanosecond"
5}
6
7asset.onInitialize(function()
8 openspace.dashboard.addDashboardItem(Item)
9end)
10
11asset.onDeinitialize(function()
12 openspace.dashboard.removeDashboardItem(Item)
13end)
Basic
This example adds a dashboard item that shows the current simulation increment.
1local Item = {
2 Identifier = "DashboardItemSimulationIncrement_Example",
3 Type = "DashboardItemSimulationIncrement"
4}
5
6asset.onInitialize(function()
7 openspace.dashboard.addDashboardItem(Item)
8end)
9
10asset.onDeinitialize(function()
11 openspace.dashboard.removeDashboardItem(Item)
12end)
No Decoration
This example adds a dashboard item that shows the current simulation increment without
any textual decorations. This example also shows how to ignore the first two parameters
the TransitionFormat
format string. Both the TransitionFormat
and the
RegularFormat
string replacement markers allow the setting of numbers to determine
which argument should be placed in here. The TransitionFormat
in this example omits
the numbers 0 and 1, thus ignoring the first two arguments to the string.
1local Item = {
2 Identifier = "DashboardItemSimulationIncrement_Example_NoDecoration",
3 Type = "DashboardItemSimulationIncrement",
4 TransitionFormat = "{3:.1f} {4:s} / second{2:s}",
5 RegularFormat = "{:.1f} {:s} / second{:s}"
6}
7
8asset.onInitialize(function()
9 openspace.dashboard.addDashboardItem(Item)
10end)
11
12asset.onDeinitialize(function()
13 openspace.dashboard.removeDashboardItem(Item)
14end)