«

krpano制作snow

emer 发布于 2017-9-21 09:09   2293 次阅读     


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


snow.xml:

<krpano>

    <!-- the snow plugin -->
    <plugin name="snow" zorder="1"
            url="%SWFPATH%/plugins/snow.swf"
            alturl="%SWFPATH%/plugins/snow.js"
            floor="0.7"
            />

    <action name="defaultsnow">
        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);
    </action>

    <action name="snowballs">
        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);
    </action>

    <action name="snowflakes">
        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);
    </action>

    <action name="silverstars">
        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);
    </action>

    <action name="goldenstars">
        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);
    </action>

    <action name="hearts">
        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);
    </action>

    <action name="smileys">
        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);
    </action>

    <action name="money">
        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);
    </action>

    <action name="rain">
        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);
    </action> 

    <action name="heavyrain">
        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);
    </action>

</krpano>

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


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

                雪球:snowballs();

                银色星星:silverstars();

                金色星星:goldenstars();

                心形:hearts();

                笑脸:smileys();

                钱:money();

                雨:rain();

                大雨:heavyrain()