change parameters for spots style

  • Hi !


    I would like to know if it is possible to change one parameter from an action not on one spot, but for all spots that have same style.
    My idea is to use this code :



    set(hotspot[spotpolygon3496].hovering,true);



    but for all polygons spots.
    So it would be something like : set(style[Polygon].hovering,true); *question*

    I hope you'll understand what I mean.


    Thank you for your help !
    Best regards. Cyril

  • All the hotspots are in the same pano ?
    You have to keep in mind that hotspots in other scenes or panos are not accesible out of that pano.

    But if you have them in one pano you can do next :

    for(set(i,0), i LT hotspot.count, inc(i),
    if(hotspot[get(i)].point[0].ath,
    set(hotspot[get(i)].hovering, true);
    );
    );

    Hope it helps

  • It helps indeed ! Thank you Jordi !
    I need to adjust this code because it works for all the spots on the pano now... But I have 5 differents polygon styles. One is green, one is blue, there's also a red, a black and a white.
    There are a lot of polygon spots, and I would like this code to work only for blue polygons...
    Thank you once again !
    Cyril

  • maybe something like:

    Code
    for(set(i,0), i LT hotspot.count, inc(i),
      if(hotspot[get(i)].point[0].ath,
        if(hotspot[get(i)].fillcolor == 0x336699,
           set(hotspot[get(i)].hovering, true);
        );
      );
    );

    ?

    hope it helps
    Tuur *thumbsup*

  • So when fillcolor is the attribute you want to use to determinate which one to change, then you can just avoid the first if, and keep it lighter

    Code
    for(set(i,0), i LT hotspot.count, inc(i), 
      if(hotspot[get(i)].fillcolor == 0x336699,
        set(hotspot[get(i)].hovering, true);
      );
    );


    So if you have many hotspots, the action will be processed faster.

  • What can I add to this code to remove tooltips ?

    When my code is working, all my polygons are visible together instead of on mouse hovering. I'm really happy with this.
    But on the mouse cursor, I have always tooltip of the spot with higher "zorder ". I would like to have the tooltip only if cursor is really pointing on a spot. Is it possible ?

  • Hmmm...
    I'm not sure to understand where to paste this... Into action ?

    Code
    for(set(i,0), i LT hotspot.count, inc(i),   if(hotspot[get(i)].fillcolor == 0x336699,
        set(hotspot[get(i)].hovering, true);
      ); );onout="tween(layer[tooltip].alpha, 0.0, 0.25, default, set(layer[tooltip].visible,false), copy(layer[tooltip].x,mouse.stagex); copy(layer[tooltip].y,mouse.stagey); );
  • Well... I understand. But I can't get the good result...

    Take a look : http://www.aircamera.fr/visite_virtuel…2&h=6&v=39&f=90
    Click the blue button to display polygons. You'll see that tooltip is always on, until mouse is hovering and then exit from the spot...
    In fact I have :


    <style name="Polygonpistebleue"
    visible="false"
    borderwidth="0"
    borderwidthhover="4"
    borderalpha="0.0" fillalpha="0.0"
    bordercolorhover="0x0000ff" borderalphahover="1"
    fillcolorhover="0x0000ff" fillalphahover="0.4"
    capture="false"
    onhover="onhoverPolygonpistebleue"
    onout="onoutPolygonpistebleue"
    devices="flash"
    />
    <action name="onhoverPolygonpistebleue">
    showTooltip(hotspot);
    </action>
    <action name="onoverPolygonpistebleue">pauseautorotation();
    </action>
    <action name="onoutPolygonpistebleue">
    hideTooltip();resumeautorotation();
    </action>

    I tried to change "onhover" by "onover", and the result is better : tooltip is displayed 1 second when mouse is entering in the spot but no longer...
    You see what I mean ?

  • Another way to do it would be :


    for(set(i,0), i LT hotspot.count, inc(i),
    if(hotspot[get(i)].fillcolor == 0x0000ff,
    set(hotspot[get(i)].borderalpha, 1);
    set(hotspot[get(i)].fillalpha, 0.4);
    );
    );

    But in this case, "borderalpha" and "fillalpha" only work if autorotation is on... I don't know why.

  • I don't know exactlly what does panotour generate when you make your projects, but for what I have seen in other projects, the code is quite a mess and quite difficult to hand mantain. If you want me to full check it and make it work just send me a PM.

Jetzt mitmachen!

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