customTooltip.xml 25 KB

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