Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
![]() |
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<layer name="skin_btn_hide" style="skin_base|skin_glow" crop="0|448|64|64" align="right" x="50" y="0" scale="0.5" onclick="skin_hideskin(); hide_hotspots();" /> <layer name="skin_btn_show" type="container" bgcapture="true" align="bottom" width="100%" height="get:skin_settings.controlbar_height" y="calc:skin_settings.controlbar_height - skin_settings.controlbar_offset_closed" onclick="skin_showskin(); show_hotspots();" onhover="tween(alpha,1.0);" onout="tween(alpha,0.25);" ondown.touch="onhover();" onup.touch="onout();" visible="false" capture="false" alpha="0.0"> <layer name="skin_btn_show_icon" style="skin_base" crop="64|448|64|64" scale="0.5" align="bottom" y="2" enabled="false" /> </layer> <action name="hide_hotspots"> for(set(i,0), i LT hotspot.count, inc(i), set(hotspot[get(i)].visible,false); ); </action> <action name="show_hotspots"> for(set(i,0), i LT hotspot.count, inc(i), set(hotspot[get(i)].visible,true); ); </action> |
Try using shutdown alpha instead of visible
set(hotspot[get(i)].alpha ,0);
set(hotspot[get(i)].alpha ,1);
Here is an example code for showing hotspots
For local hotspots, disconnection must be done at the start of the scene, because changes to the hotspot are not saved if you exit the scene
You can change the hotspot while in an open scene, but if you exit and return to this scene, the hotspots will be set to the starting values, so you need to remember the state.
Make a flag for opening and closing hotspots and depending on the state of the flag when loading scenes, set the visibility of hotspots
<action name="startup" autorun="onstart">
set(show_hs, true);
Write on the button onclick="if(show_hs, set(show_hs,false); hide_hotspots();, set(show_hs,true); show_hotspots(); );"
in the scenes onstart="if(show_hs, set(show_hs,false); hide_hotspots();, set(show_hs,true); show_hotspots(); );"