[摘要]这是一个官方打开窗帘的渐变特效,实现上也比较简单,通过图片热点渐变进行切换,通过多边形热点确定点击范围。可以用于开门、开窗等效果。
代码说明
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 |
<!-- 单独拍摄一张有开门后的图片,用图片热点形式添加到全景中,并设置好ondown,onup属性--> <hotspot name="door" url="hotspot.jpg" distorted="true" capture="false" xzorder="-100000" ath="0" atv="0" width="318.181818" height="590.909090" edge="lefttop" ox="-91.818181" oy="-167.272727" alpha="0.0" ondown="tween(alpha,1);" onup="tween(alpha,0);" /> <!-- 添加多边形热点,设置透明度alpha为0,设置onover\onout属性 --> <hotspot name="door_hitarea" ath="11" atv="6" alpha="0" capture="false" onover="set(hotspot[door].visible,true); tween(hotspot[door].alpha,1,0.4);" onout="if(enabled, tween(hotspot[door].alpha,0.0,0.4,default,set(hotspot[door].visible,false)) );" onclick="" > <point ath=" 0.2451" atv="-13.0911" /> <point ath=" 9.5232" atv="-12.6311" /> <point ath=" 18.9875" atv="-12.5328" /> <point ath=" 19.5338" atv=" 10.7739" /> <point ath=" 15.7329" atv=" 11.3926" /> <point ath=" 15.6678" atv=" 25.4866" /> <point ath=" 8.4078" atv=" 25.7356" /> <point ath=" 8.4083" atv=" 27.0813" /> <point ath=" 2.7864" atv=" 26.7555" /> <point ath=" 1.7124" atv=" 27.8670" /> <point ath=" -0.9187" atv=" 27.0069" /> <point ath=" -1.4939" atv=" 11.6458" /> <point ath=" -0.6737" atv=" -5.2171" /> </hotspot> |
下载地址
领主tips--多边形热点添加及图片热点添加可以参考: