Use the components to trigger events by hour, minute, day, date, month, year or a combination of the aforementioned.
Please see this example: LINK
To add the components to Pano2VR 7's components toolbox, download and then double-click.
Then add to the User Defined category or make a new category.
The text box will say Good Morning, Good Afternoon or Good Evening depending on the time of day.
The example link also has text boxes that show the data in the variables you can use for event triggers.
Note that the data is only used locally.
There are two components.
The first is date_trigger.
On output open, it takes a snapshot of the host computer/phone/tablet's current hour, minute, day, date month and year.
The second component does the same but has an interval timer to refresh every second, this time can be adjusted which will be explained later.
How they work:
The component adds six variables to the skin and uses a javascript call to get the current data from the host computer to populate the variables, here are the variables added to the skin.
• var_hour is a numbered variable using the 24-hour clock and displays the hour
• var_minute is a numbered variable that displays the minutes 0 to 59
• var_day is a numbered variable and displays the day 0 (Sunday) to 6 (Saturday)
• var_date is a numbered variable and displays the days 1 to 31 depending on the month
• var_month is a numbered variable and displays the month 1 to 12
• var_year is a numbered variable and displays the year using four digits, for example, 2015
The variables are automatically add to the skin, this is done by code in the Code Element.
/*!
{ "ggvariables": [ "var_hour", "var_minute", "var_day", "var_date", "var_month", "var_year" ] }
*/
The above code will add the variables as soon as the component is added to the skin.
When opened it shows the variables, because of this the variables are added to the skin when the component is added.
If your project does not require all the variables, for example, you may not need hour or minutes, you can remove the variables, var_hour and var_minute from the skin.
However you will then need to select the code element, then in its properties, Code Element, Code, remove the lines of code that would have populated the variables,
player.setVariableValue('var_hour',time.toLocaleTimeString());
player.setVariableValue('var_minute',time.getMinutes());
The image below shows the code in the date_trigger Code Element, code.
The code in the date_trigger_interval component has more code which is responsible for the interval time.
The interval time is in milliseconds, 1 x 1000, or as it is written in the Code Element, 1*1000.
So this is 1 millisecond x 1000, = 1 second.
If you wanted to set the interval to refresh the data every minute, then you would set it to 60*1000
Examples of use:
(1)
Using the hour variable to set text to display either Good Morning, Good Afternoon or Good Evening depending on the time of day.
Default text Good Morning, then text logic block:
First Expression
*var_hour, >=, 12, AND
*var_hour, <=, 16
Text: Good Afternoon
Second Expression
*var_hour, >=, 17, AND
*var_hour, <=, 23
Text: Good Evening
(2)
You want to change the text between the 23rd to the 31st of December:
var_date, >=, 23, AND
var_date <=, 31, AND
var_month, =, 12
Text: We are away for the Christmas Holidays
(3)
External Image Loader which displays a company logo.
But for Halloween, you want to show a spooky Halloween-themed company logo.
The External Image Loader will have the path to display the normal logo in the URL text field.
The URL Logic Block will have:
var_date, =, 31 AND
var_month, =, 10
External URL: path to the Halloween logo.
On the 31st of October, the logo will be changed for the day.
We hope you find these components useful.
Regards,
Date Trigger and Date Trigger Interval
- Hopki
- Gnome
- Posts: 13473
- Joined: Thu Jan 10, 2008 3:16 pm
- Location: Layer de la Haye, Essex UK
- Contact:
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
