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));"

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM