DashboardItemElapsedTime
Inherits DashboardItem
Asset Examples
1asset.require("scene/solarsystem/planets/earth/earth")
2asset.require("scene/solarsystem/planets/earth/moon/moon")
3
4local Angle = {
5 Type = "DashboardItemAngle",
6 Identifier = "Angle",
7 ReferenceType = "Node",
8 ReferenceNodeName = "Earth",
9 DestinationType = "Node",
10 DestinationNodeName = "Moon"
11}
12
13local Date = {
14 Type = "DashboardItemDate",
15 Identifier = "Date"
16}
17
18local SimulationIncrement = {
19 Type = "DashboardItemSimulationIncrement",
20 Identifier = "SimulationIncrement",
21 GuiName = "Simulation Increment"
22}
23
24local Distance = {
25 Type = "DashboardItemDistance",
26 Identifier = "Distance"
27}
28
29local Framerate = {
30 Type = "DashboardItemFramerate",
31 Identifier = "Framerate"
32}
33
34local ParallelConnection = {
35 Type = "DashboardItemParallelConnection",
36 Identifier = "ParallelConnection",
37 GuiName = "Parallel Connection"
38}
39
40local Mission = {
41 Type = "DashboardItemMission",
42 Identifier = "Mission"
43}
44
45local PropertyValue = {
46 Type = "DashboardItemPropertyValue",
47 Identifier = "DashbaordItemPropertyValue",
48 URI = "Scene.Earth.Renderable.Enabled",
49 DisplayString = "Earth is enabled: {}"
50}
51
52local PropertyValueFloat = {
53 Type = "DashboardItemPropertyValue",
54 Identifier = "DashbaordItemPropertyValue_Float",
55 URI = "Scene.Earth.Renderable.TargetLodScaleFactor",
56 DisplayString = "Earth LOD is {:.5f}"
57}
58
59local PropertyValueDouble = {
60 Type = "DashboardItemPropertyValue",
61 Identifier = "DashbaordItemPropertyValue_Double",
62 URI = "NavigationHandler.PathNavigator.ArrivalDistanceFactor",
63 DisplayString = "Arrival Distance Factor is {:.8f}"
64}
65
66local PropertyValueInt = {
67 Type = "DashboardItemPropertyValue",
68 Identifier = "DashbaordItemPropertyValue_Int",
69 URI = "LuaConsole.HistoryLength",
70 DisplayString = "History length is {}"
71}
72
73local PropertyValueUInt = {
74 Type = "DashboardItemPropertyValue",
75 Identifier = "DashboardItemPropertyValue_UInt",
76 URI = "Modules.Globebrowsing.TileCacheSize",
77 DisplayString = "Tile Cache Size is {}"
78}
79
80local PropertyValueDVec3 = {
81 Type = "DashboardItemPropertyValue",
82 Identifier = "DashboardItemPropertyValue_DVec3",
83 URI = "Scene.SolarSystemBarycenter.Transform.Transform",
84 DisplayString = "SSB Transform is: ({}, {}, {})"
85}
86
87local PropertyValueIVec2 = {
88 Type = "DashboardItemPropertyValue",
89 Identifier = "DashboardItemPropertyValue_IVec2",
90 URI = "Scene.SolarSystemBarycenter.Renderable.ScreenSpacePosition",
91 DisplayString = "Random ScreenSpace Position: ({}, {})"
92}
93
94local PropertyValueVec2 = {
95 Type = "DashboardItemPropertyValue",
96 Identifier = "DashboardItemPropertyValue_Vec2",
97 URI = "Scene.EarthAtmosphere.Renderable.AtmosphereDimmingSunsetAngle",
98 DisplayString = "Sunset Angle is ({}, {})"
99}
100
101local PropertyValueVec3 = {
102 Type = "DashboardItemPropertyValue",
103 Identifier = "DashboardItemPropertyValue_Vec3",
104 URI = "RenderEngine.GlobalRotation",
105 DisplayString = "Global Rotation is ({}, {}, {})"
106}
107
108local PropertyValueVec4 = {
109 Type = "DashboardItemPropertyValue",
110 Identifier = "DashboardItemPropertyValue_Vec4",
111 URI = "LuaConsole.BackgroundColor",
112 DisplayString = "Background Coolor is ({}, {}, {}, {})"
113}
114
115local ElapsedTime = {
116 Type = "DashboardItemElapsedTime",
117 Identifier = "ElapsedTime",
118 ReferenceTime = "2022-10-12 12:00:00"
119}
120
121local InputState = {
122 Type = "DashboardItemInputState",
123 Identifier = "InputState"
124}
125
126
127asset.onInitialize(function()
128 openspace.dashboard.addDashboardItem(Angle)
129 openspace.dashboard.addDashboardItem(Date)
130 openspace.dashboard.addDashboardItem(SimulationIncrement)
131 openspace.dashboard.addDashboardItem(Distance)
132 openspace.dashboard.addDashboardItem(Framerate)
133 openspace.dashboard.addDashboardItem(ParallelConnection)
134 openspace.dashboard.addDashboardItem(Mission)
135 openspace.dashboard.addDashboardItem(PropertyValue)
136 openspace.dashboard.addDashboardItem(PropertyValueFloat)
137 openspace.dashboard.addDashboardItem(PropertyValueDouble)
138 openspace.dashboard.addDashboardItem(PropertyValueInt)
139 openspace.dashboard.addDashboardItem(PropertyValueUInt)
140 openspace.dashboard.addDashboardItem(PropertyValueDVec3)
141 openspace.dashboard.addDashboardItem(PropertyValueIVec2)
142 openspace.dashboard.addDashboardItem(PropertyValueVec2)
143 openspace.dashboard.addDashboardItem(PropertyValueVec3)
144 openspace.dashboard.addDashboardItem(PropertyValueVec4)
145 openspace.dashboard.addDashboardItem(ElapsedTime)
146 openspace.dashboard.addDashboardItem(InputState)
147end)
148
149asset.onDeinitialize(function()
150 openspace.dashboard.removeDashboardItem(InputState)
151 openspace.dashboard.removeDashboardItem(ElapsedTime)
152 openspace.dashboard.removeDashboardItem(PropertyValueVec4)
153 openspace.dashboard.removeDashboardItem(PropertyValueVec3)
154 openspace.dashboard.removeDashboardItem(PropertyValueVec2)
155 openspace.dashboard.removeDashboardItem(PropertyValueIVec2)
156 openspace.dashboard.removeDashboardItem(PropertyValueDVec3)
157 openspace.dashboard.removeDashboardItem(PropertyValueUInt)
158 openspace.dashboard.removeDashboardItem(PropertyValueInt)
159 openspace.dashboard.removeDashboardItem(PropertyValueDouble)
160 openspace.dashboard.removeDashboardItem(PropertyValueFloat)
161 openspace.dashboard.removeDashboardItem(PropertyValue)
162 openspace.dashboard.removeDashboardItem(Mission)
163 openspace.dashboard.removeDashboardItem(ParallelConnection)
164 openspace.dashboard.removeDashboardItem(Framerate)
165 openspace.dashboard.removeDashboardItem(Distance)
166 openspace.dashboard.removeDashboardItem(SimulationIncrement)
167 openspace.dashboard.removeDashboardItem(Date)
168 openspace.dashboard.removeDashboardItem(Angle)
169end)
170
171asset.export(Angle)
172asset.export(Date)
173asset.export(SimulationIncrement)
174asset.export(Distance)
175asset.export(Framerate)
176asset.export(ParallelConnection)
177asset.export(Mission)
178asset.export(PropertyValue)
179asset.export(PropertyValueFloat)
180asset.export(PropertyValueDouble)
181asset.export(PropertyValueInt)
182asset.export(PropertyValueUInt)
183asset.export(PropertyValueDVec3)
184asset.export(PropertyValueIVec2)
185asset.export(PropertyValueVec2)
186asset.export(PropertyValueVec3)
187asset.export(PropertyValueVec4)
188asset.export(ElapsedTime)
189asset.export(InputState)
190
191
192
193asset.meta = {
194 Name = "Dashboard Items Example",
195 Description = [[Examples of different types of dashboard items. These are dynamic
196 information texts that will be shown over the rendering (per default in the top
197 left corner, on flat screens).]],
198 Author = "OpenSpace Team",
199 URL = "http://openspaceproject.com",
200 License = "MIT license"
201}