object.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. <layer name="obj_bg" keep="true" type="container" bgcolor="0x000000" bgalpha="0.3" align="lefttop" x="0"
  9. y="0" width="100%" height="100%" visible="false" zorder="99" bgcapture="true" onclick="obj_clsoe()">
  10. <layer parent="obj_bg" keep="true" name="obj_close" url="%SWFPATH%/skin/gallerybtns.png" align="righttop" background="false"
  11. crop="200|0|100|100" onclick="obj_clsoe()">
  12. </layer>
  13. </layer>
  14. <plugin name="loadingtext" url="%SWFPATH%/plugins/textfield.swf" keep="true" zorder="100" enabled="false"
  15. preload="true"
  16. align="center"
  17. autoheight="true"
  18. width="100"
  19. background="false"
  20. html="[p]环物加载中...[/p]"
  21. css="p {color:#FFFFFF; font-family:arial; font-size:16px }"
  22. visible="false"
  23. />
  24. <layer name="gallerynext" url="/static/images/gallerybtns.png" keep="true"
  25. align="right" x="0" y="0" zorder="100"
  26. crop="100|0|100|100"
  27. onovercrop="100|100|100|100"
  28. ondowncrop="100|100|100|100"
  29. ondown="set(y,1);dorotate();"
  30. onup="set(y,0)"
  31. direction="-1"
  32. visible="false"
  33. />
  34. <layer name="galleryprev" url="/static/images/gallerybtns.png" keep="true"
  35. align="left" x="0" y="0" zorder="100"
  36. crop="0|0|100|100"
  37. onovercrop="0|100|100|100"
  38. ondowncrop="0|100|100|100"
  39. ondown="set(y,1);dorotate();"
  40. onup="set(y,0)"
  41. direction="1"
  42. visible="false"
  43. />
  44. <action name="buildframes">
  45. for(set(i,0), i LT %2, inc(i),
  46. txtadd(fname,frame,get(i));
  47. txtadd(furl,%1,get(i),.jpg);
  48. addplugin(get(fname));
  49. plugin[get(fname)].loadstyle(frame);
  50. copy(plugin[get(fname)].url,furl);
  51. );
  52. set(currentframe,0);
  53. set(framecount,%2);
  54. set(oldmousex,0);
  55. showframe(0);
  56. </action>
  57. <action name="updateframesize">
  58. if(plugin[%1].imagewidth GT stagewidth,
  59. set(plugin[%1].width,100%);
  60. set(plugin[%1].height,prop);
  61. ,
  62. if(plugin[%1].imageheight GT stageheight,
  63. set(plugin[%1].width,prop);
  64. set(plugin[%1].height,100%);
  65. ,
  66. plugin[%1].resetsize();
  67. );
  68. );
  69. </action>
  70. <action name="obj_clsoe">
  71. for(set(i,0), i LT framecount, inc(i),
  72. txtadd(fname,frame,get(i));
  73. removeplugin(get(fname));
  74. );
  75. set(currentframe,0);
  76. set(layer[gallerynext].visible,false);
  77. set(layer[galleryprev].visible,false);
  78. set(layer[obj_bg].visible,false);
  79. jscall(toggleBtns(true));
  80. </action>
  81. <action name="updateframesscale">
  82. for(set(i,0), i LT framecount, inc(i),
  83. txtadd(fname,frame,get(i));
  84. sub(temp,180,view.fov);
  85. div(newscale,temp,70);
  86. copy(plugin[get(fname)].scale,newscale);
  87. );
  88. </action>
  89. <action name="updateframes">
  90. for(set(i,0), i LT framecount, inc(i),
  91. txtadd(fname,frame,get(i));
  92. updateframesize(get(fname));
  93. );
  94. </action>
  95. <action name="showframe">
  96. set(plugin[loadingtext].visible,true);
  97. txtadd(fname,frame,get(currentframe));
  98. txtadd(tempstr,'set(plugin[',get(fname),'].visible,false);');
  99. ifnot(%1 == 0, delayedcall(0.03,get(tempstr)); );
  100. add(currentframe,%1);
  101. if(currentframe LT 0, sub(currentframe,framecount,1); );
  102. if(currentframe == framecount, set(currentframe,0); );
  103. txtadd(fname,frame,get(currentframe));
  104. set(plugin[get(fname)].visible,true);
  105. ifnot(plugin[get(fname)].loaded, set(plugin[loadingtext].visible,true);, set(plugin[loadingtext].visible,false); );
  106. set(layer[gallerynext].visible,true);
  107. set(layer[galleryprev].visible,true);
  108. set(layer[obj_bg].visible,true);
  109. <!-- ifnot(%2,set(layer[obj_bg].visible,true);); -->
  110. </action>
  111. <action name="dorotate">
  112. if(pressed,
  113. showframe(get(direction));
  114. delayedcall(0.05,dorotate(););
  115. );
  116. </action>
  117. <action name="domouserotate">
  118. if(pressed,
  119. sub(temp,oldmousex,mouse.x);
  120. if(temp GT 0, set(temp,1); );
  121. if(temp LT 0, set(temp,-1); );
  122. showframe(get(temp));
  123. copy(oldmousex,mouse.x);
  124. delayedcall(0.03,domouserotate(););
  125. );
  126. </action>
  127. </krpano>