INTRO IMAGE - "ONLY NEED IT ONCE"

  • Hey,
    I'm using a plugin to create an intro image for instructions. I can't get it to play "globally" so it loads into my first scene. After clicking it, it goes away and "according" to the example from Klaus, the "removeplugin" destroys it. Problem is, everytime I revisit the same "intro" scene using the thumbnails, the intro image pops back up (because it is "embedded" into the xml tags of the 1st scene). I've tried virtually everything I can find in the forums which comes close to relating in some form or another and I'm lost.
    I haven't quite grasped variables yet, so if anyone could help with a short code break for me...
    I have multiple scenes and the darn thing only pops up on the 1st "intro" scene each time it is revisited. Otherwise ALL is well.
    Thanks.

  • set the intro image to visible false in the plugin code.

    create a dummy plugin.

    <plugin name="only1time"
    onlyonce="0"
    />

    then add to the action that closes the intro image the first time.
    set(plugin[only1time].onlyonce, 1);

    then make an if statment to check on the 1 time state. run this on the an event like onstart, onxmlcomplete.
    if(plugin[only1time].onlyonce == 0, set(plugin[introimage].visible, true);

    the very first time it loads it will become visible, then the first time you close it it sets the 1 time variable to 1 so then when it is reloaded it will be skipped. no point in removing the plugin as each time you return it will be rebuild. instead of removing it just set it visible="false"

  • VN2011,

    Worked like a charm - THANKS. I also now have a better understanding of how to CALL and use a variable. I found one thread on calling a variable but the suggested link to describe it was dead. Using dummie's was an idea I hadn't thought of.
    i kept the "hideimage" code from the original "introimage" example from Klaus which still disables and destroys the plugin... not sure if all is needed but it works. The onclick function for the image doesn't show up when hovering over the dead area either (not sure if "visible, false" handles that or not) so everything is definitely 100%.
    I believe now I can advance another level in my learning curve while I try more work with variables.
    Thanks,
    Tony

    <action name="startup">
    if(plugin[only1time].onlyonce == 0, set(plugin[introimage].visible, true));
    </action>

    <action name="hideintroimage">
    set(plugin[only1time].onlyonce, 1);
    if(plugin[introimage].enabled,
    set(plugin[introimage].enabled,false);
    tween(plugin[introimage].alpha, 0.0, 2.5, default, removeplugin(introimage)););
    </action>

    <scene>
    ...
    <plugin name="only1time"
    onlyonce="0"
    />

    <plugin name="introimage"
    keep="false"
    visible="false"
    url="images/instructions.jpg"
    align="center"
    scale=".9"
    onloaded="set(alpha,0); tween(alpha,1);"
    onclick="hideintroimage();" />

    </scene>

  • VN2011,

    Worked like a charm - THANKS. I also now have a better understanding of how to CALL and use a variable. I found one thread on calling a variable but the suggested link to describe it was dead. Using dummie's was an idea I hadn't thought of.
    i kept the "hideimage" code from the original "introimage" example from Klaus which still disables and destroys the plugin... not sure if all is needed but it works. The onclick function for the image doesn't show up when hovering over the dead area either (not sure if "visible, false" handles that or not) so everything is definitely 100%.
    I believe now I can advance another level in my learning curve while I try more work with variables.


    I want to implement your example in my pano, but unfortunately i'm not able to make it working. When is one of parameters of plugin introimage set "visible=false", then my introimage will never appear. If there is nothing, or true, then it will appear after every load of this particular point of panorama.

    Is there any way how to check current value of different variables, so i can check if value changed?

    Thanks

  • Hey, I'll second that *wink*

    The code looks like it's going to do the business but setting it to visible="false" means it never appears at all. Perhaps there is some code missing from the example that nefar1ous has given?

    For my project I'm trying to get the instructions to load just the once automatically but then they are still accessible in the future if the user clicks on the 'Info' button which is down with the zoom In, Zoom out etc buttons.

    mindlessboss, your example is a little out of my xml knowlege *sad*

  • try this ...

    <plugin
    name="intro"
    url="intro.png"
    align="center"
    keep="true"
    onloaded="showintro();"
    onclick="hideintro();"
    zorder="100"
    handcursor="false"
    />

    <plugin
    name="buttonToShowIntroAgain"
    url="button.png"
    keep="true"
    onclick="showintro();"
    />

    <action name="showintro">
    set(plugin[intro].enabled,true);
    tween(plugin[intro].alpha, 1, 0.5, default);
    </action>

    <action name="hideintro">
    if(plugin[intro].enabled,
    set(plugin[intro].enabled,false);
    tween(plugin[intro].alpha, 0.0, 0.5, default);
    );
    </action>

Participate now!

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