HomefieldOfView | SPi-V dev

Legend

  • required
  • not yet implemented

Navigation

user

Adding preview layers to image nodes

When you have your first xml document working, adding a preview layer is a simple way to make the downloading of image resources a less boring process for your audience.

In this howto article, we will start out with the script we saw in a previous article (note that I have removed the <meta> tag for clarity):

<?xml version="1.0"?>
<tour>
  <scene id="my_scene>">
    <panoelement id="my_pano" image="my_image" />
    <image id="my_image">
      <layer class="base" type="bitmap" src="panorama.jpg" />
    </image>
  </scene>
</tour>

As in the previous article, replace "panorama.jpg" with the filename of your panoramic image.

To add a preview layer, which displays while the 'base' layer is loading, we add a second layer to the image node:

<?xml version="1.0"?>
<tour>
  <scene id="my_scene>">
    <panoelement id="my_pano" image="my_image" />
    <image id="my_image">
      <layer class="base" type="bitmap" src="panorama.jpg" />
      <layer class="preview" type="bitmap" src="preview.jpg" />      
    </image>
  </scene>
</tour>

Preview layers will only be loaded and displayed when the SPi-V.dcr file or your content is online. When you load both the SPi-V engine and your content from a local location (eg your harddrive), preview layers are ignored.

It is generally a good idea to make sure the image you specify for the preview layer has the same proportions as the other layers in the image, or the results may be unpredictable.