Multiple panos on each location - Day/Night, Before/After, Seasons etc

  • 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.

    Code
    <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.

    Code
    <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

  • Hi,

    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?

    The setting enabled=false should work:
    https://krpano.com/docu/xml/#layer.enabled

    but maybe the layer behind is also enabled...

    If you have enabled layers that shouldn't such the handcursor, that could be disabled with the handcursor setting:
    https://krpano.com/docu/xml/#layer.handcursor


    2) How do I change the style of a category layer on mouse hover?

    Use the onover and onout event (but no the onhover event):
    https://krpano.com/docu/xml/#layer.onover
    https://krpano.com/docu/xml/#layer.onout

    Set the attributes that should change in the onover event and set them back in the onout event.

    Best regards,
    Klaus

  • Thanks Klaus,

    The enabled flag was a mixture of parent definition (thanks) and a typo (enable rather than enabled). Fixed now.

    I've also added some extra panos for "AFTER" and night time with lighting. So I have 5 panos at one location and 3 at the others. I couldn't find any existing solutions that allowed for different numbers of panos at different locations. I hope the code can help others but as my first go at coding krpano it could probably be improved.

    Thanks,
    Ewen

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!