standard tour hovering effect?

  • Hello,

    I'd like to add a hovering effect (alpha, scale) to the standard tour arrow hotspots.

    The original code is this one:

    Code
    <style name="skin_hotspotstyle" url="vtourskin_hotspot.png" scale="0.5" edge="top" oy="0" distorted="false"
    	   	tooltip=""
    	   	onclick="if(linkedscene, skin_hidetooltips(); tween(scale,0.25,0.5); tween(oy,-20,0.5); tween(alpha,0,0.5); looktohotspot(); loadscene(get(linkedscene),null,MERGE,BLEND(1)); skin_updatescroll(); );"
    	   	onloaded="if(skin_settings.tooltips_hotspots, if(linkedscene, copy(tooltip,scene[get(linkedscene)].title); loadstyle(skin_tooltips); ));"
    	   	/>

    And this is, what I tried to add, without effect:

    Code
    <style name="skin_hotspotstyle" url="vtourskin_hotspot.png" alpha="0.7" scale="0.5" edge="top" oy="0" distorted="false"
    	  		tooltip=""
    		    onover="tween(alpha,1);" 
    			onout="tween(alpha,0.7);" 	  		
    	  		onclick="if(linkedscene, skin_hidetooltips(); tween(scale,0.25,0.5); tween(oy,-20,0.5); tween(alpha,0,0.5); loadscene(get(linkedscene),null,MERGE,BLEND(1)); skin_updatescroll(); );"
    	 		 	onloaded="if(skin_settings.tooltips_hotspots, if(linkedscene, copy(tooltip,scene[get(linkedscene)].title); loadstyle(skin_tooltips); ));"
    	   	/>

    However, another hotspot for detailed text information is working quite nicely with this code:

    Code
    <style name="details-hs" tag="hs" distorted="false" 
    url="text.png" onover="tween(scale,1); tween(alpha,1);" 
    onout="tween(scale,0.8); tween(alpha,0.7);" alpha="0.7" scale="0.8" 
    zorder="1" />

    Strange enough, adding

    Code
    onhover="tween(alpha,1);" 
    		    onover="tween(alpha,1);" 
    			onout="tween(alpha,0.7);"

    is at least tweening the alpha to 1 as expected, but that does not help any further, because it doesn't tween back when leaving the hotspot.

    Why is this simple onver/onout working in the one example, but not in the other one??? Why is hover working but not onover/onout?

    Any help appreciated very much,

    Yours,
    Michael

  • Hi!

    This code works quite well for me:

    Code
    <style name="skin_hotspotstyle" url="vtourskin_hotspot.png" scale="0.5" alpha="0.7" edge="top" oy="0" distorted="false"
    	       tooltip=""
    		   onover="tween(alpha,1);" onout="tween(alpha,0.7);"
    	       onclick="if(linkedscene, skin_hidetooltips(); tween(scale,0.25,0.5); tween(oy,-20,0.5); tween(alpha,0,0.5); looktohotspot(); loadscene(get(linkedscene),null,get(skin_settings.loadscene_flags),get(skin_settings.loadscene_blend)); skin_updatescroll(); );"
    	       onloaded="if(skin_settings.tooltips_hotspots, if(linkedscene, copy(tooltip,scene[get(linkedscene)].title); loadstyle(skin_tooltips); ));"
    	       />

    Maybe there's some mistake elsewhere in your code?

  • Well, the code behaviour is this: when skin_settings.tooltips_hotspots is set to true, then hotspots onloaded check this and load a style called "skin_tooltips". So, if you want to keep alpha tweening together with tooltips, then you must adjust that style. But here be cautious because "skin_tooltips" with "tween(alpha,1)" and "tween(alpha,0.7) added to its onover/onout event will also tween your thumbs, if "skin_Settings.tooltips_thumbs" is set to true. So, my proposal is to check, if a hotpost with a given name exists (loaded or not) and if yes, tween it. (in this case thumbs must not be affected by tweening). Here's the modified code of "skin_tooltips" style:

    Code
    <style name="skin_tooltips"
    	       onover="if(hotspot[get(name)].loaded, tween(alpha,1));copy(layer[skin_tooltip].html, tooltip);
    	               set(layer[skin_tooltip].visible, true);
    	               tween(layer[skin_tooltip].alpha, 1.0, 0.1);
    	               asyncloop(hovering, copy(layer[skin_tooltip].x,mouse.stagex); copy(layer[skin_tooltip].y,mouse.stagey); );"
    	       onout="if(hotspot[get(name)].loaded, tween(alpha,0.7));tween(layer[skin_tooltip].alpha, 0.0, 0.1, default, set(layer[skin_tooltip].visible,false), copy(layer[skin_tooltip].x,mouse.stagex); copy(layer[skin_tooltip].y,mouse.stagey); );"
    	       />

    Hope I was clear in my explanation *smile*

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!