以下隐藏内容只提供VIP赞助会员,VIP会员说明请查看置顶文章
简介
这是一个简单的使用krpano代码制作猜小球的小项目。主要学习点在于对于热点运动的使用,如对ox、oy、scale的tween用法。另外也涉及到random。
使用方法
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
<krpano version="1.19" title="Virtual Tour"> <!-- <include url="add_hotspot/plugins_l/editor/add_hotspot.xml" /> --> <include url="plugins/showtext.xml" /> <action name="startup" autorun="onstart"> loadscene(scene_1, null, MERGE); set(val, 1); set(var_s,stak_1); set(ye_sh, 0); set(no_sh, 0); </action> <!-- the style pop-up text when you hover your mouse over the link --> <textstyle name="STYLE_s" font="Arial" fontsize.no-mobile="50" bold="true" italic="false" xoffset="0" yoffset="0" background="false" backgroundcolor="0x006868" backgroundalpha="0.5" border="false" borderwidth="0" bordercolor="0xFFFFFF" roundedge="3" textcolor="0xFFFFFF" padding="4 5" textalign="center" textshadowrange="2" textshadow ="3" /> <!-- Стиль контейнера меню --> <style name="cont" type="container" keep="true" align="lefttop" x="5" y="0" width="118" height="19" zorder="1" alpha="1" enabled="true" bgcapture="true" bgcolor="0x57606a" bgalpha="0.95" bgshadow="3 3 3 0x000000 0.8" bgroundedge="2" onover="set(bgcolor,0x808c98);" onout="set(bgcolor,0x5e6873);" /> <!-- Стиль текста --> <style name="text_stak" enabled="true" url="%SWFPATH%/plugins/textfield.swf" css="font-family:Arial; color:#FFFFFF; font-size:24px;" x="0" y="0" padding="5 20" keep="true" align="top" background="true" backgroundcolor="0x2D3E50" backgroundalpha="0.7" border="true" bordercolor="0xFF0000" borderalpha="1" borderwidth="2" roundedge="5" shadow="5.0" shadowrange="3.0" shadowangle="45" shadowcolor="0x2D3E50" shadowalpha="0" textshadow="0.0" textshadowrange="4.0" textshadowangle="45" textshadowcolor="0x000000" textshadowalpha="1.0" wordwrap="false" /> <plugin name="soundinterface" url.flash="plugins/soundinterface.swf" url.html5="plugins/soundinterface.js" preload="true" rootpath="" volume="1.0" mute="false" /> <!-- Старт --> <!-- <layer name="Start" style="text_stak" x="0" y="10" html="Start" onclick="Start();" onover="set(scale,1.2)" onout="set(scale,1)" /> --> <!-- Стоп --> <!-- <layer name="Stop" style="text_stak" x="100" y="10" html="Stop" onclick="Start();" /> --> <!-- --> <action name="Start" > playsound(Start, sound/tumbler.mp3); set(hotspot[stak_1].alpha,1); set(hotspot[stak_2].alpha,1); set(hotspot[stak_3].alpha,1); set(hotspot[stak_1].onhover,'showtext(?, STYLE_s);' ); set(hotspot[stak_2].onhover,'showtext(?, STYLE_s);' ); set(hotspot[stak_3].onhover,'showtext(?, STYLE_s);' ); set(popytka,true); set(hotspot[shar].alpha,0); set(pervClik,true); Start2(65,-38);Start3(-36,40);Start4(-100,-53); delayedcall(0.1,Start2(70,0);Start3(-73,-26);Start4(-50,7,1);); delayedcall(0.2,Start2(-6,-32);Start3(-73,34);Start4(104,7,1);); delayedcall(0.3,Start2(-115,0);Start3(97,31);Start4(34,-62,0.88);); </action> <!-- --> <action name="Start4" > tween(hotspot[stak_1].ox,%1,0.1); tween(hotspot[stak_1].oy,%2,0.1); tween(hotspot[hotspot_4].scale,%3); </action> <!-- --> <action name="Start3" > tween(hotspot[stak_3].ox,%1,0.1); tween(hotspot[stak_3].oy,%2,0.1); <!-- tween(hotspot[hotspot_3].scale,%3); --> delayedcall(0.5,gener_sluch();); </action> <!-- --> <action name="Start2" > tween(hotspot[stak_2].ox,%1,0.1); tween(hotspot[stak_2].oy,%2,0.1); <!-- tween(hotspot[hotspot_2].scale,%3); --> </action> <!-- Открыть коробку полную 30%, пустая-60% --> <action name="gener_sluch" > mul(val,random, 2); add(val, 1); roundval(val); txtadd(var,stak_,get(val)); trace(var); copy(hotspot[shar].ox,hotspot[get(var)].ox); copy(hotspot[shar].oy,hotspot[get(var)].oy); </action> <action name="posmotrety" > txtadd(var_s,stak_,%1); if(%1 == val, tween(hotspot[shar].alpha,1); set(hotspot[get(var_s)].onhover,'showtext(YES!!!, STYLE_s);' ); delayedcall(1,set(hotspot[get(var_s)].onhover,'showtext(, STYLE_s);' ); ); playsound(YES, sound/pass.mp3); if(pervClik, inc(ye_sh); set(hotspot[yes_shar].html,calc:'YES=' + ye_sh); set(pervClik,false); ); trace(ye_sh=,ye_sh); , set(hotspot[get(var_s)].onhover,'showtext(NO, STYLE_s);' ); delayedcall(1,set(hotspot[get(var_s)].onhover,'showtext(, STYLE_s);' );); playsound(NO, sound/notpass.mp3); if(pervClik, inc(no_sh); set(hotspot[no_shar].html,calc:'NO=' + no_sh); set(pervClik,false); ); trace(no_sh=,no_sh); ); </action> <scene name="scene_1" title="scene_1" > <preview type="grid(cube,64,64,256,0x25C900,0x333333,0xFFFFFF);" details="10" /> <view hlookat="0" vlookat="38.4685" fov="62.53" fovmax="100" fovmin="40"/> <hotspot name="stol" url="picture/stol.png" distorted="true" alpha="1" capture="false" depth="off" flying="0" handcursor="false" zorder="1" zoom="false" ath="1.7819" atv="50.6334" width="500" height="prop" rx="0" ry="0" rz="0" ox="0" oy="0" rotate="-2.7" scale="1" edge="center" install_onclick="5" ondown="drag_LinkSM()" /> <hotspot name="shar" url="picture/shar2.png" distorted="true" alpha="1" capture="false" depth="off" flying="0" handcursor="true" zorder="5" zoom="false" ath="-0.1157" atv="31.8964" width="40" height="prop" rx="0" ry="0" rz="0" ox="0" oy="0" rotate="0" scale="1" edge="top" install_onclick="5" onhover="" ondown="drag_LinkSM()" enabled="false" /> <hotspot name="stak_1" url="picture/stakan.png" distorted="true" alpha="1" capture="false" depth="off" flying="0" handcursor="true" zorder="5" zoom="false" ath="0" atv="32" width="80" height="prop" rx="0" ry="0" rz="0" ox="34" oy="-62" rotate="0" scale="0.88" edge="center" install_onclick="5" onhover="showtext(?, STYLE_s);" ondown="drag_LinkSM()" onclick="tween(alpha,0); posmotrety(1);" /> <hotspot name="stak_2" url="picture/stakan.png" distorted="true" alpha="1" capture="false" depth="off" flying="0" handcursor="true" zorder="5" zoom="false" ath="0" atv="32" width="80" height="prop" rx="0" ry="0" rz="0" ox="97" oy="31" rotate="0" scale="1" edge="center" install_onclick="5" onhover="showtext(?, STYLE_s);" ondown="drag_LinkSM()" onclick="tween(alpha,0); posmotrety(2);" /> <hotspot name="stak_3" url="picture/stakan.png" distorted="true" alpha="1" capture="false" depth="off" flying="0" handcursor="true" zorder="5" zoom="false" ath="0" atv="32" width="80" height="prop" rx="0" ry="0" rz="0" ox="-115" oy="0" rotate="0" scale="1" edge="center" install_onclick="5" onhover="showtext(?, STYLE_s);" ondown="drag_LinkSM()" onclick="tween(alpha,0); posmotrety(3);" /> <!-- Стиль текста --> <style name="text_shar" type="text" distorted="true" alpha="1" capture="false" handcursor="true" depth="1000" zorder="4" flying="0" zoom="false" ath="-17.3384" atv="13.2462" width="99.99" height="37.45" rx="0" ry="0" rz="0" ox="0" oy="0" rotate="0" scale="1" edge="lefttop" install_onclick="12" info_Ah="null" name_hs="hotspot_1" scene_EL="scene_1" scene_num="0" drag_hs="true" fov_EL="62.53" hs_linkedscene="" enabled2="true" visible2="true" css="font-family:Arial; color:#FFFFFF; font-size:25px;" vcenter="true" padding="5 0 0 12" wordwrap="true" bg="true" bgcolor="7566195" bgalpha="0.8" bgborder="4 0xFFFFFF 1" bgroundedge="7 7 7 7" bgshadow="-10 5 6 0x000000 0.50" txtshadow="-5 2 3 0x000000 0.50" mergedalpha="false" oversampling="2" mipmapping="false" interactivecontent="false" ondown="drag_LinkSM()" /> <hotspot name="text_st" style="text_shar" ath="24.3803" atv="23.3837" width="99.99" height="37.45" rx="0" ry="28.07" rz="0" ox="0" oy="0" rotate="0" scale="1" edge="center" install_onclick="12" css="font-family:Arial; color:#FFFFFF; font-size:25px;" vcenter="true" padding="5 0 0 12" onclick="Start();" onover="tween(bgcolor,0xE02020,0.1); tween(scale,1.1,0.1);" onout="tween(bgcolor,7566195,0.1);tween(scale,1,0.1);" html="START" /> <hotspot name="yes_shar" style="text_shar" ath="8.5247" atv="15.4171" width="110" height="37.45" rx="0" ry="0" rz="0" ox="0" oy="0" rotate="0" scale="1" edge="center" install_onclick="12" css="font-family:Arial; color:#00FF00; font-size:25px;" vcenter="true" padding="5 0 0 12" html="YES=0" /> <hotspot name="no_shar" style="text_shar" ath="-8.6267" atv="15.4611" width="110" height="37.45" rx="0" ry="0" rz="0" ox="0" oy="0" rotate="0" scale="1" edge="center" install_onclick="12" css="font-family:Arial; color:#FF0000; font-size:25px;" vcenter="true" padding="5 0 0 12" html="NO=0" /> </scene> </krpano> |
下载地址
以下隐藏内容只提供VIP赞助会员,VIP会员说明请查看置顶文章