krpano制作snow

Others 2017-09-21 01:09:16 2017-09-21 01:09:16 2308 次浏览

复制plugins的snow插件,将snow的xml放到同级:


snow.xml:

<krpano>

&lt;!-- the snow plugin --&gt;
&lt;plugin name="snow" zorder="1"
        url="%SWFPATH%/plugins/snow.swf"
        alturl="%SWFPATH%/plugins/snow.js"
        floor="0.7"
        /&gt;

&lt;action name="defaultsnow"&gt;
	set(plugin[snow].mode,          snow);
	set(plugin[snow].blendmode,     normal);
	set(plugin[snow].flakes,        4000);
	set(plugin[snow].color,         0xFFFFFF);
	set(plugin[snow].speed,         1.0);
	set(plugin[snow].shake,         4.0);
	set(plugin[snow].speedvariance, 2.0);
	set(plugin[snow].spreading,     4.0);
	set(plugin[snow].wind,          0.0);
&lt;/action&gt;

&lt;action name="snowballs"&gt;
	set(plugin[snow].mode,          image);
	set(plugin[snow].imageurl,      '%CURRENTXML%/snow_image/snowball.png');
	set(plugin[snow].blendmode,     normal);
	set(plugin[snow].flakes,        2000);
	set(plugin[snow].imagescale,    0.5);
	set(plugin[snow].speed,         1.0);
	set(plugin[snow].shake,         4.0);
	set(plugin[snow].speedvariance, 2.0);
	set(plugin[snow].spreading,     2.0);
	set(plugin[snow].wind,          0.0);
&lt;/action&gt;

&lt;action name="snowflakes"&gt;
	set(plugin[snow].mode,          image);
	set(plugin[snow].imageurl,      '%CURRENTXML%/snow_image/snowflake.png');
	set(plugin[snow].blendmode,     add);
	set(plugin[snow].flakes,        2000);
	set(plugin[snow].imagescale,    0.4);
	set(plugin[snow].speed,         0.5);
	set(plugin[snow].shake,         8.0);
	set(plugin[snow].speedvariance, 2.0);
	set(plugin[snow].spreading,     2.0);
	set(plugin[snow].wind,          0.0);
&lt;/action&gt;

&lt;action name="silverstars"&gt;
	set(plugin[snow].mode,          image);
	set(plugin[snow].imageurl,      '%CURRENTXML%/snow_image/silverstar.png');
	set(plugin[snow].blendmode,     add);
	set(plugin[snow].flakes,        2000);
	set(plugin[snow].imagescale,    0.3);
	set(plugin[snow].speed,         1.0);
	set(plugin[snow].shake,         4.0);
	set(plugin[snow].speedvariance, 2.0);
	set(plugin[snow].spreading,     2.0);
	set(plugin[snow].wind,          0.0);
&lt;/action&gt;

&lt;action name="goldenstars"&gt;
	set(plugin[snow].mode,          image);
	set(plugin[snow].imageurl,      '%CURRENTXML%/snow_image/star.png');
	set(plugin[snow].blendmode,     normal);
	set(plugin[snow].flakes,        1000);
	set(plugin[snow].imagescale,    1.0);
	set(plugin[snow].speed,         1.0);
	set(plugin[snow].shake,         4.0);
	set(plugin[snow].speedvariance, 2.0);
	set(plugin[snow].spreading,     1.9);
	set(plugin[snow].wind,          0.0);
&lt;/action&gt;

&lt;action name="hearts"&gt;
	set(plugin[snow].mode,          image);
	set(plugin[snow].imageurl,      '%CURRENTXML%/snow_image/heart.png');
	set(plugin[snow].blendmode,     normal);
	set(plugin[snow].flakes,        250);
	set(plugin[snow].imagescale,    0.5);
	set(plugin[snow].speed,         1.0);
	set(plugin[snow].shake,         4.0);
	set(plugin[snow].speedvariance, 2.0);
	set(plugin[snow].spreading,     1.5);
	set(plugin[snow].wind,          0.0);
&lt;/action&gt;

&lt;action name="smileys"&gt;
	set(plugin[snow].mode,          image);
	set(plugin[snow].imageurl,      '%CURRENTXML%/snow_image/smiley.png');
	set(plugin[snow].blendmode,     normal);
	set(plugin[snow].flakes,        1000);
	set(plugin[snow].imagescale,    1.0);
	set(plugin[snow].speed,         1.0);
	set(plugin[snow].shake,         4.0);
	set(plugin[snow].speedvariance, 2.0);
	set(plugin[snow].spreading,     1.5);
	set(plugin[snow].wind,          0.0);
&lt;/action&gt;

&lt;action name="money"&gt;
	set(plugin[snow].mode,          image);
	set(plugin[snow].imageurl,      '%CURRENTXML%/snow_image/money.png');
	set(plugin[snow].blendmode,     normal);
	set(plugin[snow].flakes,        500);
	set(plugin[snow].imagescale,    0.8);
	set(plugin[snow].speed,         0.8);
	set(plugin[snow].shake,         8.0);
	set(plugin[snow].speedvariance, 3.0);
	set(plugin[snow].spreading,     2.5);
	set(plugin[snow].wind,          0.0);
&lt;/action&gt;

&lt;action name="rain"&gt;
	set(plugin[snow].mode,          rain);
	set(plugin[snow].blendmode,     normal);
	set(plugin[snow].flakes,        2000);
	set(plugin[snow].color,         0x7FAFFF);
	set(plugin[snow].speed,         3.5);
	set(plugin[snow].shake,         1.0);
	set(plugin[snow].speedvariance, 1.0);
	set(plugin[snow].spreading,     3.0);
	set(plugin[snow].rainwidth,     1.0);
	set(plugin[snow].rainalpha,     0.5);
	set(plugin[snow].wind,          2.0);
&lt;/action&gt;	

&lt;action name="heavyrain"&gt;
	set(plugin[snow].mode,          rain);
	set(plugin[snow].blendmode,     normal);
	set(plugin[snow].flakes,        4000);
	set(plugin[snow].color,         0x9FAFFF);
	set(plugin[snow].speed,         4.1);
	set(plugin[snow].shake,         0.0);
	set(plugin[snow].speedvariance, 1.5);
	set(plugin[snow].spreading,     4.0);
	set(plugin[snow].rainwidth,     1.5);
	set(plugin[snow].rainalpha,     0.3);
	set(plugin[snow].wind,          3.0);
&lt;/action&gt;

</krpano>

将scene的onstart=“snowballs()”里面inclue snow.xml,可选样式


默认雪: onstart=”defaultsnow();”

                雪球:snowballs();

                银色星星:silverstars();

                金色星星:goldenstars();

                心形:hearts();

                笑脸:smileys();

                钱:money();

                雨:rain();

                大雨:heavyrain()