Common Attributes: Depth

The relative depth of an object may be controlled using the depth attribute

If there’s an overlap between two objects in the same container, the object with the higher depth is displayed in front of the one with the lower depth. If the depths of the two objects are the same, the order in which they are displayed is determined based on their order in the IML document.

Attributes

Name Description
depth Specifies the relative depth of an object with respect to other objects within its container.

Example

<?xml version="1.0"?>
<viewer xmlns="http://issuu.com/viewer/1.0" backgroundColor="#111111">
 
 <skin source="skins.swf"/>
 
 <image source="#Image1" left="10" top="20" depth="1"/>
 <image source="#Image2" left="40" top="50" depth="0"/>
 <image source="#Image3" left="70" top="80" depth="0"/>
 
 ...
 
</viewer>

In the example above, if there’s any overlap between the first two images, the first image is set to be displayed in front of the second image. However, if there’s any overlap between the second and the third image, the third image appears in front of the second image, since it comes after the second image in the IML document.

Every object has a default depth of 0.

 

Contents