customTooltip.xml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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. if(%2 LE 1,
  10. <!-- trace('id==',get(hsp_name),"::",get(iconUrl)); -->
  11. set(hotspot[get(hsp_name)].type,'image');
  12. set(hotspot[get(hsp_name)].url,get(iconUrl));
  13. );
  14. ifnot(%2 LE 1, set(hotspot[get(hsp_name)].type, 'text'));
  15. <!-- 其他标签 (0,1,2)-->
  16. if(%2 LT 2,
  17. set(hotspot[get(hsp_name)].height,%8);
  18. set(hotspot[get(hsp_name)].width,'prop');
  19. txtadd(hotspot[get(hsp_name)].onloaded,"add_tooltip_label();");
  20. );
  21. <!-- 个性化标签(3) -->
  22. ifnot(%2 LT 2,
  23. trace('tags::',%3);
  24. set(hotspot[get(hsp_name)].height,80);
  25. set(hotspot[get(hsp_name)].width,1);
  26. txtadd(hotspot[get(hsp_name)].onloaded,"add_tooltip_label();add_tooltip_dot();");
  27. set(hotspot[get(hsp_name)].rotate,35);
  28. );
  29. set(hotspot[get(hsp_name)].name,%1);
  30. set(hotspot[get(hsp_name)].hotspottype,%2);
  31. set(hotspot[get(hsp_name)].hotspottitle,%3);
  32. set(hotspot[get(hsp_name)].hotspotStyle,%10);
  33. set(hotspot[get(hsp_name)].ath,%5);
  34. set(hotspot[get(hsp_name)].atv,%6);
  35. set(hotspot[get(hsp_name)].visible,true);
  36. set(hotspot[get(hsp_name)].alpha,1);
  37. set(hotspot[get(hsp_name)].scale,1);
  38. set(hotspot[get(hsp_name)].autoalpha,false);
  39. set(hotspot[get(hsp_name)].distorted,false);
  40. <!-- layer -->
  41. addhotspot(get(hsp_name));
  42. set(hotspot[get(hsp_name)].ondown,dragJQhotspot(););
  43. </action>
  44. <action name="editJQHotspot">
  45. showlog();
  46. set(hsp_name,%1);
  47. set(hsp_type,%2);
  48. trace('edit');
  49. </action>
  50. <action name="addImgTextHotSpot1">
  51. set(schp_name,%1);
  52. set(hotspot[get(schp_name)].type,'text');
  53. set(hotspot[get(schp_name)].ath,%4);
  54. set(hotspot[get(schp_name)].atv,%5);
  55. set(hotspot[get(schp_name)].hotspottitle,%3);
  56. set(hotspot[get(schp_name)].wordcontent,%9);
  57. set(hotspot[get(schp_name)].hotspotlink,%8);
  58. set(hotspot[get(schp_name)].alpha,1);
  59. set(hotspot[get(schp_name)].scale,1);
  60. set(hotspot[get(schp_name)].autoalpha,false);
  61. set(hotspot[get(schp_name)].distorted,false);
  62. <!-- set(hotspot[get(schp_name)].width,'prop');
  63. set(hotspot[get(schp_name)].height,%11); -->
  64. set(hotspot[get(schp_name)].width, 1);
  65. set(hotspot[get(schp_name)].height,70);
  66. set(hotspot[get(schp_name)].visible,true);
  67. <!-- set(hotspot[get(schp_name)].onhover,showtext(get(hotspottitle),skintext)); -->
  68. addhotspot(get(schp_name));
  69. set(hotspot[get(schp_name)].onclick,'js(__krfn.utils.linkopen(%8,%2));');
  70. if(%7 == false,
  71. ,
  72. set(hotspot[get(schp_name)].ondown,draghotspot1(););
  73. <!-- set(hotspot[get(schp_name)].onup,js(__krfn.angle.updateHotSpotData(get(xml.scene),get(name),get(ath),get(atv),"imgtext"))); -->
  74. );
  75. <!-- txtadd(hotspot[get(schp_name)].onloaded,"add_all_the_time_tooltip(hotspot[get(name)].hotspottitle);"); -->
  76. <!-- txtadd(hotspot[get(schp_name)].onloaded,"add_all_2_tooltip(hotspot[get(name)].hotspottitle);"); -->
  77. <!-- txtadd(hotspot[get(schp_name)].onloaded,"add_all_2_tooltip(hotspot[get(name)].hotspottitle);"); -->
  78. txtadd(hotspot[get(schp_name)].onloaded,"add_all_2_tooltip();");
  79. <!-- txtadd(hotspot[get(schp_name)].onloaded,"add_all_2_tooltip(hotspot[get(name)].hotspottitle,hotspot[get(name)].ath,hotspot[get(name)].atv);"); -->
  80. set(hotspot[get(schp_name)].onhover,null);
  81. set(hotspot[get(schp_name)].onout,null);
  82. set(hotspot[get(schp_name)].onover,null);
  83. <!-- if(%10 == true,
  84. set(plugin[get(tooltipname)].visible,true);,
  85. set(plugin[get(tooltipname)].visible,false);
  86. ); -->
  87. <!-- txtadd(csstxt, 'text-align:center; color:#FFFFFF; font-family:STXihei; font-size:', %12,'px');
  88. set(plugin[get(tooltipname)].css,get(csstxt)));, -->
  89. </action>
  90. <action name="add_tooltip_label">
  91. txtadd(tooltipname2, 'tooltip2_', get(name));
  92. <!-- fontSize: 12,
  93. position: "top",
  94. isHover: false,
  95. borderColor: "",
  96. isShowLine: "",
  97. isTextWrap: "",
  98. lineDirection: "",
  99. textColor: "",
  100. textDirection: "",
  101. textNumPerLine: "",
  102. duration: 0,
  103. frameNumber: 0, -->
  104. txtsplit(hotspotStyle,'|',fontSize,pos,isHover,borderColor,isShowLine,isTextWrap,lineDirection,textColor,textDirection,textNumPerLine,duration,frameNumber);
  105. trace('hotspotStyle::',lineDirection);
  106. addlayer(get(tooltipname2));
  107. txtadd(layer[get(tooltipname2)].parent, 'hotspot[', get(name), ']');
  108. set(layer[get(tooltipname2)].autowidth, true);
  109. set(layer[get(tooltipname2)].width,'prop');
  110. set(layer[get(tooltipname2)].height,30);
  111. set(layer[get(tooltipname2)].edge,center);
  112. set(layer[get(tooltipname2)].background,false);
  113. set(layer[get(tooltipname2)].x,0);
  114. set(layer[get(tooltipname2)].y,-45);
  115. set(layer[get(tooltipname2)].padding,0);
  116. set(layer[get(tooltipname2)].type,'html');
  117. set(layer[get(tooltipname2)].url,'%SWFPATH%/plugins/textfield.swf');
  118. set(layer[get(tooltipname2)].border,false);
  119. set(layer[get(tooltipname2)].align,center);
  120. set(layer[get(tooltipname2)].ondown,'dragJQlayer();');
  121. ifnot(get(hotspottype) LT 2,
  122. set(layer[get(tooltipname2)].y,-60);
  123. set(layer[get(tooltipname2)].rotate,-35);
  124. );
  125. txtadd(labelCode, '<div style="display: flex; align-items: center; justify-content: center; position: relative; border: 0px solid rgba(255,255,255,1); padding: 6px 10px; white-space: pre; border-radius: 5px; background: rgba(0,0,0,0.5);">','<div style="text-align: left; font-size:',get(fontSize),'px; color: rgba(255,255,255,1); line-height: 1.4;">',get(hotspottitle),'</div>
  126. </div>');
  127. copy(layer[get(tooltipname2)].html, labelCode);
  128. </action>
  129. <!-- <style name="tooltip_dot_bg" type="container" border-radius="50%" bgcolor="0xFFFFFF" bgalpha="0.9" height="20" width="20" keep="true" /> -->
  130. <action name='add_tooltip_dot'>
  131. txtadd(tooldot, 'tooldot_', get(name));
  132. trace('hey::',get(tooldot));
  133. addlayer(get(tooldot));
  134. txtadd(layer[get(tooldot)].parent, 'hotspot[', get(name), ']');
  135. set(layer[get(tooldot)].width,10);
  136. set(layer[get(tooldot)].height,10);
  137. set(layer[get(tooldot)].padding,0);
  138. set(layer[get(tooldot)].x,0);
  139. set(layer[get(tooldot)].y,40);
  140. set(layer[get(tooldot)].align,center);
  141. set(layer[get(tooldot)].type,'text');
  142. set(layer[get(tooldot)].background,true);
  143. set(layer[get(tooldot)].backgroundcolor,0xFFFFFF);
  144. set(layer[get(tooldot)].backgroundalpha,0.9);
  145. set(layer[get(tooldot)].bgroundedge,5);
  146. set(layer[get(tooldot)].ondown,'dragJQlayer();');
  147. <!-- set(layer[get(tooldot)].html, '<div style="width:100%;height:100%;border-radius:50%;background:rgba(255,255,255,0.9);"></div>'); -->
  148. </action>
  149. <action name="dragJQlayer">
  150. txtadd(hsName, '', get(name));
  151. txtreplace(hsName, 'tooltip2_', '');
  152. txtreplace(hsName, 'tooldot_', '');
  153. trace('drag::',hsName);
  154. <!-- copy(drag_currentx, x);
  155. copy(drag_currenty, y);
  156. copy(drag_stagex, mouse.stagex);
  157. copy(drag_stagey, mouse.stagey);
  158. indexoftxt(align_contains_right, get(align), 'right');
  159. indexoftxt(align_contains_bottom, get(align), 'bottom');
  160. calc(drag_align_x, align_contains_right GE 0 ? -1 : +1);
  161. calc(drag_align_y, align_contains_bottom GE 0 ? -1 : +1);
  162. -->
  163. copy(hath, hotspot[get(hsName)].ath);
  164. copy(hatv, hotspot[get(hsName)].atv);
  165. spheretoscreen(hath, hatv, hotspotcenterx, hotspotcentery, 'l');
  166. sub(drag_adjustx,mouse.stagex, hotspotcenterx);
  167. sub(drag_adjusty,mouse.stagey, hotspotcentery);
  168. asyncloop(
  169. <!-- 计算热点中心点 -->
  170. pressed,
  171. sub(dx, mouse.stagex, drag_adjustx);
  172. sub(dy, mouse.stagey, drag_adjusty);
  173. screentosphere(dx, dy, vath, vatv);
  174. <!-- 更新 -->
  175. copy(hotspot[get(hsName)].ath, vath);
  176. copy(hotspot[get(hsName)].atv, vatv);
  177. );
  178. </action>
  179. <action name="dragJQhotspot">
  180. spheretoscreen(ath, atv, hotspotcenterx, hotspotcentery, 'l');
  181. sub(drag_adjustx,mouse.stagex, hotspotcenterx);
  182. sub(drag_adjusty,mouse.stagey, hotspotcentery);
  183. asyncloop(
  184. pressed,
  185. sub(dx, mouse.stagex, drag_adjustx);
  186. sub(dy, mouse.stagey, drag_adjusty);
  187. screentosphere(dx, dy, ath, atv);
  188. );
  189. </action>
  190. </krpano>