1. 程式人生 > >krpano之熱點樣式及文本

krpano之熱點樣式及文本

nload txt delayed pos ble tool plugin cli 只需要

修改熱點的樣式只需要將熱點引用的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));"

krpano之熱點樣式及文本