customTooltip.xml 22 KB

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