I needed to do a tour that had multiple panos on each location, to show a kitchen renovation with 'before', 'during' and 'after' scenes. I'm nearly there but would welcome any feedback / suggestions of better ways to do it. I've not yet taken the 'after' panos so currently the tour just has 'before' and 'during' panos but you should get the idea of where it's going. The final tour may have day and night panos to show the lighting. Kitchen Rebuild
I added 2 elements to each scene: a location and a category. The location is used to group all panos at the same location. The category specifies the type of pano in that location, e.g. Before/After, Day/Night etc. This approach will work for any number of locations and in theory any number of categories (so it could do seasons, months etc). Each location doesn't need to have all categories.
<scene name="scene_1before" title="Location 1 Before" onstart="loadcategories();" thumburl="panos/1before.tiles/thumb.jpg" lat="" lng="" heading="" location="1" category="Before" >
The loadcategories() code removes the previous category menu items and rebuilds it based on which categories are available for the current location.
<action name="load categories"> <!-- remove all category item layers --> for(set(i, get(layer.count)), i GE 0, dec(i), if(layer[get(i)].parent == category_items, removelayer(get(layer[get(i)].name)); ) );
set(scene_location, get(scene[get(xml.scene)].location)); set(x, 30); <!-- for each scene check is the location matchs the current location --> for(set(i,0), i LT scene.count, inc(i), if(scene[get(i)].location == scene_location, copy(new_layer, scene[get(i)].category);
<!-- add the category menu item if it doesn't already exist --> if(layer[get(new_layer)] === null, copy(scene_name, scene[get(i)].name); copy(current_scene_name, scene[get(xml.scene)].name); addlayer(get(new_layer)); set(layer[get(new_layer)].url, "%SWFPATH%/plugins/textfield.swf"); set(layer[get(new_layer)].background, false); set(layer[get(new_layer)].textshadow, 1); set(layer[get(new_layer)].html, get(new_layer)); set(layer[get(new_layer)].align, top left); set(layer[get(new_layer)].x, get(x)); inc(x,100); set(layer[get(new_layer)].y, 0); set(layer[get(new_layer)].parent, category_items); <!-- if it's not the current category include a onclick action --> if(current_scene_name != scene_name, txtadd(onclick_action, 'loadscene(', get(scene_name), ', null, KEEPVIEW, BLEND(1)); skin_addthumbs();'); set(layer[get(new_layer)].onclick, get(onclick_action) ); set(layer[get(new_layer)].css, "color:#CCCCCC; font-family:Arial; font-weight:normal; font-size:16px;"); set(layer[get(new_layer)].enable, true); <!-- else display in different colour --> , set(layer[get(new_layer)].css, "color:#FFFFFF; font-family:Arial; font-weight:bold; font-size:16px;"); set(layer[get(new_layer)].enable, false); ); ); ); ); </action>
I also overrode some of vtourskin actions; to limit thumbnails, next and previous to the current category.
I'm thinking of moving the category menu to be part of the vtourskin as it seems to make sense to have location and category navigation together.
Questions:
1) I have the current category layer's enable flag set to false but the mouse pointer still shows a pointy hand as if it's a link. How do I disable this?
2) How do I change the style of a category layer on mouse hover?
I'm very new to krpano and keen to learn better ways of achieving things so an feedback would be great.
Thanks