Toggle image hotspot Flat pano?

  • Hello All.


    Please could someone have a quick look at my code and link.
    And correct the code which is very almost correct.

    https://s3-eu-west-1.amazonaws.com/presentation.u…_test/tour.html


    In the example below i have created an image toggle in flat pano mode, However even when i add distorted="true" and zoom="true" to my code i cant get the distorted image to work?
    Im sure its a very simple solution but i have tried so many vairations for this?

    Man thanks

    Also you'll notice the black chairs are actually a png hoptspot loaded in postion on start. please could someone tell me how to add a very simple toggle on/off for the limage?


    Many thanks in advance


  • Hi Piotr.

    Many thanks for your quick support, im very excited as this is almost working.
    I have now updated the code as youve suggested however. the open close toggle button doesnt toggle the image.
    Im sure its a minor, please could you view the link and code and correct me?

    https://s3-eu-west-1.amazonaws.com/presentation.u…_test/tour.html

    Many thanks


    Code
    <action name="open"> set(plugin[%1].visible,true); tween(plugin[%1].alpha,1);
     </action> <action name="close">  tween(plugin[%1].alpha,0,0.5,default, set(plugin[%1].visible,false) );</action>  <hotspot name="openimage" url="chairs_green.png" ath="0.1" atv="0.1"
     scale="0.001"distorted="true"   alpha="0.4"zoom= "tue"onclick="action(close,get(name));" />  <hotspot name="fyi"  url="up.png" ath="0" atv="0" scale="0.001"distorted="true"   alpha="1"zoom= "tue" onover="tween(alpha,1);tween(scale,0.001);" onout="tween(alpha,1);tween(scale,0.001);" onclick="action(open,openimage);" />


    Many thanks again.

  • Many thanks for your quick support, im very excited as this is almost working.
    I have now updated the code as youve suggested however. the open close toggle button doesnt toggle the image.
    Im sure its a minor, please could you view the link and code and correct me?

    https://s3-eu-west-1.amazonaws.com/prese…_test/tour.html

    Many thanks


    I think the error is here:


    Code
    <action name="open">
    	set(plugin[%1].visible,true);
    	tween(plugin[%1].alpha,1); 
    </action> 
    
    
    <action name="close">
    	tween(plugin[%1].alpha,0,0.5,default, set(plugin[%1].visible,false) );
    </action>

    Replace 'plugin' to 'hotspot' and it should work.

    Like this:

    Code
    <action name="open">
    	set(hotspot[%1].visible,true);
    	tween(hotspot[%1].alpha,1); 
    </action> 
    
    
    <action name="close">
    	tween(hotspot[%1].alpha,0,0.5,default, set(hotspot[%1].visible,false) );
    </action>


    Piotr

    p.s. Or...

    Code
    <action name="switch_visible">	
        tween(hotspot[openimage].alpha, %1);
    </action>
    
    
    <hotspot name="openimage" url="chairs_green.png" ath="0.1" atv="0.1" scale="0.001" distorted="true" autoalpha="true" alpha="0.4" zoom="true" onclick="switch_visible(0);"/>
    
    
    <hotspot name="fyi" url="up.png" ath="0" atv="0" scale="0.001" distorted="true" alpha="1" zoom="tue" onover="tween(alpha,1);tween(scale,0.001);" onout="tween(alpha,1);tween(scale,0.001);" onclick="switch_visible(1);"/>


  • Many thanks Piotr.


    Please note that the toggle button only make the chairs visible? and doesn't set to 0 alpha (toggle off)


    I have attempted to update the code. by removing the tween code on the chair .png itself?

    As far as i can see by the code you provided, the toggle on off should work?

    I appreciate your support. and once i get this working will submit some amazing 3d work for the showscase *smile*

    Please could you offer a solution to correctly have the button toggle the furn on and off?

  • Please could you offer a solution to correctly have the button toggle the furn on and off?

    The switcher action is quite simple.


    Code
    <action name="btn_switcher">	
    if(hotspot[openimage].visible,		
      set(hotspot[openimage].visible, false);	
    ,		
      set(hotspot[openimage].visible, true);	
    );
    </action>


    run a 'btn_switcher();' action and that's all.

    Piotr

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!