Skip to content
mer edited this page Sep 18, 2013 · 32 revisions

Background image

    <image name="background">
        <file>images/background.jpg</file>
        <position>Point(640,400,0)</position>
    </image>

Background image and one product that reveals an image

template file:

<class name="product_toggle">
 <perchObject>
        <name input="product_name">product_name</name>
        <position input="productPos">Point(640,400,0)</position>
        <content>
        <!--spotlight image to highlight the product-->
	<image name="spotlight">
	  <file>images/spotlight.png</file>
	</image>
        <!--pick up sign to guide the user in the interaction-->
	<image name="pickmeup">
	  <file>images/pickmeup.png</file>
	  <position>Point(-100,180,0)</position>
        </image>
        <!--image that will appear once the user removes the product-->
        <image name="imageProduct">
	  <file>images/product.png</file>
        </image>
        <!--sound triggered once the user removes the product-->
	<soundObject name="pickupSound" loop="0" multiplay="1">
	  <file input="audio_file_name">sounds/pickupsound.aif</file>
	</soundObject>
	<sensingArea input="objectSenseRect">rect(0,0,120,120)</sensingArea>
	<event type="onInit">
	  <show>spotlight</show>
          <show> pickmeup</show>
          <hide>pickUpSound</hide>
          <hide>imageProduct</hide>
        </event>
	<event type="onPresent">
	  <show>spotlight</show>
          <show> pickmeup</show>
          <hide>pickUpSound</hide>
          <hide>imageProduct</hide>
        </event>
        <event type="onNotPresent">
	  <hide>spotlight</hide>
          <hide> pickmeup</hide>
          <show>pickUpSound</show>
          <show>imageProduct</show>
	</event>
 </perchObject>
</class>

layout file:

    <image name="background">
        <file>images/background.png</file>
        <position>Point(640,400,0)</position>
    </image>
    
    <instance class = "product_toggle">
        <name input="product_name">product1</name>
        <position input="product_position">Point(640,400,0)</position>
    </instance>

Background image and one product that reveals a slideshow

template file:

<class name="product_toggle">
<perchObject>
        <name input="product_name">product_name</name>
	<position input="productPos">Point(640,400,0)</position>
	<content>
	<image name="spotlight">
	  <file>images/spotlight.png</file>
	</image>
	<image name="pickmeup">
	  <file>images/pickmeup.png</file>
	<position>Point(-100,180,0)</position>
        </image>
        <slideshow name="imageProduct">
	  <folder type="images">images/product1</folder>
          <repeat>regular</repeat>
          <rate>1</rate>
          <delay>0</delay>
          <!--This will create smooth transitions between slides-->
          <tweenIn alpha="1" duration="1" repeat="none" function="sinusInFunc" />
          <tweenOut alpha="0" duration="1" repeat="none" function="sinusInFunc" />
        </slideshow>
        <soundObject>
	  <file input="audio_file_name">sounds/pickupsound.aif</file>
	</soundObject>
	<sensingArea input="objectSenseRect">rect(0,0,120,120)</sensingArea>
	</content>
	<event type="onInit">
	  <show>spotlight</show>
          <show>pickmeup</show>
          <hide>pickUpSound</hide>
          <hide>imageProduct</hide>
        </event>
	<event type="onPresent">
	  <show>spotlight</show>
          <show>pickmeup</show>
          <hide>pickUpSound</hide>
          <hide>imageProduct</hide>
        </event>
        <event type="onNotPresent">
	  <hide>spotlight</hide>
          <hide>pickmeup</hide>
          <show>pickUpSound</show>
          <show>imageProduct</show>
	</event>
 </perchObject>
</class>

layout file:

    <image name="background">
        <file>images/background.png</file>
        <position>Point(640,400,0)</position>
    </image>
    
    <instance class = "product_toggle">
        <name input="product_name">product1</name>
        <position input="product_position">Point(640,400,0)</position>
    </instance>

Background image and one product that reveals a switch with content: photos, info and video

template file:

<class name="product_toggle">
 <perchObject>
        <name input="product_name">product_name</name>
	<position input="productPos">Point(640,400,0)</position>
	<content>
	<image name="spotlight">
	  <file>images/spotlight.png</file>
	</image>
	<image name="pickmeup">
	  <file>images/pickmeup.png</file>
	<position>Point(-100,180,0)</position>
        </image>
        <instance class="switch">
          <name input="switch_name">contentSwitch</name>
        </instance>
	<soundObject name="pickUpSound" loop="0" multiplay="1">
	  <file input="audio_file_name">sounds/pickupsound.aif</file>
	</soundObject>
	<sensingArea input="objectSenseRect">rect(0,0,120,120)</sensingArea>
	</content>
	<event type="onInit">
	  <show>spotlight</show>
          <show>pickmeup</show>
          <hide>pickUpSound</hide>
          <hide>contentSwitch</hide>
        </event>
	<event type="onPresent">
	  <show>spotlight</show>
          <show>pickmeup</show>
          <hide>pickUpSound</hide>
          <hide>contentSwitch</hide>
        </event>
        <event type="onNotPresent">
	  <hide>spotlight</hide>
          <hide>pickmeup</hide>
          <show>pickUpSound</show>
          <show>contentSwitch</show>
	</event>
 </perchObject>
</class>
    
<class name="switch">
 <perchObject>
        <name input="switch_name">contentSwitch</name>
	<position input="switch_position">Point(0,0,0)</position>
	<content>
        <image name="info">
	  <file>images/info.png</file>
	</image>
                
        <slideshow name="photos">
	  <folder type="images">images/product1</folder>
          <repeat>regular</repeat>
          <rate>1</rate>
          <delay>0</delay>
          <tweenIn alpha="1" duration="1" repeat="none" function="sinusInFunc" />
          <tweenOut alpha="0" duration="1" repeat="none" function="sinusInFunc" />
        </slideshow>
                
        <video name="video">
          <file>videos/video.mov</file>
          <loop>1</loop>
          <autoplay>1</autoplay>
        </video>
                
        <instance class="button">
	  <name input="button_name">photosB</name>
	  <position input="button_position">Point(-100,200,0)</position>
	  <file input="defaultI">images/buttons/photos.png</file>
	  <file input="selectI">images/buttons/photos_select.png</file>
	</instance>
                
	<instance class="button">
	  <name input="button_name">infoB</name>
          <position input="button_position">Point(0,200,0)</position>
	  <file input="defaultI">images/buttons/info.png</file>
	  <file input="selectI">images/buttons/info_select.png</file>
	</instance>
                
        <instance class="button">
	  <name input="button_name">videoB</name>
	  <position input="button_position">Point(100,200,0)</position>
	  <file input="defaultI">images/buttons/photos.png</file>
	  <file input="selectI">images/buttons/info_select.png</file>
	</instance>
				
        </content>
            
	<event type="onInit">
	  <tell_message message="select">infoB</tell_message>
	  <tell_message message="deselect">photosB</tell_message>
          <tell_message message="deselect">videoB</tell_message>
	  <show>info</show>
	  <hide>photos</hide>
          <hide>video</hide>
	</event>
            
	<event type="onShow">
          <tell_message message="select">infoB</tell_message>
	  <tell_message message="deselect">photosB</tell_message>
          <tell_message message="deselect">videoB</tell_message>
	  <show>info</show>
	  <hide>photos</hide>
          <hide>video</hide>
	</event>
            
	<event type="onMessage" message="button_press" name="photosB">
          <tell_message message="select">photosB</tell_message>
	  <tell_message message="deselect">infoB</tell_message>
          <tell_message message="deselect">videoB</tell_message>
	  <show>photos</show>
	  <hide>info</hide>
          <hide>video</hide>
	</event>
            
	<event type="onMessage" message="button_press" name="infoB">
          <tell_message message="select">infoB</tell_message>
	  <tell_message message="deselect">photosB</tell_message>
          <tell_message message="deselect">videoB</tell_message>
	  <show>info</show>
	  <hide>photos</hide>
          <hide>video</hide>
	</event>
            
        <event type="onMessage" message="button_press" name="videoB">
          <tell_message message="select">videoB</tell_message>
	  <tell_message message="deselect">photosB</tell_message>
          <tell_message message="deselect">infoB</tell_message>
	  <show>video</show>
	  <hide>photos</hide>
          <hide>info</hide>
	</event>
            
</perchObject>
</class>
<class name="button">
<perchObject>
        <name input="button_name">button$N</name>
	<position input="button_position">Point(0,0,0)</position>
	<content protected="1">
                
	<image>
	  <file input="defaultI">images/buttons/button_$N.png</file>
	  <name>defaultGraphics</name>
	</image>
	<image>
	  <file input="selectI">images/buttons/button_selected_$N.png</file>
	  <name>selectGraphics</name>
	</image>
        <handSensor input="handSensorRect">rect(0,0,100,100)</handSensor>
	</content>
	<event type="onTouchPress">
	  <bubble_message message="button_press" />
	<show>button_click</show>
	</event>
            
	<event type="onInit">
	  <hide>defaultGraphics</hide>
	  <hide>selectGraphics</hide>
	</event>
	  <event type="onMessage" message="select">
	  <hide>defaultGraphics</hide>
	<show>selectGraphics</show>
	</event>
	<event type="onMessage" message="deselect">
	  <show>defaultGraphics</show>
	  <hide>selectGraphics</hide>
	</event>
            
</perchObject>
</class>

layout file:

    <image name="background">
        <file>images/background.png</file>
        <position>Point(640,400,0)</position>
    </image>
    
    <instance class = "product_toggle">
        <name input="product_name">product1</name>
        <position input="product_position">Point(640,400,0)</position>
    </instance>
<!-- uncomment to add instances 
    <instance class = "product_toggle">
        <name input="product_name">product2</name>
        <position input="product_position">Point(340,400,0)</position>
    </instance>
    <instance class = "product_toggle">
        <name input="product_name">product3</name>
        <position input="product_position">Point(940,400,0)</position>
    </instance>
-->