123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- <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();");
- );
- <!-- 个性化标签(3) -->
- ifnot(%2 LT 2,
- trace('tags::',%3);
- set(hotspot[get(hsp_name)].height,80);
- set(hotspot[get(hsp_name)].width,1);
- txtadd(hotspot[get(hsp_name)].onloaded,"add_tooltip_label();add_tooltip_dot();");
- set(hotspot[get(hsp_name)].rotate,35);
- );
- 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);
- <!-- layer -->
-
-
- addhotspot(get(hsp_name));
- set(hotspot[get(hsp_name)].ondown,dragJQhotspot(););
- </action>
- <action name="editJQHotspot">
- showlog();
- set(hsp_name,%1);
- set(hsp_type,%2);
- trace('edit');
- </action>
- <action name="addImgTextHotSpot1">
- set(schp_name,%1);
- set(hotspot[get(schp_name)].type,'text');
- set(hotspot[get(schp_name)].ath,%4);
- set(hotspot[get(schp_name)].atv,%5);
- set(hotspot[get(schp_name)].hotspottitle,%3);
- set(hotspot[get(schp_name)].wordcontent,%9);
- set(hotspot[get(schp_name)].hotspotlink,%8);
- set(hotspot[get(schp_name)].alpha,1);
- set(hotspot[get(schp_name)].scale,1);
- set(hotspot[get(schp_name)].autoalpha,false);
- set(hotspot[get(schp_name)].distorted,false);
- <!-- set(hotspot[get(schp_name)].width,'prop');
- set(hotspot[get(schp_name)].height,%11); -->
- set(hotspot[get(schp_name)].width, 1);
- set(hotspot[get(schp_name)].height,70);
- set(hotspot[get(schp_name)].visible,true);
- <!-- set(hotspot[get(schp_name)].onhover,showtext(get(hotspottitle),skintext)); -->
- addhotspot(get(schp_name));
- set(hotspot[get(schp_name)].onclick,'js(__krfn.utils.linkopen(%8,%2));');
-
- if(%7 == false,
- ,
- set(hotspot[get(schp_name)].ondown,draghotspot1(););
- <!-- set(hotspot[get(schp_name)].onup,js(__krfn.angle.updateHotSpotData(get(xml.scene),get(name),get(ath),get(atv),"imgtext"))); -->
- );
- <!-- txtadd(hotspot[get(schp_name)].onloaded,"add_all_the_time_tooltip(hotspot[get(name)].hotspottitle);"); -->
- <!-- txtadd(hotspot[get(schp_name)].onloaded,"add_all_2_tooltip(hotspot[get(name)].hotspottitle);"); -->
- <!-- txtadd(hotspot[get(schp_name)].onloaded,"add_all_2_tooltip(hotspot[get(name)].hotspottitle);"); -->
- txtadd(hotspot[get(schp_name)].onloaded,"add_all_2_tooltip();");
- <!-- txtadd(hotspot[get(schp_name)].onloaded,"add_all_2_tooltip(hotspot[get(name)].hotspottitle,hotspot[get(name)].ath,hotspot[get(name)].atv);"); -->
-
- set(hotspot[get(schp_name)].onhover,null);
- set(hotspot[get(schp_name)].onout,null);
- set(hotspot[get(schp_name)].onover,null);
-
- <!-- if(%10 == true,
- set(plugin[get(tooltipname)].visible,true);,
- set(plugin[get(tooltipname)].visible,false);
- ); -->
- <!-- txtadd(csstxt, 'text-align:center; color:#FFFFFF; font-family:STXihei; font-size:', %12,'px');
- set(plugin[get(tooltipname)].css,get(csstxt)));, -->
- </action>
- <action name="add_tooltip_label">
- txtadd(tooltipname2, 'tooltip2_', get(name));
- <!-- fontSize: 12,
- position: "top",
- isHover: false,
- borderColor: "",
- isShowLine: "",
- isTextWrap: "",
- lineDirection: "",
- textColor: "",
- textDirection: "",
- textNumPerLine: "",
- duration: 0,
- frameNumber: 0, -->
- txtsplit(hotspotStyle,'|',fontSize,pos,isHover,borderColor,isShowLine,isTextWrap,lineDirection,textColor,textDirection,textNumPerLine,duration,frameNumber);
- trace('hotspotStyle::',lineDirection);
- addlayer(get(tooltipname2));
- txtadd(layer[get(tooltipname2)].parent, 'hotspot[', get(name), ']');
- set(layer[get(tooltipname2)].autowidth, true);
- set(layer[get(tooltipname2)].width,'prop');
- set(layer[get(tooltipname2)].height,30);
- set(layer[get(tooltipname2)].edge,center);
- set(layer[get(tooltipname2)].background,false);
- set(layer[get(tooltipname2)].x,0);
- set(layer[get(tooltipname2)].y,-45);
- set(layer[get(tooltipname2)].padding,0);
- set(layer[get(tooltipname2)].type,'html');
- set(layer[get(tooltipname2)].url,'%SWFPATH%/plugins/textfield.swf');
- set(layer[get(tooltipname2)].border,false);
- set(layer[get(tooltipname2)].align,center);
- set(layer[get(tooltipname2)].ondown,'dragJQlayer();');
-
- ifnot(get(hotspottype) LT 2,
- set(layer[get(tooltipname2)].y,-60);
- set(layer[get(tooltipname2)].rotate,-35);
- );
- 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>');
- copy(layer[get(tooltipname2)].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(tooldot));
- 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)].x,0);
- set(layer[get(tooldot)].y,40);
- set(layer[get(tooldot)].align,center);
- set(layer[get(tooldot)].type,'text');
- set(layer[get(tooldot)].background,true);
- set(layer[get(tooldot)].backgroundcolor,0xFFFFFF);
- set(layer[get(tooldot)].backgroundalpha,0.9);
- set(layer[get(tooldot)].bgroundedge,5);
- set(layer[get(tooldot)].ondown,'dragJQlayer();');
- <!-- set(layer[get(tooldot)].html, '<div style="width:100%;height:100%;border-radius:50%;background:rgba(255,255,255,0.9);"></div>'); -->
-
- </action>
- <action name="dragJQlayer">
- txtadd(hsName, '', get(name));
- txtreplace(hsName, 'tooltip2_', '');
- 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>
|