customTooltip.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <krpano>
  2. <!-- 1.20. 新热点模式 -->
  3. <action name="addJQHotspot">
  4. showlog();
  5. set(schp_name,%2);
  6. set(hotspot[get(schp_name)].type,'text');
  7. <!-- set(hotspot[get(schp_name)].url,%1); -->
  8. set(hotspot[get(schp_name)].ath,%4);
  9. set(hotspot[get(schp_name)].atv,%5);
  10. set(hotspot[get(schp_name)].hotspottitle,%3);
  11. set(hotspot[get(schp_name)].wordcontent,%9);
  12. set(hotspot[get(schp_name)].hotspotlink,%8);
  13. set(hotspot[get(schp_name)].alpha,1);
  14. set(hotspot[get(schp_name)].scale,1);
  15. set(hotspot[get(schp_name)].autoalpha,false);
  16. set(hotspot[get(schp_name)].distorted,false);
  17. <!-- set(hotspot[get(schp_name)].width,'prop');
  18. set(hotspot[get(schp_name)].height,%11); -->
  19. set(hotspot[get(schp_name)].width, 1);
  20. set(hotspot[get(schp_name)].height,70);
  21. set(hotspot[get(schp_name)].visible,true);
  22. <!-- set(hotspot[get(schp_name)].onhover,showtext(get(hotspottitle),skintext)); -->
  23. addhotspot(get(schp_name));
  24. set(hotspot[get(schp_name)].onclick,'js(__krfn.utils.linkopen(%8,%2));');
  25. if(%7 == false,
  26. ,
  27. set(hotspot[get(schp_name)].ondown,draghotspot1(););
  28. <!-- set(hotspot[get(schp_name)].onup,js(__krfn.angle.updateHotSpotData(get(xml.scene),get(name),get(ath),get(atv),"imgtext"))); -->
  29. );
  30. <!-- txtadd(hotspot[get(schp_name)].onloaded,"add_all_the_time_tooltip(hotspot[get(name)].hotspottitle);"); -->
  31. <!-- txtadd(hotspot[get(schp_name)].onloaded,"add_all_2_tooltip(hotspot[get(name)].hotspottitle);"); -->
  32. <!-- txtadd(hotspot[get(schp_name)].onloaded,"add_all_2_tooltip(hotspot[get(name)].hotspottitle);"); -->
  33. txtadd(hotspot[get(schp_name)].onloaded,"add_all_2_tooltip();");
  34. <!-- txtadd(hotspot[get(schp_name)].onloaded,"add_all_2_tooltip(hotspot[get(name)].hotspottitle,hotspot[get(name)].ath,hotspot[get(name)].atv);"); -->
  35. set(hotspot[get(schp_name)].onhover,null);
  36. set(hotspot[get(schp_name)].onout,null);
  37. set(hotspot[get(schp_name)].onover,null);
  38. <!-- if(%10 == true,
  39. set(plugin[get(tooltipname)].visible,true);,
  40. set(plugin[get(tooltipname)].visible,false);
  41. ); -->
  42. <!-- txtadd(csstxt, 'text-align:center; color:#FFFFFF; font-family:STXihei; font-size:', %12,'px');
  43. set(plugin[get(tooltipname)].css,get(csstxt)));, -->
  44. </action>
  45. <action name="add_all_2_tooltip">
  46. txtadd(tooltipname2, 'tooltip2_', get(name));
  47. set(toolP,get(name));
  48. trace('parentName::',get(name));
  49. addlayer(get(tooltipname2));
  50. txtadd(layer[get(tooltipname2)].parent, 'hotspot[', get(name), ']');
  51. set(layer[get(tooltipname2)].autowidth, true);
  52. set(layer[get(tooltipname2)].width,'prop');
  53. set(layer[get(tooltipname2)].height,30);
  54. set(layer[get(tooltipname2)].edge,center);
  55. set(layer[get(tooltipname2)].background,false);
  56. set(layer[get(tooltipname2)].x,0);
  57. set(layer[get(tooltipname2)].y,-50);
  58. set(layer[get(tooltipname2)].padding,0);
  59. set(layer[get(tooltipname2)].type,'html');
  60. set(layer[get(tooltipname2)].url,'%SWFPATH%/plugins/textfield.swf');
  61. set(layer[get(tooltipname2)].border,false);
  62. set(layer[get(tooltipname2)].align,center);
  63. set(layer[get(tooltipname2)].ondown,'draglayer();');
  64. 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: 12px; color: rgba(255,255,255,1); line-height: 1.4;">',get(hotspottitle),'</div></div>');
  65. copy(layer[get(tooltipname2)].html, labelCode);
  66. </action>
  67. <action name="draglayer">
  68. txtadd(hsName, '', get(name));
  69. txtreplace(hsName, 'tooltip2_', '');
  70. <!-- copy(drag_currentx, x);
  71. copy(drag_currenty, y);
  72. copy(drag_stagex, mouse.stagex);
  73. copy(drag_stagey, mouse.stagey);
  74. indexoftxt(align_contains_right, get(align), 'right');
  75. indexoftxt(align_contains_bottom, get(align), 'bottom');
  76. calc(drag_align_x, align_contains_right GE 0 ? -1 : +1);
  77. calc(drag_align_y, align_contains_bottom GE 0 ? -1 : +1);
  78. -->
  79. copy(hath, hotspot[get(hsName)].ath);
  80. copy(hatv, hotspot[get(hsName)].atv);
  81. spheretoscreen(hath, hatv, hotspotcenterx, hotspotcentery, 'l');
  82. sub(drag_adjustx,mouse.stagex, hotspotcenterx);
  83. sub(drag_adjusty,mouse.stagey, hotspotcentery);
  84. asyncloop(
  85. <!-- 计算热点中心点 -->
  86. pressed,
  87. sub(dx, mouse.stagex, drag_adjustx);
  88. sub(dy, mouse.stagey, drag_adjusty);
  89. screentosphere(dx, dy, vath, vatv);
  90. <!-- 更新 -->
  91. copy(hotspot[get(hsName)].ath, vath);
  92. copy(hotspot[get(hsName)].atv, vatv);
  93. );
  94. </action>
  95. <action name="draghotspot1">
  96. spheretoscreen(ath, atv, hotspotcenterx, hotspotcentery, 'l');
  97. sub(drag_adjustx,mouse.stagex, hotspotcenterx);
  98. sub(drag_adjusty,mouse.stagey, hotspotcentery);
  99. asyncloop(
  100. pressed,
  101. sub(dx, mouse.stagex, drag_adjustx);
  102. sub(dy, mouse.stagey, drag_adjusty);
  103. screentosphere(dx, dy, ath, atv);
  104. );
  105. </action>
  106. </krpano>