Stage width for thumbnails

  • I would like to restrict the width and height for the opening of the vtour thumbs but the only way I can find is to set the margin on the opposite side they load to.

    However that means different loading depending on the window size. And that gives also problems with portrait and horisontal viewing on all devices that you can turn.
    Reloading on resize works but the thumbs loads very slow so thats not a good way.
    I want to say that they should occupy for example 200 pixels width and height from bottomleft. That would make a nice square with 16 50x50 pixels thumbs.

    I have not been able to find the correct code for this.

    Hans

  • He Hans,

    it says

    <action name="openthumb">
    if(%2 != NEXT,
    set(pos,0);
    copy(curpos, plugin[%1].thumbpos);
    set(xdst, 0);
    set(ydst, 0);
    );

    if(pos LT curpos,
    inc(pos);
    inc(ydst,70);
    sub(ymax, stageheight, 100);
    if(ydst GT ymax, inc(xdst,70);set(ydst,0); );
    openthumb(%1,NEXT);
    ,
    add(xdst,10);
    add(ydst,55);
    tween(plugin[%1].x, get(xdst) );
    tween(plugin[%1].y, get(ydst) );
    tween(plugin[%1].width, 60);
    tween(plugin[%1].height, 60);
    );
    </action>

    change that stageheight for example to 300..

    so:

    <action name="openthumb">
    if(%2 != NEXT,
    set(pos,0);
    copy(curpos, plugin[%1].thumbpos);
    set(xdst, 0);
    set(ydst, 0);
    );

    if(pos LT curpos,
    inc(pos);
    inc(ydst,70);
    sub(ymax, 300, 100);
    if(ydst GT ymax, inc(xdst,70);set(ydst,0); );
    openthumb(%1,NEXT);
    ,
    add(xdst,10);
    add(ydst,55);
    tween(plugin[%1].x, get(xdst) );
    tween(plugin[%1].y, get(ydst) );
    tween(plugin[%1].width, 60);
    tween(plugin[%1].height, 60);
    );
    </action>

    if that is what you mean..

    Tuur *thumbsup*

  • i think Tuurs will work sub(ymax, 300, 100); is basically jsut subtracting 100 from 300 instead of the stage.

    or you could just set ymax to what you want it to be then it is not calculated.

    <action name="openthumb">
    if(%2 != NEXT,
    set(pos,0);
    copy(curpos, plugin[%1].thumbpos);
    set(xdst, 0);
    set(ydst, 0);
    );

    if(pos LT curpos,
    inc(pos);
    inc(ydst,70);
    sub(ymax, stageheight, 100); change that to ->set(ymax, 200);
    if(ydst GT ymax, inc(xdst,70);set(ydst,0); );
    openthumb(%1,NEXT);
    ,
    add(xdst,10);
    add(ydst,55);
    tween(plugin[%1].x, get(xdst) );
    tween(plugin[%1].y, get(ydst) );
    tween(plugin[%1].width, 60);
    tween(plugin[%1].height, 60);
    );
    </action>

  • Perhaps you can solve this also.

    I want to hide the open thumbs.
    No problem I just ad.

    <action name="buildthumbs">
    if(%1 != NEXT, set(i,0));
    if(i LT scene.count,
    copy(thumb, scene[get(i)].thumburl);
    txtadd(thumbname,'thumb_',get(i));
    addplugin(get(thumbname));
    set(plugin[get(thumbname)].url, get(thumb));
    set(plugin[get(thumbname)].keep, true);
    set(plugin[get(thumbname)].align, bottomleft);
    set(plugin[get(thumbname)].alpha,0.0);
    set(plugin[get(thumbname)].width, 40);
    set(plugin[get(thumbname)].height, 40);
    set(plugin[get(thumbname)].x, 10);
    set(plugin[get(thumbname)].y, 10);
    mul(plugin[get(thumbname)].x, i,3);
    mul(plugin[get(thumbname)].y, i,3);
    add(plugin[get(thumbname)].x, 5);
    add(plugin[get(thumbname)].y, 5);
    copy(plugin[get(thumbname)].xsmall, plugin[get(thumbname)].x);
    copy(plugin[get(thumbname)].ysmall, plugin[get(thumbname)].y);
    add(plugin[get(thumbname)].zorder, 100, i);
    set(plugin[get(thumbname)].effect,glow(0xFFFFFF,1.0,2,10000));
    set(plugin[get(thumbname)].jsborder,'1px solid #FFFFFF');
    copy(plugin[get(thumbname)].thumbpos, i);
    set(plugin[get(thumbname)].linkedscene, get(scene[get(i)].name) );
    set(plugin[get(thumbname)].onclick, openthumbs() );

    inc(i);
    buildthumbs(NEXT);
    );
    </action>

    But how do I make a button that changes it to alpha 1 again.
    I tried this ondown="set(plugin[get(thumbname)].alpha,1.0);"

    but that only gives me the last button.

    Hans


  • *thumbsup*

  • sub(xmax, 300, 100);

    could still be set(xmax, 200); no need to to the math when the end result is the same.

    But how do I make a button that changes it to alpha 1 again.
    I tried this ondown="set(plugin[get(thumbname)].alpha,1.0);"

    another way to do this. using these actions. the actions loop through all hotspots or plugins depending on what you ask it to do. it then searches for a variable that you declare and adjsuts it accordingly.

    <action name="tween_hotspots/plugin">
    sub(i,%1.count,1);
    if(i GE 0,tween_loop_all_hotspots/plugin(get(i),%1,%2,%3,%4,%5));
    </action>

    <action name="tween_loop_all_hotspots/plugin">
    if(%5 == null,
    tween(%2[%1].%3,%4);
    ,
    if(%2[%1].%5 == %6,
    tween(%2[%1].%3,%4);
    );
    );
    dec(i);
    if(i GE 0, tween_loop_all_hotspots/plugin(get(i),%2,%3,%4,%5,%6) );
    </action>

    then use this on the button.

    tween_hotspots/plugin(plugin,alpha,1,tag,thumbs);

    need to add this to your buildthumbs action.

    set(plugin[get(thumbname)].tag,thumb);

    this will loop though all plugins looking for the tag="thumb" when it finds a plugin with tag="thumb" it will tween the alpha from 0 -> 1. the nice thing about this is it can be used to loop through and detect any variable and make the needed changes.

    i use tags now on almost everything. all my buttons have a tag="button" all plugins used to make the tour skin are marked tag="skin" once they all have thier tags i can loop through anything and hide, tween or set anything. it basically makes it so you can group hotspots and plugins and adjust them all at the same time quickly.

    EDIT: i used a second set of actions to SET things these are for TWEEN. But could change tween to %7 and then run things like this.

    hotspots/plugin(plugin,alpha,1,tag,thumbs,tween); will tween the alpha from 0 - 1
    hotspots/plugin(plugin,visible,true,tag,thumbs,set); will set them visible if they are false.

  • Thanks both

    Tuur your actions work great after I found out that they had the closethumbs included which had to be removed.
    I also changed to alpha

    VN2011
    You say that "could still be set(xmax, 200);"
    No you can't, that results in just a long single row.

    I will have to look more into your codes. They say me nothing . It's volapyk to me, I need to use codes I can read and understand from that.
    This is the difference between FPP and KRpano.
    FPP is 10 times easier than KRPano for the normal photographer like me because all codes are easy understandable from the text.

    If you need advanced KRpano coding it is not understandable without a lot of knowledge in coding language.

    Here is the result until now.
    http://www.360-foto.dk/aarhus1/

    I have left the visibillity to 0.1 so you can see what happens.
    In reality I want to hide the thumbs completely when loading a pano and show up only after you hover the banner. The banner can of course also be unvisible.
    On the iPad you need a touch on the banner to make the thumbs visible. This is just for my own portfolio on the iPad and my Android phone so I do not need any instructions or special buttons.

    If you use the closebuttons on iPad it takes 5 sec to load them each time with 25 thumbs, by just hiding them it is instant back again.

    Hans

  • Great vode VN!!

    its not mine Michel wrote it for me about a year ago but i use it in every single tour now.

    I will have to look more into your codes. They say me nothing . It's volapyk to me, I need to use codes I can read and understand from that.

    I hear you Hans i started the same way. in all honesty i dont even know how the code works i just know how to use it. for what i know is to jsut paste the 2 actions in your main xml. then use this line to detect and manipulate almost anything.

    tween_hotspots/plugin(plugin,alpha,1,tag,thumbs);

    here is the post where Michel explains how it all works.
    dynamically remove all hotspots

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!