123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283 |
- <krpano>
- <!-- 1.20. 新热点模式 -->
- <action name="addJQHotspot">
- showlog();
- set(hsp_name,%1);
- set(hsp_type,%2);
- txtadd(iconUrl,'',%4);
- txtreplace(iconUrl,'|',',');
- if(%2 LE 1,
- <!-- trace('id==',get(hsp_name),"::",get(iconUrl)); -->
- set(hotspot[get(hsp_name)].type,'image');
- set(hotspot[get(hsp_name)].url,get(iconUrl));
- );
- ifnot(%2 LE 1, set(hotspot[get(hsp_name)].type, 'text'));
- <!-- 其他标签 (0,1,2)-->
- if(%2 LT 2,
- set(hotspot[get(hsp_name)].height,%8);
- set(hotspot[get(hsp_name)].width,'prop');
- txtadd(hotspot[get(hsp_name)].onloaded,"add_tooltip_label();");
- );
-
- set(hotspot[get(hsp_name)].name,%1);
- set(hotspot[get(hsp_name)].hotspottype,%2);
- set(hotspot[get(hsp_name)].hotspottitle,%3);
- set(hotspot[get(hsp_name)].hotspotStyle,%10);
- set(hotspot[get(hsp_name)].ath,%5);
- set(hotspot[get(hsp_name)].atv,%6);
-
- set(hotspot[get(hsp_name)].visible,true);
- set(hotspot[get(hsp_name)].alpha,1);
- set(hotspot[get(hsp_name)].scale,1);
- set(hotspot[get(hsp_name)].autoalpha,false);
- set(hotspot[get(hsp_name)].distorted,false);
- set(hotspot[get(hsp_name)].ondown,dragJQhotspot(););
- set(hotspot[get(hsp_name)].onup,js(__krfn.angle.updateHotSpotData(get(xml.scene),get(name),get(ath),get(atv))));
- txtsplit(%10,'|',fontSize,pos,isHover,borderColor,fillColor,textColor,isShowLine,isTextWrap,lineDirection,textDirection,textNumPerLine,duration,frameNumber);
-
-
- <!-- 个性化标签(3) -->
- if(%2 == 3,
- set(hotspot[get(hsp_name)].height,80);
- set(hotspot[get(hsp_name)].width,1);
- set(hotspot[get(hsp_name)].padding,0);
- set(hotspot[get(hsp_name)].background,false);
- txtadd(line,'<div style="background-color: ',get(borderColor),';width:1px;height:80px;"></div>');
- trace('tags::',tagStyle);
- copy(hotspot[get(hsp_name)].html,line);
- txtadd(hotspot[get(hsp_name)].onloaded,"add_tooltip_label();add_tooltip_dot();");
- if(
- lineDirection == 'right-top',
- set(hotspot[get(hsp_name)].rotate,35);
- );
- if(
- lineDirection == 'right-center',
- set(hotspot[get(hsp_name)].rotate,90);
- );
- if(
- lineDirection == 'right-bottom',
- set(hotspot[get(hsp_name)].rotate,-35);
- );
- if(
- lineDirection == 'left-top',
- set(hotspot[get(hsp_name)].rotate,-35);
- );
- if(
- lineDirection == 'left-center',
- set(hotspot[get(hsp_name)].rotate,90);
- );
- if(
- lineDirection == 'left-bottom',
- set(hotspot[get(hsp_name)].rotate,35);
- );
- );
- addhotspot(get(hsp_name));
- </action>
- <action name="add_tooltip_label">
- txtadd(tooltipname, 'tooltip_', get(name));
- txtsplit(hotspotStyle,'|',fontSize,pos,isHover,borderColor,fillColor,textColor,isShowLine,isTextWrap,lineDirection,textDirection,textNumPerLine,duration,frameNumber);
- addlayer(get(tooltipname));
- set(labelParent,get(name));
- txtadd(layer[get(tooltipname)].parent, 'hotspot[', get(name), ']');
- set(layer[get(tooltipname)].autowidth, true);
- set(layer[get(tooltipname)].width,'prop');
- set(layer[get(tooltipname)].height,30);
- set(layer[get(tooltipname)].edge,center);
- set(layer[get(tooltipname)].background,false);
- set(layer[get(tooltipname)].x,0);
- set(layer[get(tooltipname)].y,-45);
- set(layer[get(tooltipname)].padding,0);
- set(layer[get(tooltipname)].type,'html');
- set(layer[get(tooltipname)].url,'%SWFPATH%/plugins/textfield.swf');
- set(layer[get(tooltipname)].border,false);
- set(layer[get(tooltipname)].align,center);
- set(layer[get(tooltipname)].ondown,'dragJQlayer();');
- set(layer[get(tooltipname)].onup,js(__krfn.angle.updateHotSpotData(get(xml.scene),get(hsName),get(vath),get(vatv))));
- <!-- set(hotspot[get(hsp_name)].onup,js(__krfn.angle.updateHotSpotData(get(xml.scene),get(name),get(ath),get(atv)))); -->
- txtadd(labelCode, '<div style="display: flex; align-items: center; justify-content: center; position: relative; border: 0px solid rgba(255,255,255,1); padding: 6px 10px; white-space: pre; border-radius: 5px; background: rgba(0,0,0,0.5);">','<div style="text-align: left; font-size:',get(fontSize),'px; color: rgba(255,255,255,1); line-height: 1.4;">',get(hotspottitle),'</div>
- </div>');
- <!-- 个性化标签(3) -->
- if(get(hotspottype) == 3,
- trace('lineDirection2::',lineDirection);
- txtadd(labelCode, '<div style="display: flex; align-items: center; justify-content: center; position: relative; border: 1px solid ',get(borderColor),'; padding: 6px 10px; white-space: pre; border-radius: 5px; background: ',get(fillColor),'">','<div style="text-align: left; font-size:',get(fontSize),'px; color: ',get(textColor),'; line-height: 1.4;">',get(hotspottitle),'</div></div>');
- if(
- lineDirection == 'right-top',
- set(layer[get(tooltipname)].y,-60);
- set(layer[get(tooltipname)].rotate,-35);
- );
- if(
- lineDirection == 'right-center',
- set(layer[get(tooltipname)].x,0);
- set(layer[get(tooltipname)].y,-80);
- set(layer[get(tooltipname)].rotate,-90);
- );
- if(
- lineDirection == 'right-bottom',
- set(layer[get(tooltipname)].y,60);
- set(layer[get(tooltipname)].rotate,35);
- );
- if(
- lineDirection == 'center-top',
- set(layer[get(tooltipname)].y,-55);
- );
- if(
- lineDirection == 'center-bottom',
- set(layer[get(tooltipname)].y,55);
- );
- if(
- lineDirection == 'left-top',
- set(layer[get(tooltipname)].y,-60);
- set(layer[get(tooltipname)].rotate,35);
- );
- if(
- lineDirection == 'left-center',
- set(layer[get(tooltipname)].x,0);
- set(layer[get(tooltipname)].y,80);
- set(layer[get(tooltipname)].rotate,-90);
- );
- if(
- lineDirection == 'left-bottom',
- set(layer[get(tooltipname)].x,0);
- set(layer[get(tooltipname)].y,60);
- set(layer[get(tooltipname)].rotate,-35);
- );
- );
-
- copy(layer[get(tooltipname)].html, labelCode);
-
- </action>
- <!-- <style name="tooltip_dot_bg" type="container" border-radius="50%" bgcolor="0xFFFFFF" bgalpha="0.9" height="20" width="20" keep="true" /> -->
- <action name='add_tooltip_dot'>
- txtadd(tooldot, 'tooldot_', get(name));
- trace('hey::',get(borderColor));
- addlayer(get(tooldot));
- txtadd(layer[get(tooldot)].parent, 'hotspot[', get(name), ']');
- set(layer[get(tooldot)].width,10);
- set(layer[get(tooldot)].height,10);
- set(layer[get(tooldot)].padding,0);
-
- set(layer[get(tooldot)].align,center);
- set(layer[get(tooldot)].type,'text');
- set(layer[get(tooldot)].background,false);
- txtadd(dborderColor,'rgba(255,255,255,0.5)');
- txtadd(line,'<div style="background-color: ',get(borderColor),';width:10px;height:10px;"></div>');
- copy(layer[get(tooldot)].html,line);
- set(layer[get(tooldot)].backgroundcolor,get(borderColor));
- set(layer[get(tooldot)].backgroundalpha,0.9);
- set(layer[get(tooldot)].bgroundedge,5);
- set(layer[get(tooldot)].ondown,'dragJQlayer();');
- set(layer[get(tooldotupdateHotSpotData )].onup,js(__krfn.angle.updateHotSpotData(get(xml.scene),get(hsName),get(vath),get(vatv))));
- <!-- 个性化标签(3) -->
- if(get(hotspottype) == 3,
- trace('lineDirection3::',lineDirection);
- if(
- lineDirection == 'right-top',
- set(layer[get(tooldot)].x,0);
- set(layer[get(tooldot)].y,40);
- );
- if(
- lineDirection == 'right-center',
- set(layer[get(tooldot)].x,0);
- set(layer[get(tooldot)].y,40);
- );
- if(
- lineDirection == 'right-bottom',
- set(layer[get(tooldot)].x,0);
- set(layer[get(tooldot)].y,-40);
- );
- if(
- lineDirection == 'center-top',
- set(layer[get(tooldot)].x,0);
- set(layer[get(tooldot)].y,40);
- );
- if(
- lineDirection == 'center-bottom',
- set(layer[get(tooldot)].x,0);
- set(layer[get(tooldot)].y,-40);
- );
- if(
- lineDirection == 'left-top',
- set(layer[get(tooldot)].x,0);
- set(layer[get(tooldot)].y,40);
- );
- if(
- lineDirection == 'left-center',
- set(layer[get(tooldot)].x,0);
- set(layer[get(tooldot)].y,-40);
- );
- if(
- lineDirection == 'left-bottom',
- set(layer[get(tooldot)].x,0);
- set(layer[get(tooldot)].y,-40);
- );
- );
- </action>
- <action name="editJQHotspot">
- showlog();
- set(hsp_name,%1);
- set(hsp_type,%2);
- trace('edit');
- </action>
- <action name="dragJQlayer">
- txtadd(hsName, '', get(name));
- txtreplace(hsName, 'tooltip_', '');
- txtreplace(hsName, 'tooldot_', '');
- <!-- trace('drag::',hsName); -->
- <!-- copy(drag_currentx, x);
- copy(drag_currenty, y);
- copy(drag_stagex, mouse.stagex);
- copy(drag_stagey, mouse.stagey);
- indexoftxt(align_contains_right, get(align), 'right');
- indexoftxt(align_contains_bottom, get(align), 'bottom');
- calc(drag_align_x, align_contains_right GE 0 ? -1 : +1);
- calc(drag_align_y, align_contains_bottom GE 0 ? -1 : +1);
- -->
-
- copy(hath, hotspot[get(hsName)].ath);
- copy(hatv, hotspot[get(hsName)].atv);
- spheretoscreen(hath, hatv, hotspotcenterx, hotspotcentery, 'l');
- sub(drag_adjustx,mouse.stagex, hotspotcenterx);
- sub(drag_adjusty,mouse.stagey, hotspotcentery);
-
- asyncloop(
- <!-- 计算热点中心点 -->
- pressed,
- sub(dx, mouse.stagex, drag_adjustx);
- sub(dy, mouse.stagey, drag_adjusty);
- screentosphere(dx, dy, vath, vatv);
- <!-- 更新 -->
- copy(hotspot[get(hsName)].ath, vath);
- copy(hotspot[get(hsName)].atv, vatv);
- );
- </action>
- <action name="dragJQhotspot">
- spheretoscreen(ath, atv, hotspotcenterx, hotspotcentery, 'l');
- sub(drag_adjustx,mouse.stagex, hotspotcenterx);
- sub(drag_adjusty,mouse.stagey, hotspotcentery);
-
- asyncloop(
- pressed,
- sub(dx, mouse.stagex, drag_adjustx);
- sub(dy, mouse.stagey, drag_adjusty);
- screentosphere(dx, dy, ath, atv);
- );
- </action>
- </krpano>
|