Hello everybody,
I'm just trying to create my first tour and struggeling with the flyout action from the examples on the krpano page and from the forum. When I expand one picture, the other one will still be visible through the other one. I figured it is some problem about the zorder, but I can't solve it.
Here is my code until now:
Code
<hotspot name="A"
url="bilder/A.png"
zorder="1"
ath="13.5"
atv="-3"
scale="0.04"
rx="0" ry="-5" rz="0"
distorted="true"
backup_rx="0"
backup_ry="0"
backup_rz="0"
backup_scale="0.04"
backup_zorder="1"
flying="0.0"
onclick="if(flying == 0.0, flyout() );
if(flying == 1.0, flyback() );" />
<hotspot name="B"
url="bilder/B.png"
zorder="2"
ath="-50.5"
atv="-2.5"
scale="0.05"
rx="0" ry="17" rz="0"
distorted="true"
backup_rx="0"
backup_ry="0"
backup_rz="0"
backup_scale="0.05"
backup_zorder="2"
flying="0.0"
onclick="if(flying == 0.0, flyout() );
if(flying == 1.0, flyback() );" />
<!--flyout/flyback actions(for more stylish in/out moves play with different tweentypes and times)--> <action name="flyout">
<!--save/backup the current rotation values!
NOTE - it is important that the backup_* variables are predefined! this allows to save the variables at <hotspot> scope,
if the variables where not predefined, they were saved at global scope and this would be a problem when more hotspots were used! -->
copy(backup_rx,rx);
copy(backup_ry,ry);
copy(backup_rz,rz);
copy(backup_scale,scale);
<!-- tween the rotations values to 0 for a flat screen view -->
tween(rx, 0);
tween(ry, 0);
tween(rz, 0);
tween(scale, 1);
<!-- tween 'flying' to 1.0, this makes the hotspot independent from the panorama rotation and scaling-->
tween(flying, 1.0);
</action>
<action name="flyback">
<!-- tween back to the stored backup values -->
tween(rx, get(backup_rx));
tween(ry, get(backup_ry));
tween(rz, get(backup_rz));
tween(scale, get(backup_scale));
<!-- tween 'flying' back to 0.0 -->
tween(flying, 0.0);
</action>
Display More
So what I want to achieve is, whatever hotspot is expanded, it will be on the top layer. Can anybody give me a qucik fix to the problem?
Thanks in advance!
Ah, almost forgot:
Code
<!-- use a <style> to share the same attriubtes for all hotspots -->
<style name="flyoutimage"
distorted="true"
flying="0.0"
backup_state=""
backup_zorder=""
flying_state="in"
capture="false"
onclick="flyout_hotspot()"
/>
<hotspot name="A" style="flyoutimage" url="bilder/A.png"
zorder="1"
ath="13.5"
atv="-3"
scale="0.04"
rx="0" ry="-5" rz="0"
/>
<hotspot name="B"
url="bilder/B.png"
zorder="2"
ath="-50.5"
atv="-2.5"
scale="0.05"
rx="0" ry="17" rz="0"
/>
<!-- flyout hotspot actions -->
<action name="flyout_hotspot">
for(set(i,0), i LT hotspot.count, inc(i),
copy(hs, hotspot[get(i)]);
if(hs.name != name AND hs.style == 'flyoutimage' AND (hs.flying_state == 'out' OR hs.flying_state == 'flyingout'),
callwith(hs, flyout_hotspot() );
);
); if(flying_state == 'flyingout',
set(flying_state, 'flyingin');
,
if(flying_state == 'flyingin',
set(flying_state, 'flyingout');
);
); if(flying_state == 'in',
calc(backup_state, '0.0|' + rx + '|' + ry + '|' + rz + '|' + scale);
copy(backup_zorder, zorder);
set(flying_state, 'flyingout');
); if(flying_state == 'out',
set(flying_state, 'flyingin');
); if(flying_state == 'flyingout',
set(zorder, 99);
tween(flying|rx|ry|rz|scale, '1.0|0.0|0.0|0.0|1.0', 0.5, default, set(flying_state,'out'); set(capture,true); );
); if(flying_state == 'flyingin',
sub(zorder,1);
set(capture,false);
tween(flying|rx|ry|rz|scale, get(backup_state), 0.5, default, set(flying_state,'in'); copy(zorder,backup_zorder); );
);
</action>
Display More
gives me the same problem....