customTooltip.xml 23 KB

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