customTooltip.xml 26 KB

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