Benutzerinformationen überspringen
Wohnort: Wellington, New Zealand
Beruf: Trying to build an entire walkthrough of NZ for tourists
|
|
Quellcode |
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 |
<action name="prenex"> trace(scene.count); set(totalviews,get(scene.count)); set(i,0); prenex2(get(i),%1,get(cview)); </action> <action name="prenex2"> if(scene[%1].name==%3, set(v,%1); prenex3(%1,%2,get(totalviews)) , inc(i); prenex2(get(i),%2,%3); ); </action> <action name="prenex3"> trace(%1___%2___%3); if(%2==prev, if(%1==0, dec(totalviews); prenex_load(get(totalviews)) , dec(v); prenex_load(get(v)) ); ); if(%2==next, if(%1==%3, prenex_load(0) , inc(v); prenex_load(get(v)) ); ); </action> <action name="prenex_load"> trace(%1); loadscene(get(scene[%1].name),null,MERGE,blend(0.3)), </action> |
|
|
Quellcode |
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 |
<action name="prevscene">
if(%1 != findnext, sub(i,scene.count,1));
txtadd(scenexml,'<krpano>',get(scene[%i].content),'</krpano>');
if(scenexml == xml.content,
dec(i);
if(i LT 0, sub(i,scene.count,1));
loadscene(get(scene[%i].name), null, MERGE, BLEND(1));
,
dec(i);
if(i GE 0, prevscene(findnext));
);
</action>
<action name="nextscene">
if(%1 != findnext, set(i,0));
txtadd(scenexml,'<krpano>',get(scene[%i].content),'</krpano>');
if(scenexml == xml.content,
inc(i);
if(i == scene.count, set(i,0));
loadscene(get(scene[%i].name), null, MERGE, BLEND(1));
,
inc(i);
if(i LT scene.count, nextscene(findnext));
);
</action>
|
Benutzerinformationen überspringen
Wohnort: Wellington, New Zealand
Beruf: Trying to build an entire walkthrough of NZ for tourists
Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.comno, not that code, the informations about the scenes are all loaded and there and it's possible to check for them,will this way also work with 'no scene' pano's? or is there an other code for that..
I have used a small trick for that:Klaus how in the did you get so smart? Does code just come naturally? my next and previos buttons work but not like that. i had to create 12 different actions then set the onclicks to set what the next onclick would load.

that's a bit more complex,Possible to disable the Preview Button when you are in scene1, and the Next Button when you are in the last scene , eg scene6 ?
|
|
Quellcode |
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 |
<action name="enable_button">
set(plugin[%1].enabled,%2);
if(%2 == false, tween(plugin[%1].alpha, 0.2), tween(plugin[%1].alpha, 1.0));
</action>
<action name="update_prev_next_buttons">
sub(maxsceneindex, scene.count, 1);
if(%1 LE 0, enable_button('prev scene', false), enable_button('prev scene', true));
if(%1 GE maxsceneindex, enable_button('next scene', false), enable_button('next scene', true));
</action>
<action name="prevscene">
if(%1 != findnext, sub(i,scene.count,1));
txtadd(scenexml,'<krpano>',get(scene[%i].content),'</krpano>');
if(scenexml == xml.content,
dec(i);
if(i GE 0, loadscene(get(scene[%i].name), null, MERGE, BLEND(1)); );
update_prev_next_buttons(get(i));
,
dec(i);
if(i GE 0, prevscene(findnext));
);
</action>
<action name="nextscene">
if(%1 != findnext, set(i,0));
txtadd(scenexml,'<krpano>',get(scene[%i].content),'</krpano>');
if(scenexml == xml.content,
inc(i);
if(i LT scene.count, loadscene(get(scene[%i].name), null, MERGE, BLEND(1)); );
update_prev_next_buttons(get(i));
,
inc(i);
if(i LT scene.count, nextscene(findnext));
);
</action>
|
Hi Klaus. I know this is a great solution but since I am thick could you please check why mine is not workingI have used a small trick for that:
internally when loading a scene, it's content is stored in the "xml.content" variable (inside a <krpano> tag),
then I loop through all scenes (known via "scene.count") and check if it is the current scene, and if yes,
the previous or next scene will be loaded,
|
|
Quellcode |
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 |
<krpano version="1.0.8" logkey="false"> <include url="%SWFPATH%/plugins.xml" /> <include url="videotour0.xml"/> <plugin name="data" keep="true"/> <textstyle name="DEFAULT" alpha="1" bold="false" font="Arial" fontsize="16" italic="false" textcolor="0xff000000"/> <plugin name="logo" url="videotourdata/graphics/logo.png" keep="true" align="rightbottom" x="10" y="10" width="109" height="18" onclick="openurl(http://www.myomsk.info,_blank)"/> <plugin name="in" align="bottom" keep="true" ondown="set(movevectorz,-1);" onout="set(blendmode,normal);" onover="set(blendmode,add);" onup="set(movevectorz,0);" url="videotourdata/graphics/menu/menu0.png" x="-160" y="10"/> <plugin name="out" align="bottom" keep="true" ondown="set(movevectorz,+1);" onout="set(blendmode,normal);" onover="set(blendmode,add);" onup="set(movevectorz,0);" url="videotourdata/graphics/menu/menu1.png" x="-120" y="10"/> <plugin name="left" align="bottom" keep="true" ondown="set(movevectorx,-1);" onout="set(blendmode,normal);" onover="set(blendmode,add);" onup="set(movevectorx,0);" url="videotourdata/graphics/menu/menu2.png" x="-80" y="10"/> <plugin name="right" align="bottom" keep="true" ondown="set(movevectorx,+1);" onout="set(blendmode,normal);" onover="set(blendmode,add);" onup="set(movevectorx,0);" url="videotourdata/graphics/menu/menu3.png" x="-40" y="10"/> <plugin name="prevscene" align="bottom" keep="true" onclick="action(prevscene);" onout="set(blendmode,normal);" onover="set(blendmode,add);" url="videotourdata/graphics/menu/menu4.png" x="0" y="10"/> <plugin name="nextscene" align="bottom" keep="true" onclick="action(nextscene);" onout="set(blendmode,normal);" onover="set(blendmode,add);" url="videotourdata/graphics/menu/menu5.png" x="40" y="10"/> <plugin name="home" align="bottom" blendmode="normal" keep="true" onclick="lookto(get(panoview.h),get(panoview.v),get(panoview.fov),smooth(100,20,50));" onout="set(blendmode,normal);" onover="set(blendmode,add);" url="videotourdata/graphics/menu/menu6.png" x="80" y="10"/> <plugin name="openfs" align="bottom" blendmode="screen" keep="true" onclick="set(fullscreen,true);" onout="set(blendmode,screen);" onover="set(blendmode,add);" url="videotourdata/graphics/menu/menu7.png" x="120" y="10"/> <plugin name="closefs" align="bottom" blendmode="screen" keep="true" onclick="set(fullscreen,false);" onout="set(blendmode,screen);" onover="set(blendmode,add);" url="videotourdata/graphics/menu/menu8.png" visible="false" x="120" y="10"/> <events onenterfullscreen="set(plugin[openfs].visible,false); set(plugin[closefs].visible,true);" onexitfullscreen="set(plugin[openfs].visible,true); set(plugin[closefs].visible,false);"/> <plugin name="autorotation" align="bottom" blendmode="screen" keep="true" onclick="switch(autorotate.enabled);" onout="set(blendmode,screen);" onover="set(blendmode,add);" url="videotourdata/graphics/menu/menu9.png" x="160" y="10"/> <action name="prevscene"> if(%1 != findnext, sub(i,scene.count,1)); txtadd(scenexml,'<krpano>',get(scene[%i].content),'</krpano>'); if(scenexml == xml.content, dec(i); if(i LT 0, sub(i,scene.count,1)); loadscene(get(scene[%i].name), null, MERGE, BLEND(1)); , dec(i); if(i GE 0, prevscene(findnext)); ); </action> <action name="nextscene"> if(%1 != findnext, set(i,0)); txtadd(scenexml,'<krpano>',get(scene[%i].content),'</krpano>'); if(scenexml == xml.content, inc(i); if(i == scene.count, set(i,0)); loadscene(get(scene[%i].name), null, MERGE, BLEND(1)); , inc(i); if(i LT scene.count, nextscene(findnext)); ); </action> </krpano> |
I'm already planing that, but this needs a bigger change in the core viewer engine, so it can still take some time,Any chance that you could better (improve) this code by allowing the scene to transition, or tween, into the next scene without stopping when autorotate is enabled? That would make it perfect for timelapse shots.
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »nefar1ous« (21. April 2011, 16:58)
Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
|
|
Quellcode |
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 |
<plugin name="btn_pic_next" url="../../skin/gallery_right.png" keep="true" visible="false" alpha="0.6" parent="base_pic" align="center" x="240" y="145" scale="0.2" zorder="100" onover="tween(alpha,1)" onout="tween(alpha,0.6)" onclick="next_pic();" />
<action name="next_pic" >
if(plugin[firstthumb].visible == true,
removeplugin(firstthumb);
inc(i);
,
inc(i);
<!-- ???????????? tried a lot different things... but no succes -->
);
trace('name=',get(plugin[get(pn)].url));
</action>
<action name="open_gallery">
wait(2);
tween(plugin[pic_bg].height,350,0.5);
tween(plugin[pic_bg].width,100,0.5,,WAIT);
tween(plugin[pic_bg].width,550,0.7,,WAIT);
set(plugin[btn_pic_next].visible,true);
set(plugin[btn_pic_previous].visible,true);
addplugin(firstthumb);
set(plugin[firstthumb].url, get(pic.thumb[thumb_0].url));
set(plugin[firstthumb].alpha, 1);
set(plugin[firstthumb].visible, true);
set(plugin[firstthumb].align, center);
set(plugin[firstthumb].zorder, 100);
set(plugin[firstthumb].x, 200);
set(plugin[firstthumb].y, -20);
set(plugin[firstthumb].effect,glow(0xFFFFFF,1,15,10000));
set(plugin[firstthumb].roundedge,20);
</action>
<action name="showpic">
if(plugin[firstthumb].visible == true, removeplugin(firstthumb););
removeplugin(get(pn));
txtadd(pn,'thumb_',get(i));
addplugin(get(pn));
set(plugin[get(pn)].url, get(pic.thumb[get(name)].url));
set(plugin[get(pn)].alpha, 1);
set(plugin[get(pn)].visible, true);
set(plugin[get(pn)].align, center);
set(plugin[get(pn)].zorder, 100);
set(plugin[get(pn)].x, 200);
set(plugin[get(pn)].y, -20);
set(plugin[get(pn)].effect,glow(0xFFFFFF,1,15,10000));
set(plugin[get(pn)].roundedge,20);
</action>
<pic>
<thumb name="thumb_0" url="../images/001.jpg" title="Test" todo="lookat(240,0,50);showpic();" />
<thumb name="thumb_1" url="../images/002.jpg" title="Test" todo="lookat(40,0,50);" />
<thumb name="thumb_2" url="../images/003.jpg" title="Test" todo="lookat(340,0,50);" />
<thumb name="thumb_3" url="../images/004.jpg" title="another test" todo="showpic();" />
<thumb name="thumb_4" url="../images/005.jpg" title="Test" todo="showpic();" />
<thumb name="thumb_5" url="../images/006.jpg" title="Test" todo="showpic();" />
<thumb name="thumb_6" url="../images/007.jpg" title="Test" todo="" />
<thumb name="thumb_7" url="../images/008.jpg" title="Test" todo="showpic();" />
<thumb name="thumb_8" url="../images/009.jpg" title="keep testing" todo="lookat(140,0,50);" />
<thumb name="thumb_9" url="../images/010.jpg" title="keep testing" todo="lookat(140,0,50);" />
<thumb name="thumb_10" url="../images/011.jpg" title="keep testing" todo="lookat(140,0,50);" />
<thumb name="thumb_11" url="../images/012.jpg" title="keep testing" todo="lookat(140,0,50);" />
</pic>
|
: https://pame.virtualtuur.comBenutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
|
|
Quellcode |
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 |
<plugin name="btn_pic_next" url="../../skin/gallery_right.png" keep="true" visible="false" alpha="0.6" parent="base_pic"
align="center" x="240" y="145" scale="0.2" zorder="100" onover="tween(alpha,1)" onout="tween(alpha,0.6)" onclick="next_pic();" />
<action name="next_pic" >
if(plugin[firstthumb].visible == true,
removeplugin(firstthumb);
inc(i);
,
inc(i);
<!-- ???????????? tried a lot different things... but no succes -->
);
trace('name=',get(plugin[get(pn)].url));
</action>
<action name="open_gallery">
wait(2);
tween(plugin[pic_bg].height,350,0.5);
tween(plugin[pic_bg].width,100,0.5,,WAIT);
tween(plugin[pic_bg].width,550,0.7,,WAIT);
set(plugin[btn_pic_next].visible,true);
set(plugin[btn_pic_previous].visible,true);
addplugin(firstthumb);
set(plugin[firstthumb].url, get(pic.thumb[thumb_0].url));
set(plugin[firstthumb].alpha, 1);
set(plugin[firstthumb].visible, true);
set(plugin[firstthumb].align, center);
set(plugin[firstthumb].zorder, 100);
set(plugin[firstthumb].x, 200);
set(plugin[firstthumb].y, -20);
set(plugin[firstthumb].effect,glow(0xFFFFFF,1,15,10000));
set(plugin[firstthumb].roundedge,20);
</action>
<action name="showpic">
if(plugin[firstthumb].visible == true, removeplugin(firstthumb););
removeplugin(get(pn));
txtadd(pn,'thumb_',get(i));
addplugin(get(pn));
set(plugin[get(pn)].url, get(pic.thumb[get(name)].url));
set(plugin[get(pn)].alpha, 1);
set(plugin[get(pn)].visible, true);
set(plugin[get(pn)].align, center);
set(plugin[get(pn)].zorder, 100);
set(plugin[get(pn)].x, 200);
set(plugin[get(pn)].y, -20);
set(plugin[get(pn)].effect,glow(0xFFFFFF,1,15,10000));
set(plugin[get(pn)].roundedge,20);
</action>
<pic>
<thumb name="thumb_0" url="../images/001.jpg" title="Test" todo="lookat(240,0,50);showpic();" />
<thumb name="thumb_1" url="../images/002.jpg" title="Test" todo="lookat(40,0,50);" />
<thumb name="thumb_2" url="../images/003.jpg" title="Test" todo="lookat(340,0,50);" />
<thumb name="thumb_3" url="../images/004.jpg" title="another test" todo="showpic();" />
<thumb name="thumb_4" url="../images/005.jpg" title="Test" todo="showpic();" />
<thumb name="thumb_5" url="../images/006.jpg" title="Test" todo="showpic();" />
<thumb name="thumb_6" url="../images/007.jpg" title="Test" todo="" />
<thumb name="thumb_7" url="../images/008.jpg" title="Test" todo="showpic();" />
<thumb name="thumb_8" url="../images/009.jpg" title="keep testing" todo="lookat(140,0,50);" />
<thumb name="thumb_9" url="../images/010.jpg" title="keep testing" todo="lookat(140,0,50);" />
<thumb name="thumb_10" url="../images/011.jpg" title="keep testing" todo="lookat(140,0,50);" />
<thumb name="thumb_11" url="../images/012.jpg" title="keep testing" todo="lookat(140,0,50);" />
</pic>
|
: https://pame.virtualtuur.comBenutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.com