How To : Use click_to_run

To include a clickable button, or text in P3D  you could use either a <click_to_event>, or a <click_to_run> tag, the first allows jumping to another slide, or layer within the current show, the second allows you to launch a new show. Here we will deal with the second method the <click_to_run> tag.

A good example of why you might want to lauch a new show would be using P3D to create menus that organise all of the shows you need for a particular presentation, event, or even for a visualisation center. 

There are two main items required to launch a new show :

1) The path to and name of the show you want to lauch.

2) The item that will be clicked. This can be OSG text using the <bullet>, or <paragraph> tags an image, or images, or even a model.

An empy line will seperate menu items. 

In the example below, a bullet has been used to create the clickable text and an image that is also clickable has been included. 

<click_to_run>${OSG_BINARY_PATH}/present3D "my path/click_test.p3d"</click_to_run>
<bullet>click this text to launch new show</bullet> <image>path_to _my/image.jpg</image>

 

In the following example there is a background image that is using the hud="on" tag  to ensure that it remains static and there are multiple clickable images, each one launching a different show. A layer can have as many clickable items as required.

 <slide>
      <bgcolor>BLACK</bgcolor>
      <textcolor>WHITE</textcolor>   

      <layer>
     
     <image hud="on" position="0.5 0.50.0" scale="1">images/background.png</image>
         
        <click_to_run>${OSG_BINARY_PATH}/present3D "my path/click_test_one.p3d";</click_to_run>
        <image  position="0.15 0.085 0.015" scale="0.3">menu/item_one.png</image>
        
          <click_to_run>${OSG_BINARY_PATH}/present3D "my path/click_test_two.p3d"</click_to_run>
          <image  position="0.82 0.27 0.015" scale="0.3">menu/item_two.png</image>
        
          <click_to_run>${OSG_BINARY_PATH}/present3D "my path/click_test_three.p3d"</click_to_run>
          <image  position="0.65 0.2 0.015" scale="0.3">menu/item_three.png</image>
       
        </layer>
   </slide>

 

Things To Note :

Clickable items currently won't work with the hud="on" tag.

It is essential that ${OSG_BINARY_PATH}/present3D is used as shown.

 

 

Like: 
No votes yet