Object2VR 4 Docs / Triggers

Logic Block Triggers

Triggers are start of events for a condition of a logic block.

Player

Player Width

The trigger is based on the width of the player.

Player Height

The trigger is based on the height of the player.

Player Aspect Ratio

The trigger is based on the player’s aspect ratio. This is helpful when you want to detect the player’s orientation.

For example, if you want to check if the player is in landscape orientation (the player’s width is greater than its height), the expression would look like this:

Trigger Comparison Value Operation
Player Aspect Ratio > 1

For portrait orientation, when the width is less than the height, it would be:

Trigger Comparison Value Operation
Player Aspect Ratio < 1

And for a square aspect ratio, use =:

Trigger Comparison Value Operation
Player Aspect Ratio = 1

Fullscreen

The trigger is based on the player being in Fullscreen or not.

View Mode

This trigger compares the Viewer’s mode: Rotate Mode or Move Mode.

Poly Mode

This is based on the currently active polygon hotspot’s View Mode. You can use this to show/hide buttons whose actions are to show and hide the polygon hotspots.

For example:

Trigger Comparison Value Operation
Poly Mode = Show Current
Visible: False

Is Mobile

Use this trigger to initiate the logic block based on the mobile device being used (iOS, iPadOS, and Android).

One example of use would be to hide tooltips when a mobile device is being used.

Trigger Comparison Value Operation
Mouse Over Parent = True AND
is Mobile = False
Visible: True

Has Touch

Use Has Touch for touch events. A touch event will trigger the logic block whereas Is Mobile will be triggered the moment the device is detected.

Language

Trigger based on the player’s current language.

Mouse

Mouse Over

When the mouse hovers over an element it will trigger an event.

Mouse Down

When the mouse clicks on or presses down on an element it will trigger an event. For a touch device, this event happens when the element is tapped or touched.

Mouse Over Parent

Add this trigger to an element that is a child of a parent. When the mouse hovers over the element’s parent, it will trigger an event. An example of use is to show/hide hotspot tooltips, where the text box for the tooltip is the child of the hotspot template.

Mouse Down Parent

Add this trigger to an element that is a child of a parent. When the mouse clicks or pressed down on the element’s parent, it will trigger an event.

View

Pan

The trigger is based on the angle of rotation for the pan movement (left/right).

Tilt

The trigger is based on the angle of rotation for the tilt movement (up/down).

Zoom

Trigger based on a Zoom level.

Column

This trigger is based on the column number.

Row

Trigger an event based on the Row number.

State

This trigger is based on the object’s state. Enter the state number.

The following Triggers are useful for control buttons when the possibility is needed to show buttons in a disabled state whenever the limit of the x/y direction or zoom of the object is reached.

Can Pan Left, Pan Right, Tilt Up, Tilt Down, Zoom In, Zoom Out

These triggers provide the possibility to disable controller buttons based on if the object can still move in a direction. For example, if the project does not use “Wrap” for Control in the Viewing Parameters, then the spin will end at the last column image. Add this trigger to the Visible attribute of a button to show or hide an enabled or disabled button. See the built-in skin, feather_box.ggsk to see it in action.

Auto Rotating

With this trigger, you can create an event if the panorama is currently auto-rotating (true) or not (false).

Project

The following count triggers are useful in hiding and showing elements in the skin. For example, maybe you have a skin you use frequently that features a change state button, but not every project has a state. In this case, you use the States Count trigger in a Visible logic block to hide that button if the current project doesn’t have states.

Columns Count

Set this trigger to activate based on the number of columns in the project.

Rows Count

A trigger based on the number of rows in a project.

States Count

A trigger based on the number of states in a project.

Has Zoom

Set this trigger to activate if the project has zoom enabled or not.

Point Hotspots Count

This trigger reacts to the number of defined point hotspots. For example, this can be used to toggle a Show/Hide Hotspots button if no hotspots are in the project. See material_index.ggsk for reference.

Translations Count

This trigger reacts to the number of translations added to a project. This can be used, for example, to show or hide a Translation button based on the number of languages added to the project. See material_dart.ggsk for reference.

State

Loading

The trigger is based on if the panorama is loading or not.

Loading Tiles

The trigger is based on the tiles being loaded.

Active

The trigger is based on the element being active or not. The Timer element uses a logic block and it can be used to hide elements in the skin. For example, adding an element as a child to the Timer will allow the timer to hide the element after it times out. Once the timer is no longer active, the element attached to it will hide.

Advanced

Host

Use the Host trigger to show and hide skin elements based on the project’s host location. Add the hosting domain to Value.

This way, you can change an element’s attribute depending on which domain the project is served from which means you can create domain locks, or change colors based on domain or if you use a mobile domain, you can show and hide certain elements just for mobile displays.

To show an element based on a specified domain, deselect Visible and add a logic block:

Trigger Comparison Value Operation
Host = ggnome.com
Visible: True

Operating System

The Operating System trigger reacts to the chosen operating system. Choose from the list in the value column.

✭ If you’re having issues with the is Mobile trigger on Android, try using this trigger instead.

Browser

The Browser trigger will react to the chosen browser. For the value, choose from the list of browsers:

  • Chrome
  • Firefox
  • Safari
  • Edge
  • Internet Explorer
  • Meta Quest Browser
  • Unknown

Browser Theme

Use this trigger to change an element’s parameter based on the browser’s current appearance or theme. Choose from Dark or Light.

Variables

Any variables that have been added to the skin properties will be listed here. Variables can also be used as values. Right-click in the Value column to choose the variable.

Placeholders

Placeholders for hotspots and user data can be used as triggers within logic blocks. This means the logic block can detect user data and hotspot entries. They can also be used as Values. Right-click in the Value column to choose the placeholder.

Hotspots

  • $(hs) = hotspot title

  • $(hd) = hotspot description

  • $(hu) = hotspot URL

  • $(ht) = hotspot target

User Data

  • $(ut) = user data title

  • $(ud) = user data description

  • $(ua) = user data author

  • $(ue) = user data date/time

  • $(uc) = user data copyright

  • $(us) = user data source

  • $(ui) = user data information

  • $(uo) = user data comment

Example

A hotspot template may have a text box that displays a tooltip for the hotspot title. But, there may be an instance where the title is missing. For instance, if you have a tour and some nodes have titles missing, then you’ll see an inconsistency in the tooltips; some will be populated, others will be empty. To prevent this, you can use placeholders as triggers in a Visible logic block that will hide the text box altogether if nothing is detected in the User Data’s Title field.

Add a text field as a child to a hotspot template. In the text field’s appearance parameters, add a logic block to the Visible setting (which is selected) and create the following expression

Trigger Comparison Value Operation
hotspot title $(hs) =
Visible: False

This states that if the title text field of a hotspot is empty, then the text box should not be visible.

See also…

Last modified: Nov 17, 2022