«

krpano设置文字

emer 发布于 2017-9-19 22:25   4593 次阅读     


添加文字热点,调用方法:


<hotspot name="spot1" url="animatedhotspot_white.png" onloaded="do_crop_animation(64,64, 60);add_all_the_time_tooltip_for_VR()" ath="-15" atv="-12" onclick="loadscene(get(linkedscene))" text="自定义文字"/>


添加方法secene外


 <action name="add_all_the_time_tooltip_for_VR">

     txtadd(tooltipname, 'vrtooltip_', get(name));
     addhotspot(get(tooltipname)); 
     set(hotspot[get(tooltipname)].type,text);
     copy(hotspot[get(tooltipname)].edge,hotspot[get(name)].edge);
     copy(hotspot[get(tooltipname)].distorted,hotspot[get(name)].distorted);
     copy(hotspot[get(tooltipname)].ath,hotspot[get(name)].ath);
     copy(hotspot[get(tooltipname)].atv,hotspot[get(name)].atv);
     set(hotspot[get(tooltipname)].oy,-50);
     set(hotspot[get(tooltipname)].ox,0);
     set(hotspot[get(tooltipname)].vcenter,true);
         <!-- pr11版本不能将vcenter设置为true -->
     set(hotspot[get(tooltipname)].padding,10);
         set(hotspot[get(tooltipname)].mipmapping,true);
         set(hotspot[get(tooltipname)].oversampling,2);
     set(hotspot[get(tooltipname)].bg,true);
     set(hotspot[get(tooltipname)].bgcolor,0x000000);
     set(hotspot[get(tooltipname)].bgroundedge,5);
     set(hotspot[get(tooltipname)].bgalpha,0.65);
     set(hotspot[get(tooltipname)].bgborder,0);
     set(hotspot[get(tooltipname)].bgshadow,'0 0 0 0x000000 0');
     set(hotspot[get(tooltipname)].css,'text-align:left; color:#FFFFFF; font-family:MicrosoftYahei; font-size:24px;');
     if(device.mobile,set(hotspot[get(tooltipname)].css,'text-align:center; color:#FFFFFF; font-family:MicrosoftYahei; font-weight:bold; font-size:24px;');
     );
     set(hotspot[get(tooltipname)].txtshadow,'0 0 0 0x000000 0');

     if(text == '' OR text === null,

         copy(hotspot[get(tooltipname)].html,scene[get(linkedscene)].title),
         copy(hotspot[get(tooltipname)].html,text);

     ); 

     set(hotspot[get(tooltipname)].enabled,false); 

     if(lp_running == false,
        set(hotspot[get(tooltipname)].visible,true); 
        ,   
        if(!webvr.isenabled,
          if(lp_running == true,
            set(hotspot[get(tooltipname)].visible,false); 
            set(hotspot[get(tooltipname)].mark2,true);
           );
          );
        );

     if(hotspot[get(name)].normal == false, 

        set(hotspot[get(tooltipname)].normal,false);
        set(hotspot[get(tooltipname)].onloaded,
            if(webvr.isenabled,
                set(visible,false);
                ,   
                if(lp_running == false OR lp_running == null OR lp_running === null,  
                    set(visible,true);
                    );
                );
           );

        );
</action>
调用方法: