contextmenu.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <krpano>
  2. <!--
  3. contextmenu.xml
  4. krpano 1.20.11
  5. A helper script for changing the mouse-control-mode and the
  6. viewing projections via the context-menu.
  7. -->
  8. <contextmenu fullscreen="true" versioninfo="true">
  9. <item name="kr" caption="KRPANO" />
  10. <item name="fs" caption="FULLSCREEN" />
  11. <item name="cc" caption="Change Controlmode" onclick="cm_changecontrolmode();" separator="above" />
  12. <item name="nv" caption="Normal View" onclick="cm_normal_view();" showif="view.vlookatrange == 180" separator="above" />
  13. <item name="fv" caption="Fisheye View" onclick="cm_fisheye_view();" showif="view.vlookatrange == 180" devices="flash|webgl" />
  14. <item name="sv" caption="Stereographic View" onclick="cm_stereographic_view();" showif="view.vlookatrange == 180" devices="flash|webgl" />
  15. <item name="av" caption="Architectural View" onclick="cm_architectural_view();" showif="view.vlookatrange == 180" />
  16. <item name="pv" caption="Pannini View" onclick="cm_pannini_view();" showif="view.vlookatrange == 180" devices="flash|webgl" />
  17. <item name="lp" caption="Little Planet View" onclick="cm_littleplanet_view();" showif="view.vlookatrange == 180" devices="flash|webgl" />
  18. </contextmenu>
  19. <action name="cm_changecontrolmode">
  20. if(device.html5,
  21. switch(control.mode, moveto, drag, follow);
  22. cm_changecontrolmode_updatecaption();
  23. ,
  24. switch(control.mode, moveto, drag);
  25. );
  26. </action>
  27. <action name="cm_changecontrolmode_updatecaption" autorun="onstart" devices="html5">
  28. txtadd(contextmenu.item[cc].caption,
  29. "Controlmode: ",
  30. "[span style=[sq]", calc(control.mode == 'drag' ? "text-decoration:underline" :""), "[sq]]",
  31. "Drag",
  32. "[/span]",
  33. " | ",
  34. "[span style=[sq]", calc(control.mode == 'follow' ? "text-decoration:underline" :""), "[sq]]",
  35. "Follow",
  36. "[/span]",
  37. " | ",
  38. "[span style=[sq]", calc(control.mode == 'moveto' ? "text-decoration:underline" :""), "[sq]]",
  39. "MoveTo",
  40. "[/span]",
  41. );
  42. </action>
  43. <action name="cm_look_straight">
  44. if(view.vlookat LT -80 OR view.vlookat GT +80,
  45. tween(view.vlookat, 0.0, 1.0, easeInOutSine);
  46. tween(view.fov, 100, distance(150,0.8));
  47. );
  48. </action>
  49. <action name="cm_normal_view">
  50. cm_look_straight();
  51. tween(view.architectural, 0.0, distance(1.0,0.5));
  52. tween(view.pannini, 0.0, distance(1.0,0.5));
  53. tween(view.fisheye, 0.0, distance(1.0,0.5));
  54. </action>
  55. <action name="cm_architectural_view">
  56. cm_look_straight();
  57. tween(view.architectural, 1.0, distance(1.0,0.5));
  58. tween(view.pannini, 0.0, distance(1.0,0.5));
  59. tween(view.fisheye, 0.0, distance(1.0,0.5));
  60. </action>
  61. <action name="cm_fisheye_view">
  62. cm_look_straight();
  63. tween(view.architectural, 0.0, distance(1.0,0.5));
  64. tween(view.pannini, 0.0, distance(1.0,0.5));
  65. tween(view.fisheye, 0.35, distance(1.0,0.5));
  66. </action>
  67. <action name="cm_stereographic_view">
  68. cm_look_straight();
  69. tween(view.architectural, 0.0, distance(1.0,0.5));
  70. tween(view.pannini, 0.0, distance(1.0,0.5));
  71. tween(view.fisheye, 1.0, distance(1.0,0.8));
  72. </action>
  73. <action name="cm_pannini_view">
  74. cm_look_straight();
  75. tween(view.architectural, 0.0, distance(1.0,0.5));
  76. tween(view.pannini, 1.0, distance(1.0,0.8));
  77. if(view.fisheye LT 0.1,
  78. tween(view.fisheye, 1.0, distance(1.0,0.8));
  79. );
  80. </action>
  81. <action name="cm_littleplanet_view">
  82. tween(view.architectural, 0.0, distance(1.0,0.5));
  83. tween(view.pannini, 0.0, distance(1.0,0.5));
  84. tween(view.fisheye, 1.0, distance(1.0,0.8));
  85. tween(view.fov, 150, distance(150,0.8));
  86. tween(view.vlookat, 90, distance(100,0.8));
  87. tween(view.hlookat, calc(view.hlookat + 123.0), distance(100,0.8));
  88. </action>
  89. </krpano>