object_preview.xml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <krpano version="1.0.8.15">
  2. <events onresize="updateframes()" onviewchange="updateframesscale()" />
  3. <style name="frame" keep="true" visible="false"
  4. align="center" zorder="100"
  5. onloaded="updateframesize(get(name));set(plugin[loadingtext].visible,false);"
  6. ondown="copy(oldmousex,mouse.x);domouserotate();"
  7. />
  8. <plugin name="loadingtext" url="%SWFPATH%/plugins/textfield.swf" keep="true" zorder="100" enabled="false"
  9. preload="true"
  10. align="center"
  11. autoheight="true"
  12. width="100"
  13. background="false"
  14. html="[p]环物加载中...[/p]"
  15. css="p {color:#FFFFFF; font-family:arial; font-size:16px }"
  16. visible="false"
  17. />
  18. <layer name="gallerynext" url="/static/images/gallerybtns.png" keep="true"
  19. align="right" x="0" y="0" zorder="100"
  20. crop="100|0|100|100"
  21. onovercrop="100|100|100|100"
  22. ondowncrop="100|100|100|100"
  23. ondown="set(y,1);dorotate();"
  24. onup="set(y,0)"
  25. direction="-1"
  26. visible="true"
  27. />
  28. <layer name="galleryprev" url="/static/images/gallerybtns.png" keep="true"
  29. align="left" x="0" y="0" zorder="100"
  30. crop="0|0|100|100"
  31. onovercrop="0|100|100|100"
  32. ondowncrop="0|100|100|100"
  33. ondown="set(y,1);dorotate();"
  34. onup="set(y,0)"
  35. direction="1"
  36. visible="true"
  37. />
  38. <action name="updateframesize">
  39. if(plugin[%1].imagewidth GT stagewidth,
  40. set(plugin[%1].width,100%);
  41. set(plugin[%1].height,prop);
  42. ,
  43. if(plugin[%1].imageheight GT stageheight,
  44. set(plugin[%1].width,prop);
  45. set(plugin[%1].height,100%);
  46. ,
  47. plugin[%1].resetsize();
  48. );
  49. );
  50. </action>
  51. <action name="updateframesscale">
  52. for(set(i,0), i LT framecount, inc(i),
  53. txtadd(fname,frame,get(i));
  54. sub(temp,180,view.fov);
  55. div(newscale,temp,70);
  56. copy(plugin[get(fname)].scale,newscale);
  57. );
  58. </action>
  59. <action name="updateframes">
  60. for(set(i,0), i LT framecount, inc(i),
  61. txtadd(fname,frame,get(i));
  62. updateframesize(get(fname));
  63. );
  64. </action>
  65. <action name="showframe">
  66. set(plugin[loadingtext].visible,true);
  67. txtadd(fname,frame,get(currentframe));
  68. txtadd(tempstr,'set(plugin[',get(fname),'].visible,false);');
  69. ifnot(%1 == 0, delayedcall(0.03,get(tempstr)); );
  70. add(currentframe,%1);
  71. if(currentframe LT 0, sub(currentframe,framecount,1); );
  72. if(currentframe == framecount, set(currentframe,0); );
  73. txtadd(fname,frame,get(currentframe));
  74. set(plugin[get(fname)].visible,true);
  75. ifnot(plugin[get(fname)].loaded, set(plugin[loadingtext].visible,true);, set(plugin[loadingtext].visible,false); );
  76. </action>
  77. <action name="dorotate">
  78. if(pressed,
  79. showframe(get(direction));
  80. delayedcall(0.05,dorotate(););
  81. );
  82. </action>
  83. <action name="domouserotate">
  84. if(pressed,
  85. sub(temp,oldmousex,mouse.x);
  86. if(temp GT 0, set(temp,1); );
  87. if(temp LT 0, set(temp,-1); );
  88. showframe(get(temp));
  89. copy(oldmousex,mouse.x);
  90. delayedcall(0.03,domouserotate(););
  91. );
  92. </action>
  93. </krpano>