You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

jeromebg

Professional

  • "jeromebg" started this thread

Posts: 819

Location: Angers - France

Occupation: Photographer

  • Send private message

1

Sunday, August 16th 2015, 6:04pm

onviewchanged testhotspots & callwith

Hi,
I'm using the Klaus testhotspot action to select hotspots when they are in the middle of the screen (to use with a Leap Motion).
It works but I have a small issue to set them to the onover state.
Sometimes it works perfect, and sometimes they switch from onover to onout very quickly even if they are still in the middle of the screen, and the hovering state is still on true...
here is my code :

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<events name="testshotspots" keep="true" onviewchanged="testhotspots();"/>

<action name="testhotspots">
    for(set(i,0), i LT hotspot.count, inc(i),
        getlooktodistance(d, hotspot[get(i)].ath, hotspot[get(i)].atv);
        if(d LT 8,
            highlight_hotspot(get(i), get(hotspot[get(i)].name));
          ,
            background_hotspot(get(i), get(hotspot[get(i)].name));
          );
      );
</action>

<action name="highlight_hotspot">
    if(hotspot[%1].ishighlighted != true,
		set(activehotspot,%2);
                set(hotspot[%1].ishighlighted, true);
		callwith(hotspot[%2], onover);
		callwith(plugin[%2], onover);
		set(plugin[%2].hovering, true);
     );
</action>

<action name="background_hotspot">
	if(hotspot[%1].ishighlighted,
    	set(hotspot[%1].ishighlighted, false);
		callwith(hotspot[%2], onout);
		callwith(plugin[%2], onout);
		set(plugin[%2].hovering, false);
		set(activehotspot,null);
	);
</action>

<hotspot name="sainte_marie" ath="89.352" atv="4.079" style="trait"/>
<plugin name="sainte_marie"
	         style="tospot"
	         parent="hotspot[sainte_marie]"
			 tooltip="
			 [font color='#cba934' size='26' style='font-size:26px; text-align:center' align='center']Chapelle Sainte-Marie[/font][br]
			 L’ancienne chapelle de l’hospice Sainte-Marie est construite vers 1850. Composée d’un portique d’entrée d’inspiration antique elle est surmontée d’un dôme et renferme un remarquable ensemble de peintures murales."
			 onclick="looktohotspot(get(name) , 5, smooth(25,50,25));loadpano(sainte_marie.xml, null, MERGE, BLEND(2))"
	         />


any ideas ?

jeromebg

Professional

  • "jeromebg" started this thread

Posts: 819

Location: Angers - France

Occupation: Photographer

  • Send private message

2

Sunday, August 16th 2015, 11:20pm

Ok, got the problem, when two hotspots are too near, a hotspot is already "highlighted" and a second one can be highlighted too if it's in the same area, so when the second one is out it calls "background_hotspot" action wich will hide the texfield (tooltip) of the first one as they use the same plugin...
Hum, don't know how to manage that...