From 99a976a53cde1c29c129cacfc023c9ccec8a0302 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 18 Jul 2024 12:02:09 +0200 Subject: [PATCH] Add an example to show the current in-game time in a screenspace object (closes #3312) --- data/assets/examples/screenspacedate.asset | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 data/assets/examples/screenspacedate.asset diff --git a/data/assets/examples/screenspacedate.asset b/data/assets/examples/screenspacedate.asset new file mode 100644 index 0000000000..4b3b154ce6 --- /dev/null +++ b/data/assets/examples/screenspacedate.asset @@ -0,0 +1,44 @@ +local Dashboard = { + Identifier = "ScreenSpaceTime", + Name = "Time", + Type = "ScreenSpaceDashboard", + FaceCamera = false, + Scale = 3.0, + Items = { + { + Type = "DashboardItemDate", + Identifier = "Date", + GuiName = "Date", + FontSize = 72, + FormatString = "{}", + TimeFormat = "YYYY MON DD HR:MN:SC.### ::RND" + } + } +} + + +asset.onInitialize(function() + openspace.addScreenSpaceRenderable(Dashboard) + + openspace.setPropertyValueSingle("ScreenSpace.ScreenSpaceTime.Size", {0.000000,0.000000,640.000000,320.000000}) + +end) + +asset.onDeinitialize(function() + openspace.addScreenSpaceRenderable(Dashboard) +end) + +asset.export(Dashboard) + + + +asset.meta = { + Name = "ScreenSpace - Date", + Description = [[ + This asset provides a Date dashboard item that is shown on a screen space object. + This can be place on a dome surface to show the current time to the audience. + ]], + Author = "OpenSpace Team", + URL = "http://openspaceproject.com", + License = "MIT license" +}