customTooltip.xml 6.7 KB

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