Adding Snow effect using toggle button  

Share your tips and tricks here or get help with any Panotour 2.0 problem!
No bug reports (of any kind) in this forum!
no avatar
Smudge2k
New member
 
Posts: 1
Joined: Sun Dec 01, 2013 1:05 pm

Adding Snow effect using toggle button

by Smudge2k » Sun Dec 01, 2013 1:08 pm

Hi,

Does any know a way using a toggle button on a tour, to turn on the snow or rain effect and then turn it off once the button is pushed again in panotour pro 2

Thanks

User avatar
Destiny
Moderator
 
Posts: 5105
Joined: Mon Apr 26, 2010 11:55 pm
Location: Australia

Re: Adding Snow effect using toggle button

by Destiny » Mon Dec 02, 2013 1:55 am

Hi.. You might find your answer here... If you can change your image that falls, you should be able to set it to nothing... basically turning this feature off... Just download it all and test it...

http://krpano.com/plugins/snow/#top

Destiny...

User avatar
benji33
Kolor Team
 
Posts: 3051
Joined: Tue Apr 09, 2013 10:59 am
Location: France

Re: Adding Snow effect using toggle button

by benji33 » Mon Dec 02, 2013 11:08 am

To apply on/off effect you have to destroy and create the plugin on demand.

Look after the removeplugin http://krpano.com/docu/actions/#removeplugin and addplugin http://krpano.com/docu/actions/#addplugin actions of krpano

User avatar
Destiny
Moderator
 
Posts: 5105
Joined: Mon Apr 26, 2010 11:55 pm
Location: Australia

Re: Adding Snow effect using toggle button

by Destiny » Wed Dec 04, 2013 10:56 am

Hi..

I have a worked out a work-around for turning snow off as well as rain on/off using the krpano plugin. However, I cannot work out yet how to achieve this using html5...

http://www.destinyvirtualtours.com/PTPV ... dRain.html

Destiny...

User avatar
benji33
Kolor Team
 
Posts: 3051
Joined: Tue Apr 09, 2013 10:59 am
Location: France

Re: Adding Snow effect using toggle button

by benji33 » Wed Dec 04, 2013 4:46 pm

Destiny wrote:Hi..

I have a worked out a work-around for turning snow off as well as rain on/off using the krpano plugin. However, I cannot work out yet how to achieve this using html5...

http://www.destinyvirtualtours.com/PTPV ... dRain.html

Destiny...



add into combobox => alturl="%SWFPATH%/plugins/combobox.js"

Code: Select all
<plugin name="combobox" url="%SWFPATH%/plugins/combobox.swf" align="leftbottom" x="10" y="10" width="120" rowcount="9">           />

Wrong "/> " added

User avatar
Destiny
Moderator
 
Posts: 5105
Joined: Mon Apr 26, 2010 11:55 pm
Location: Australia

Re: Adding Snow effect using toggle button

by Destiny » Wed Dec 04, 2013 10:09 pm

Thanks Benjamin.. It works..! =D

I changed the file location to both the swf and js with the all new version too..

http://www.destinyvirtualtours.com/PTPV ... ml5=prefer

I missed that syntax error.. Fixed that too.. Thanks..

Destiny..

User avatar
Destiny
Moderator
 
Posts: 5105
Joined: Mon Apr 26, 2010 11:55 pm
Location: Australia

Re: Adding Snow effect using toggle button

by Destiny » Wed Dec 04, 2013 11:05 pm

Anyone that needs this feature.. Copy and past this code into your #.xml code.
You will also need to create a 24bit png with nothing on it.. Provide the src.
If you want other stuff falling from the sky, just add as an imageurl and create your graphic.. Stars falling etc...

Here too, I have some extra code I am trying to get working, where the rotation is set to 'Random Horizon'.. Just for effect... Not happening at the moment.

You can add the suffix ?html5=prefer or ?html5=always for html5 or just keep it as swf...

Have fun.. When you have it working.. Say thank you to Klaus Reinfeld - krpano.. It's his original code but edited by me...

Destiny..


<view hlookat="0" vlookat="-80" fov="90" fisheye="0.35" />

<autorotate enabled="true" waittime="0.5" accel="1.0" speed="5.0" horizon="0.0" tofov="90" />

<action name="randomizehorizon">
sub(tmp, random, 0.5);
mul(autorotate.horizon, tmp, 180.0);
delayedcall(4, randomizehorizon());
</action>


<plugin name="snow"
url="%SWFPATH%/graphics/snow.swf"
alturl="%SWFPATH%/graphics/combobox.js"
blendmode="normal"
mode="snow"
imageurl=""
imagescale="1.0"
flakes="4000"
color="0xFFFFFF"
floor="0.3"
speed="1.0"
spreading="4.0"
shake="4.0"
speedvariance="2.0"
rainwidth="0.5"
rainalpha="0.5"
/>


<plugin name="combobox" url="%SWFPATH%/graphics/combobox.swf" alturl="%SWFPATH%/graphics/combobox.js" align="leftbottom" x="10" y="10" width="120" rowcount="9">
<item name="opt1" caption="Snow" onclick="snow();" />
<item name="opt2" caption="Windy Snow" onclick="windysnow();" />
<item name="opt3" caption="Rain" onclick="rain();" />
<item name="opt4" caption="Heavy Rain" onclick="heavyrain();" />
<item name="opt10" caption="Off Snow and Rain" onclick="destiny();" />
</plugin>

<action name="snow">
set(plugin[snow].mode, snow);
set(plugin[snow].blendmode, normal);
set(plugin[snow].count, 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="windysnow">
set(plugin[snow].mode, snow);
set(plugin[snow].blendmode, normal);
set(plugin[snow].count, 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, 5.0);
</action>

<action name="rain">
set(plugin[snow].mode, rain);
set(plugin[snow].blendmode, normal);
set(plugin[snow].count, 2000);
set(plugin[snow].color, 0x7FAFFF);
set(plugin[snow].speed, 2.0);
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].count, 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>



<action name="destiny">
set(plugin[snow].mode, image);
set(plugin[snow].imageurl, '%CURRENTXML%/destiny.png');
set(plugin[snow].blendmode, add);
set(plugin[snow].count, 0);
set(plugin[snow].imagescale, 0);
set(plugin[snow].speed, 0);
set(plugin[snow].shake, 0);
set(plugin[snow].speedvariance, 0);
set(plugin[snow].spreading, 0);
set(plugin[snow].wind, 0);
</action>


Return to Using Panotour / Panotour Pro

Who is online

Users browsing this forum: gkaefer and 2 guests