Sie sind nicht angemeldet.

1

Samstag, 5. Juli 2014, 14:47

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

jordi

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

2

Samstag, 5. Juli 2014, 15:55

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
everpano.com step beyond 360

3

Samstag, 5. Juli 2014, 20:09

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

Tuur

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

4

Sonntag, 6. Juli 2014, 13:06

maybe something like:

Quellcode

1
2
3
4
5
6
7
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*

5

Sonntag, 6. Juli 2014, 14:46

Very clever !

It works guys ! Thank you very much. I have what I was looking for ! *thumbsup*

jordi

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

6

Montag, 7. Juli 2014, 14:02

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

Quellcode

1
2
3
4
5
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.
everpano.com step beyond 360

7

Montag, 7. Juli 2014, 16:02

All right !
Thank you !

8

Montag, 7. Juli 2014, 17:27

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 ?

jordi

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

9

Montag, 7. Juli 2014, 18:16

Yes, it's possible of course :

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); );



you can check the tooltip example
everpano.com step beyond 360

10

Montag, 7. Juli 2014, 22:29

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

Quellcode

1
2
3
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); );

jordi

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

11

Dienstag, 8. Juli 2014, 00:44

You should insert that code in the style of the hotspot, not in the action.
In the xml file of the tooltips you can see how is used,

http://krpano.com/examples/117/examples/…ps/tooltips.xml
everpano.com step beyond 360

12

Dienstag, 8. Juli 2014, 11:14

Well... I understand. But I can't get the good result...

Take a look : http://www.aircamera.fr/visite_virtuelle…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 ?

13

Dienstag, 8. Juli 2014, 11:34

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.

jordi

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

14

Dienstag, 8. Juli 2014, 12:54

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.
everpano.com step beyond 360