krpano之热点样式及文本

krpano之热点样式及文本

修改热点的样式只需要将热点引用的style样式替换即可。

动态样式代码:

    <style name="skin_hotspotstyle" url="zlqj_hotspot_2.png" crop="0|0|128|112"  framewidth="128"        frameheight="112" frame="0" lastframe="4" scale="0.5" oy="50"
           onclick="if(linkedscene, 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(); );"
           onhover="if(skin_settings.tooltips_hotspots, if(linkedscene, showtext(get(scene[get(linkedscene)].title),SKIN_TOOLTIPS)) );"
           onloaded="hotspot_animate();if(distorted,add_tooltip2(get(linkedscene),1),add_all_the_time_tooltip(get(linkedscene),1));"/>

    <action name="hotspot_animate">
        inc(frame,1,get(lastframe),0);
        mul(ypos,frame,frameheight);
        txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
        delayedcall(0.3, if(loaded, hotspot_animate()) );
    </action>

图片:

  

文本添加:

首先添加文本样式。

<action name="add_all_the_time_tooltip">
        txtadd(tooltipname, 'tooltip_', get(name));
        addplugin(get(tooltipname));
        txtadd(plugin[get(tooltipname)].parent, 'hotspot[', get(name), ']');
        set(plugin[get(tooltipname)].url,'%SWFPATH%/plugins/textfield.swf');
        set(plugin[get(tooltipname)].align,bottom);
        set(plugin[get(tooltipname)].edge,bottom);
        set(plugin[get(tooltipname)].x,0);
        set(plugin[get(tooltipname)].y,-23);
        set(plugin[get(tooltipname)].width,130);
        set(plugin[get(tooltipname)].autoheight,true);
        set(plugin[get(tooltipname)].background,true);
        set(plugin[get(tooltipname)].backgroundcolor,0x000000);
        set(plugin[get(tooltipname)].roundedge,3);
        set(plugin[get(tooltipname)].backgroundalpha,0.0);
        set(plugin[get(tooltipname)].border,true);
        set(plugin[get(tooltipname)].glow,4);
        set(plugin[get(tooltipname)].glowcolor,0xF6B017);
        set(plugin[get(tooltipname)].css,'text-align:center; color:#ffffff; font-family:Arial; font-weight:bold; font-size:20px;');
        set(plugin[get(tooltipname)].textshadow,1);
        set(plugin[get(tooltipname)].textshadowrange,6.0);
        set(plugin[get(tooltipname)].textshadowangle,90);
        copy(plugin[get(tooltipname)].html,scene[get(linkedscene)].title);
        set(plugin[get(tooltipname)].enabled,false);
    </action>

然后在热点样式的 onloaded 属性中加载。

 onloaded="hotspot_animate();if(distorted,add_tooltip2(get(linkedscene),1),add_all_the_time_tooltip(get(linkedscene),1));"
原文地址:https://www.cnblogs.com/s313139232/p/7384141.html