different entrances to same scene

  • I work on code where i want to change startup view of scene by multiple hotspots. If nothing is set, i want to have the default view set by tour_editor.

    so far, the code:

    when hotspot is placed with tour_editor i added this variables (hlook and vlook)

    <hotspot name="spot1" style="skin_hotspotstyle" ath="94.398" atv="8.915" linkedscene="scene_2" rotate="180" hlook="32.6" vlook="6" />

    in 'style' of hotspot in 'onclick' action i added this:

    set(var1, get(hlook)); set(var2, get(vlook));

    then on 'event' onnewpano i call changeview() action which is:

    <action name="changeview">
    if (var1 !== null, set(view.hlookat, get(var1)));
    if (var2 !== null, set(view.vlookat, get(var2)));
    set(var1,null);
    set(var2,null);
    </action>

    var1 and var2 are also set at startup to null.

    So, in Flash it works perfectly, but on HTML5 devices where vlook and hlook are not set, it shows strange view and blocks movement of new loaded scene...

    any idea?

  • my workaround:

    in hotspot i added 'en':

    Code
    <hotspot name="spot1" style="skin_hotspotstyle" ath="94.398" atv="8.915" linkedscene="scene_2" rotate="180" hlook="32.6" vlook="6" en="1" />

    in <style> of hotspot i added:

    Code
    set(var1, get(hlook)); set(var2, get(vlook)); set(var3, get(en));

    then on 'event' onnewpano i call changeview() action which is:

    Code
    <action name="changeview">
    	if (var3 == 1, set(view.hlookat, get(var1)); set(view.vlookat, get(var2)));
    	set(var3, 2);
    	set(var1,null);
    	set(var2,null);
    	</action>

    This is how i make custom startup view for diffrent scene entrances.
    It works everywhere *g*

Participate now!

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