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

FontName

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.

String

Value of type ‘String’

Yes

FontSize

This value determines the size of the font that is used to render the distance.

Double

Value of type ‘Double’

Yes

RegularFormat

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.

String

Value of type ‘String’

Yes

RequestedUnit

If the simplification is disabled, this time unit is used as a destination to convert the seconds into.

String

In list { Nanosecond, Microsecond, Millisecond, Second, Minute, Hour, Day, Month, Year }

Yes

Simplification

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.

Boolean

Value of type ‘Boolean’

Yes

TransitionFormat

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.

String

Value of type ‘String’

Yes

Inherited members from DashboardItem

Name

Documentation

Type

Description

Optional

Identifier

The unique identifier for this DashboardItem.

Identifier

An identifier string. May not contain ‘.’, spaces, newlines, or tabs

No

Type

Determines the type of the DashbordItem that should be created.

String

Value of type ‘String’

No

Enabled

If this value is set to ‘true’ this dashboard item is shown in the dashboard. Otherwise it will be hidden.

Boolean

Value of type ‘Boolean’

Yes

GuiName

The name for the DashboardItem that is used when showing it in the user interface.

String

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)