customTooltip.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. <krpano>
  2. <!-- 1.20. 新热点模式 -->
  3. <action name="addJQHotspot">
  4. showlog();
  5. set(hsp_name,%1);
  6. set(hsp_type,%2);
  7. txtadd(iconUrl,'',%4);
  8. txtreplace(iconUrl,'|',',');
  9. <!-- trace('originName::',%1); -->
  10. if(%2 LE 1,
  11. <!-- trace('id==',get(hsp_name),"::",get(iconUrl)); -->
  12. set(hotspot[get(hsp_name)].type,'image');
  13. set(hotspot[get(hsp_name)].url,get(iconUrl));
  14. );
  15. ifnot(%2 LE 1, set(hotspot[get(hsp_name)].type, 'text'));
  16. <!-- 其他标签 (0,1,2)-->
  17. set(hotspot[get(hsp_name)].name,%1);
  18. set(hotspot[get(hsp_name)].hotspottype,%2);
  19. set(hotspot[get(hsp_name)].hotspottitle,%3);
  20. set(hotspot[get(hsp_name)].hotspotStyle,%10);
  21. set(hotspot[get(hsp_name)].hotlink,%7);
  22. set(hotspot[get(hsp_name)].ath,%5);
  23. set(hotspot[get(hsp_name)].atv,%6);
  24. set(hotspot[get(hsp_name)].visible,true);
  25. set(hotspot[get(hsp_name)].alpha,1);
  26. set(hotspot[get(hsp_name)].scale,1);
  27. set(hotspot[get(hsp_name)].autoalpha,false);
  28. set(hotspot[get(hsp_name)].distorted,false);
  29. set(hotspot[get(hsp_name)].border,false);
  30. set(hotspot[get(hsp_name)].onclick,'js(__krfn.utils.linkopen(%7,%1));');
  31. set(hotspot[get(hsp_name)].ondown,dragJQhotspot(););
  32. set(hotspot[get(hsp_name)].onup,js(__krfn.angle.updateHotSpotData(get(xml.scene),get(name),get(ath),get(atv))));
  33. txtsplit(%10,'|',fontSize,pos,isHover,borderColor,fillColor,textColor,isShowLine,isTextWrap,lineDirection,textDirection,textNumPerLine,duration,frameNumber,framewidth);
  34. set(hotspot[get(hsp_name)].pos,pos);
  35. txtadd(hotspot[get(hsp_name)].onloaded,"add_tooltip_label();add_tooltip_dot();");
  36. if(%2 LE 2,
  37. set(hotspot[get(hsp_name)].height,%8);
  38. set(hotspot[get(hsp_name)].width,%8);
  39. <!-- txtadd(hotspot[get(hsp_name)].onloaded,"add_tooltip_label(get(%1));"); -->
  40. if(%2 == 2,
  41. trace('ser_frame::',get(framewidth));
  42. set(hotspot[get(hsp_name)].url,get(iconUrl));
  43. set(hotspot[get(hsp_name)].framewidth,get(framewidth));
  44. set(hotspot[get(hsp_name)].frames,get(frameNumber));
  45. crop_animation_r_stop(get(hsp_name));
  46. txtadd(hotspot[get(hsp_name)].onloaded,"trace('ser_frame1::',get(frameNumber));do_crop_animation(get(framewidth),get(framewidth),get(frameNumber));"););
  47. );
  48. <!-- 个性化标签(3) -->
  49. if(%2 == 3,
  50. set(hotspot[get(hsp_name)].height,80);
  51. set(hotspot[get(hsp_name)].width,1);
  52. set(hotspot[get(hsp_name)].padding,0);
  53. set(hotspot[get(hsp_name)].background,false);
  54. txtadd(line,'<div style="background-color: ',get(borderColor),';width:1px;height:80px;"></div>');
  55. copy(hotspot[get(hsp_name)].html,line);
  56. <!-- txtadd(hotspot[get(hsp_name)].onloaded,"add_tooltip_label();add_tooltip_dot();"); -->
  57. set_label_dir(get(hsp_name),get(lineDirection),0);
  58. );
  59. addhotspot(get(hsp_name));
  60. </action>
  61. <action name="do_crop_animation">
  62. registerattribute(xframes, calc((imagewidth / %1) BOR 0));
  63. registerattribute(yframes, calc((imageheight / %2) BOR 0));
  64. registerattribute(frames, calc(xframes * yframes));
  65. registerattribute(frame, 0);
  66. registerattribute(animatiedOn, 1);
  67. registerattribute(frameRate, calc(1.0 / %3));
  68. set(crop, '0|0|%1|%2');
  69. clearinterval(calc('crop_anim_' + name));
  70. if(frameRate GE 0,
  71. setinterval(
  72. calc('crop_anim_' + name),
  73. get(frameRate),
  74. if(loaded,
  75. inc(frame);
  76. if(frame GE frames, if(onlastframe !== null, onlastframe() ); set(frame,0); );
  77. mod(xpos,frame, xframes);
  78. div(ypos, frame, xframes);
  79. trace('onging::',get(frames));
  80. Math.floor(ypos);
  81. mul(xpos, %1);
  82. mul(ypos, %2);
  83. calc(crop, xpos +'|' + ypos + '|%1|%2');
  84. if(animatiedOn == 0,
  85. clearinterval(calc('crop_anim_' + name));
  86. );
  87. if(frames == -1,
  88. set(crop, '0|0|204|204');
  89. );,
  90. clearinterval(calc('crop_anim_' + name));
  91. );
  92. );
  93. );
  94. </action>
  95. <action name="crop_animation_r_stop">
  96. set(cur,%1);
  97. tolower(cur, cur);
  98. set(curIn, calc('crop_anim_r_' + cur));
  99. clearinterval(curIn);
  100. </action>
  101. <action name="crop_animation_reapply">
  102. set(cur,%1);
  103. tolower(cur, cur);
  104. txtadd(frameRate,'',%2);
  105. copy(frames, hotspot[get(cur)].frames);
  106. copy(xframes, hotspot[get(cur)].xframes);
  107. copy(yframes, hotspot[get(cur)].yframes);
  108. set(frame,0);
  109. set(curIn, calc('crop_anim_r_' + cur));
  110. clearinterval(curIn);
  111. if(get(frameRate) GE 0,
  112. setinterval(curIn,
  113. get(frameRate),
  114. inc(frame);
  115. copy(on, hotspot[get(cur)].on);
  116. copy(framewidth, hotspot[get(cur)].framewidth);
  117. <!-- trace('replay-crop::',get(frames)); -->
  118. if(frame GE frames, set(frame,0); );
  119. mod(xpos,frame, xframes);
  120. div(ypos, frame, xframes);
  121. Math.floor(ypos);
  122. mul(xpos, framewidth);
  123. mul(ypos,framewidth);
  124. if(animatiedOn == 0, clearinterval(curIn););
  125. calc(crop, xpos +'|' + ypos + '|'+framewidth +'|' + framewidth);
  126. copy(hotspot[get(hsp_name)].crop,crop);
  127. );
  128. );
  129. </action>
  130. <action name="add_tooltip_label">
  131. txtadd(tooltipname, 'tooltip_', get(name));
  132. txtsplit(hotspotStyle,'|',fontSize,pos,isHover,borderColor,fillColor,textColor,isShowLine,isTextWrap,lineDirection,textDirection,textNumPerLine,duration,frameNumber);
  133. txtadd(pName, get(name));
  134. addlayer(get(tooltipname));
  135. txtadd(layer[get(tooltipname)].parent, 'hotspot[', get(name), ']');
  136. set(layer[get(tooltipname)].autowidth, true);
  137. set(layer[get(tooltipname)].width,'prop');
  138. <!-- set(layer[get(tooltipname)].height,30); -->
  139. set(layer[get(tooltipname)].height,30);
  140. set(layer[get(tooltipname)].edge,center);
  141. set(layer[get(tooltipname)].background,false);
  142. set(layer[get(tooltipname)].pos,pos);
  143. set(layer[get(tooltipname)].padding,0);
  144. set(layer[get(tooltipname)].type,'html');
  145. set(layer[get(tooltipname)].url,'%SWFPATH%/plugins/textfield.swf');
  146. set(layer[get(tooltipname)].border,false);
  147. set(layer[get(tooltipname)].align,center);
  148. copy(layer[get(tooltipname)].hotlink, hotspot[get(name)].hotlink);
  149. set(layer[get(tooltipname)].ondown,'dragJQlayer();');
  150. set(layer[get(tooltipname)].onclick,JQlayerClick);
  151. set(layer[get(tooltipname)].onup,js(__krfn.angle.updateHotSpotData(get(xml.scene),get(hsName),get(ath),get(atv))));
  152. <!-- set(hotspot[get(hsp_name)].onup,js(__krfn.angle.updateHotSpotData(get(xml.scene),get(name),get(ath),get(atv)))); -->
  153. 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>
  154. </div>');
  155. <!-- label方位 -->
  156. if(get(hotspottype) LE 2,
  157. <!-- trace('hotspottype::',get(hotspottype),'::tooltipname::',get(tooltipname),'pos::',get(pos)); -->
  158. <!-- set_label_pos(get(tooltipname),get(pos)); -->
  159. delayedcall(0.1,
  160. txtadd(tooltipname, 'tooltip_', get(name));
  161. set_label_pos(get(tooltipname),get(pos));
  162. );
  163. );
  164. <!-- 个性化标签(3) -->
  165. if(get(hotspottype) == 3,
  166. set(layer[get(tooltipname)].direction,get(lineDirection));
  167. delayedcall(0.2,txtadd(tooltipname, 'tooltip_', get(name)); set_label_dir(get(tooltipname),get(layer[get(tooltipname)].direction),1); );
  168. );
  169. copy(layer[get(tooltipname)].html, labelCode);
  170. </action>
  171. <!-- <style name="tooltip_dot_bg" type="container" border-radius="50%" bgcolor="0xFFFFFF" bgalpha="0.9" height="20" width="20" keep="true" /> -->
  172. <action name='add_tooltip_dot'>
  173. txtadd(tooldot, 'tooldot_', get(name));
  174. <!-- trace('hey::',get(borderColor)); -->
  175. addlayer(get(tooldot));
  176. txtadd(layer[get(tooldot)].parent, 'hotspot[', get(name), ']');
  177. set(layer[get(tooldot)].width,10);
  178. set(layer[get(tooldot)].height,10);
  179. set(layer[get(tooldot)].padding,0);
  180. set(layer[get(tooldot)].align,center);
  181. set(layer[get(tooldot)].type,'text');
  182. set(layer[get(tooldot)].background,false);
  183. txtadd(dborderColor,'rgba(255,255,255,0.5)');
  184. txtadd(dot,'<div style="background-color: ',get(borderColor),';width:10px;height:10px;"></div>');
  185. copy(layer[get(tooldot)].html,dot);
  186. set(layer[get(tooldot)].backgroundcolor,get(borderColor));
  187. set(layer[get(tooldot)].backgroundalpha,0.9);
  188. set(layer[get(tooldot)].bgroundedge,5);
  189. set(layer[get(tooldot)].onclick,JQlayerClick);
  190. set(layer[get(tooldot)].ondown,'dragJQlayer();');
  191. set(layer[get(tooldot)].visible,false);
  192. set(layer[get(tooldot)].onup,js(__krfn.angle.updateHotSpotData(get(xml.scene),get(hsName),get(ath),get(atv))));
  193. <!-- 个性化标签(3) -->
  194. if(get(hotspottype) == 3,
  195. <!-- trace('lineDirection3::',lineDirection); -->
  196. <!-- call(set_label_dir); -->
  197. set(layer[get(tooldot)].visible,true);
  198. set_label_dir(get(tooldot),get(lineDirection),2);
  199. );
  200. </action>
  201. <action name='set_label_dir'>
  202. txtadd(dirItem,'',%1);
  203. txtadd(lineDirection,'',%2);
  204. txtadd(dir,'',%3);
  205. <!-- trace('get-lineDirection::',%2); -->
  206. <!-- trace('set_label_dir::1::',get(dirItem),'::2::',get(lineDirection),'::3::',get(dir)); -->
  207. if(
  208. get(dir)==1,
  209. <!-- trace('set_label_dir::1::',get(dirItem),'::2::',get(lineDirection),'::3::',get(dir)); -->
  210. copy(labelWidth,layer[get(dirItem)].width);
  211. <!-- trace('dirItem::',get(layer[get(dirItem)].width)); -->
  212. );
  213. if(
  214. get(lineDirection) == 'right-top',
  215. if(get(dir)==0,set(hotspot[get(dirItem)].rotate,35));
  216. if(get(dir)==1,set(layer[get(dirItem)].rotate,-35);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-60););
  217. if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,40););
  218. );
  219. if(
  220. get(lineDirection) == 'right-center',
  221. if(get(dir)==0,set(hotspot[get(dirItem)].rotate,90));
  222. <!-- if(get(dir)==1,set(layer[get(dirItem)].rotate,-90);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-80)); -->
  223. if(get(dir)==1,
  224. set(layer[get(dirItem)].rotate,-90);
  225. set(layer[get(dirItem)].x,0);
  226. sub(labelWidth,25);
  227. mul(labelWidth,-1);
  228. set(layer[get(dirItem)].y,get(labelWidth));
  229. );
  230. if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,40););
  231. );
  232. if(
  233. get(lineDirection) == 'right-bottom',
  234. if(get(dir)==0,set(hotspot[get(dirItem)].rotate,-35));
  235. if(get(dir)==1,set(layer[get(dirItem)].rotate,35);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,60));
  236. if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-40););
  237. );
  238. if(
  239. get(lineDirection) == 'center-top',
  240. if(get(dir)==0,set(hotspot[get(dirItem)].rotate,0));
  241. if(get(dir)==1,set(layer[get(dirItem)].rotate,0);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-60));
  242. if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,40););
  243. );
  244. if(get(lineDirection) == 'center-bottom',
  245. if(get(dir)==0,set(hotspot[get(dirItem)].rotate,0));
  246. if(get(dir)==1,set(layer[get(dirItem)].rotate,0);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,55));
  247. if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-40););
  248. );
  249. if( get(lineDirection) == 'left-top',
  250. if(get(dir)==0,set(hotspot[get(dirItem)].rotate,-35));
  251. ; if(get(dir)==1,set(layer[get(dirItem)].rotate,35);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-60));
  252. if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,40););
  253. );
  254. if(
  255. get(lineDirection) == 'left-center',
  256. if(get(dir)==0,set(hotspot[get(dirItem)].rotate,90));
  257. if(get(dir)==1,
  258. set(layer[get(dirItem)].rotate,-90);
  259. set(layer[get(dirItem)].x,0);
  260. sub(labelWidth,25);
  261. set(layer[get(dirItem)].y,get(labelWidth));
  262. );
  263. if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-40););
  264. );
  265. if(
  266. get(lineDirection) == 'left-bottom',
  267. if(get(dir)==0,set(hotspot[get(dirItem)].rotate,35));
  268. if(get(dir)==1,set(layer[get(dirItem)].rotate,-35);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,60));
  269. if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-40););
  270. );
  271. </action>
  272. <action name='set_label_pos'>
  273. <!-- label方位 -->
  274. set(posName,%1);
  275. set(pos,%2);
  276. copy(hp,posName);
  277. txtreplace(hp,'tooltip_','');
  278. copy(hwidth, hotspot[get(hp)].width);
  279. copy(hheight, hotspot[get(hp)].height);
  280. copy(lwidth, layer[get(posName)].width);
  281. copy(lheight, layer[get(posName)].height);
  282. if(
  283. pos == 'top',
  284. add(all,lheight,hheight);
  285. div(dpy,all,2);
  286. add(lastPy,dpy,10);
  287. mul(lastPy, -1);
  288. set(layer[get(posName)].align,center);
  289. set(layer[get(posName)].y,get(lastPy));
  290. set(layer[get(posName)].x,0);
  291. );
  292. if(
  293. pos == 'bottom',
  294. add(all,lheight,hheight);
  295. div(dpy,all,2);
  296. add(lastPy,dpy,10);
  297. mul(lastPy, 1);
  298. set(layer[get(posName)].align,center);
  299. set(layer[get(posName)].y,get(lastPy));
  300. set(layer[get(posName)].x,0);
  301. );
  302. if(
  303. pos == 'left',
  304. add(all,lwidth,hwidth);
  305. div(dpx,all,2);
  306. add(lastPx,dpx,10);
  307. mul(lastPx, -1);
  308. set(layer[get(posName)].align,center);
  309. set(layer[get(posName)].x,get(lastPx));
  310. set(layer[get(posName)].y,0);
  311. );
  312. if(
  313. pos == 'right',
  314. add(all,lwidth,hwidth);
  315. div(dpx,all,2);
  316. add(lastPx,dpx,10);
  317. mul(lastPx, 1);
  318. set(layer[get(posName)].align,center);
  319. set(layer[get(posName)].x,get(lastPx));
  320. set(layer[get(posName)].y,0);
  321. );
  322. </action>
  323. <action name="removeJQHotspot">
  324. set(delHotspot,%1);
  325. removehotspot(%1,true);
  326. txtadd(delHotspotLabel,'tooltip_',get(delHotspot));
  327. txtadd(delHotspotdot,'tooldot_',get(delHotspot));
  328. removelayer(get(delHotspotLabel));
  329. removelayer(get(delHotspotdot));
  330. </action>
  331. <!-- 编辑热点 -->
  332. <action name="editJQHotspot">
  333. showlog();
  334. set(hsp_name,%1);
  335. set(hsp_type,%2);
  336. set(dImage,'static/panoassets/images/hotspot/image_place_holder.png');
  337. txtadd(hsLabel, 'tooltip_', %1);
  338. txtadd(hsDot, 'tooldot_', %1);
  339. set(hotspot[get(hsp_name)].hotspottitle,%3);
  340. set(hotspot[get(hsp_name)].hotspotStyle,%10);
  341. copy(hotspot[get(hsp_name)].borderWidth,false);
  342. copy(layer[get(hsLabel)].borderWidth,false);
  343. copy(layer[get(hsDot)].borderWidth,false);
  344. set(hotspot[get(hsp_name)].background,false);
  345. txtsplit(%10,'|',fontSize,pos,isHover,borderColor,fillColor,textColor,isShowLine,isTextWrap,lineDirection,textDirection,textNumPerLine,duration,frameNumber,framewidth);
  346. 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;">',%3,'</div>
  347. </div>');
  348. copy(layer[get(hsLabel)].html, labelCode);
  349. copy(layer[get(hsLabel)].pos, pos);
  350. trace('editJQHotspot',%1,'::type::',%3);
  351. if(%3 == '', set(layer[get(hsLabel)].height,12););
  352. ifnot(%3 == '', set(layer[get(hsLabel)].height,30););
  353. if(get(hsp_type) == 3,
  354. trace('edit3::',get(borderColor));
  355. set(hotspot[get(hsp_name)].rotate,0);
  356. set(layer[get(hsLabel)].rotate,0);
  357. set(hotspot[get(hsp_name)].type,'text');
  358. set(hotspot[get(hsp_name)].width,1);
  359. set(hotspot[get(hsp_name)].height,80);
  360. set(hotspot[get(hsp_name)].padding,0);
  361. txtadd(line,'<div style="background-color: ',get(borderColor),';width:1px;height:80px;"></div>');
  362. txtadd(dot,'<div style="background-color: ',get(borderColor),';width:10px;height:10px;"></div>');
  363. copy(hotspot[get(hsp_name)].html,line);
  364. copy(layer[get(hsDot)].html,dot);
  365. set(layer[get(hsDot)].visible,true);
  366. <!-- txtadd(hotspot[get(hsp_name)].onloaded,"add_tooltip_label();add_tooltip_dot();"); -->
  367. set_label_dir(get(hsp_name),get(lineDirection),0);
  368. set_label_dir(get(hsLabel),get(lineDirection),1);
  369. set_label_dir(get(hsDot),get(lineDirection),2);
  370. );
  371. if(get(hsp_type) LE 2,
  372. trace('edit2');
  373. txtadd(iconUrl,'',%4);
  374. txtreplace(iconUrl,'|',',');
  375. trace('iconUrl::',iconUrl);
  376. set(hotspot[get(hsp_name)].height,%8);
  377. set(hotspot[get(hsp_name)].width,%8);
  378. delayedcall(0.1,
  379. txtadd(tooltipname, 'tooltip_', get(hsp_name));
  380. set_label_pos(get(tooltipname),get(layer[get(tooltipname)].pos));
  381. );
  382. <!-- 序列化类型编辑 -->
  383. if(get(hsp_type) == 2,
  384. indexoftxt(index, get(iconUrl), 'image_place_holder.png');
  385. if(get(index) GT -1,set(hotspot[get(hsp_name)].animatiedOn,0); set(hotspot[get(hsp_name)].frames,-1););
  386. ifnot(get(index) GT -1,
  387. set(hotspot[get(hsp_name)].animatiedOn,0);
  388. set(hotspot[get(hsp_name)].frames,get(frameNumber));
  389. calc(frameRate, duration / frameNumber);
  390. set(hotspot[get(hsp_name)].frameRate,get(frameRate));
  391. trace('frameRate::',get(frameRate));
  392. trace('frameNumber::',get(frameNumber));
  393. trace('framewidth::',get(framewidth));
  394. trace('duration::',get(duration));
  395. crop_animation_reapply(get(hsp_name),get(frameRate),get(frameNumber));
  396. <!-- do_crop_animation(get(hsp_name),get(frameRate),get(frameNumber)); -->
  397. <!-- do_crop_animation(get(framewidth),get(framewidth),get(frameNumber));"); -->
  398. );
  399. );
  400. set(hotspot[get(hsp_name)].url,get(iconUrl));
  401. set(hotspot[get(hsp_name)].rotate,0);
  402. set(layer[get(hsLabel)].rotate,0);
  403. set(layer[get(hsDot)].visible,false);
  404. );
  405. </action>
  406. <action name="dragJQlayer">
  407. txtadd(hsName, '', get(name));
  408. txtreplace(hsName, 'tooltip_', '');
  409. txtreplace(hsName, 'tooldot_', '');
  410. <!-- copy(drag_currentx, x);
  411. copy(drag_currenty, y);
  412. copy(drag_stagex, mouse.stagex);
  413. copy(drag_stagey, mouse.stagey);
  414. indexoftxt(align_contains_right, get(align), 'right');
  415. indexoftxt(align_contains_bottom, get(align), 'bottom');
  416. calc(drag_align_x, align_contains_right GE 0 ? -1 : +1);
  417. calc(drag_align_y, align_contains_bottom GE 0 ? -1 : +1);
  418. -->
  419. copy(hath, hotspot[get(hsName)].ath);
  420. copy(hatv, hotspot[get(hsName)].atv);
  421. spheretoscreen(hath, hatv, hotspotcenterx, hotspotcentery, 'l');
  422. sub(drag_adjustx,mouse.stagex, hotspotcenterx);
  423. sub(drag_adjusty,mouse.stagey, hotspotcentery);
  424. asyncloop(
  425. <!-- 计算热点中心点 -->
  426. pressed,
  427. sub(dx, mouse.stagex, drag_adjustx);
  428. sub(dy, mouse.stagey, drag_adjusty);
  429. screentosphere(dx, dy, ath, atv);
  430. <!-- 更新 -->
  431. copy(hotspot[get(hsName)].ath, ath);
  432. copy(hotspot[get(hsName)].atv, atv);,
  433. set(global.ath,get(ath));
  434. set(global.atv,get(atv));
  435. );
  436. </action>
  437. <action name='JQlayerClick'>
  438. txtadd(clickName, '', get(name));
  439. txtreplace(clickName, 'tooltip_', '');
  440. txtreplace(clickName, 'tooldot_', '');
  441. <!-- trace('JQlayerClick',get(clickName)); -->
  442. js(__krfn.utils.linkopen(get(hotlink),get(clickName)));
  443. </action>
  444. <action name="dragJQhotspot">
  445. trace('dragJQhotspot::',ath,atv);
  446. spheretoscreen(ath, atv, hotspotcenterx, hotspotcentery, 'l');
  447. sub(drag_adjustx,mouse.stagex, hotspotcenterx);
  448. sub(drag_adjusty,mouse.stagey, hotspotcentery);
  449. asyncloop(
  450. pressed,
  451. sub(dx, mouse.stagex, drag_adjustx);
  452. sub(dy, mouse.stagey, drag_adjusty);
  453. screentosphere(dx, dy, ath, atv);
  454. );
  455. </action>
  456. </krpano>